Community
Participate
Working Groups
3.1 get the hover of 'B' in the field declaration. The hover shows pack.A.B<String, String>. Setting a breakpoint in JavaElementLabels.getTypeLabel you can see that BindingKey key= new BindingKey(type.getKey()); String[] typeArguments= key.getTypeArguments(); returns 2 type arguments for B instead of one. public class A<U> { class B<V> { } A<String>.B<String> s = new A<String>().new B<String>(); }
The bug comes from the fact that the getTypeArguments() returns all the type arguments for the key, not just the one for the selected type. So in this case you get the type argument that applies to A and the one that applies to B. According to the javadoc, this might not be wrong. It might not be what you expect, but this seems to behave as specified. Moving to Jérôme for clarification on the spec.
I disagree with Olivier. The binding key is for type B<String>, so its type arguments should only include String. getTypeArguments() should be fixed.
Created attachment 73135 [details] Proposed fix and regression tests
Created attachment 73305 [details] Proposed fix (fixed typo) and regression tests
Fix and tests released for 3.4M1 in HEAD.
Verified for 3.4M1 using build I20070802-0800.