Bug 94206 - CCE in BindingKeyResolver when restoring array type of method type parameter
Summary: CCE in BindingKeyResolver when restoring array type of method type parameter
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-09 18:13 EDT by Markus Keller CLA
Modified: 2005-05-12 11:30 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2005-05-09 18:13:42 EDT
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)
Comment 1 Dirk Baeumer CLA 2005-05-11 04:20:38 EDT
Philippe, this bug cause a problem in Infer Type Arguments. Can you have a look
at it early in the RC1 fix pass ?
Comment 2 Jerome Lanneluc CLA 2005-05-11 09:53:28 EDT
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()
Comment 3 Frederic Fusier CLA 2005-05-12 11:25:35 EDT
D:\usr\OTI\workspaces\tests\M7\junit
Comment 4 Frederic Fusier CLA 2005-05-12 11:30:58 EDT
Oooops, sorry, forgot previous comment.
I wanted to say...Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.