Community
Participate
Working Groups
N20050509-0010 In java.util.List<E>, consider <T> T[] toArray(T[] a); The key for T[] is [Ljava/util/List;.toArray<T:Ljava/lang/Object;>([TT;)[TT;:TT; Resolving this key to a binding via ASTParser.createASTs(..) fails with the CCE below. To reproduce, you can use the ASTView (View Menu > Resolve Binding Key...). java.lang.ClassCastException: org/eclipse/jdt/internal/compiler/lookup/ArrayBinding incompatible with org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding at org.eclipse.jdt.internal.core.util.BindingKeyResolver.consumeMethod(BindingKeyResolver.java) at org.eclipse.jdt.internal.core.util.BindingKeyParser.parseMethod(BindingKeyParser.java:666) at org.eclipse.jdt.internal.core.util.BindingKeyParser.parse(BindingKeyParser.java:560) at org.eclipse.jdt.internal.core.util.BindingKeyParser.parse(BindingKeyParser.java:511) at org.eclipse.jdt.internal.core.util.BindingKeyResolver.getCompilerBinding(BindingKeyResolver.java:418) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:734) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:460) at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:646) at org.eclipse.jdt.astview.views.ASTView.performResolveBindingKey(ASTView.java:1123) at org.eclipse.jdt.astview.views.ASTView$13.run(ASTView.java:808) at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
Philippe, this bug cause a problem in Infer Type Arguments. Can you have a look at it early in the RC1 fix pass ?
Changed BindingKeyParser to have a new semantic action comsumeKey() called at the end of the parse and changed BindingKeyResolver to create the array binding only in this semantic action. Added regression test BatchASTCreationTest#test062()
D:\usr\OTI\workspaces\tests\M7\junit
Oooops, sorry, forgot previous comment. I wanted to say...Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.