Bug 79967

Summary: NPE in WildcardBinding.signature with Mark Occurrences in Collections.class
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2004-12-02 03:41:53 EST
I20041201-1139

Open type Collections from an 1.5 JDK. Select type name and enable Mark Occurrences.

Error 2004-12-02 09:38:08.547 An internal error occurred during: "Java AST
creation".
java.lang.NullPointerException
at
org.eclipse.jdt.internal.compiler.lookup.WildcardBinding.signature(WildcardBinding.java:220)
at
org.eclipse.jdt.internal.compiler.lookup.MethodBinding.signature(MethodBinding.java:630)
at
org.eclipse.jdt.internal.compiler.lookup.MethodBinding.computeUniqueKey(MethodBinding.java:290)
at
org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding.computeUniqueKey(ParameterizedMethodBinding.java:56)
at org.eclipse.jdt.core.dom.MethodBinding.getKey(MethodBinding.java:286)
at org.eclipse.jdt.internal.corext.dom.Bindings.equals(Bindings.java:60)
at
org.eclipse.jdt.internal.ui.search.OccurrencesFinder.match(OccurrencesFinder.java:224)
at
org.eclipse.jdt.internal.ui.search.OccurrencesFinder.visit(OccurrencesFinder.java:161)
at org.eclipse.jdt.core.dom.SimpleName.accept0(SimpleName.java:147)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497)
at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvocation.java:244)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520)
at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvocation.java:245)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497)
at org.eclipse.jdt.core.dom.PrefixExpression.accept0(PrefixExpression.java:261)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497)
at org.eclipse.jdt.core.dom.IfStatement.accept0(IfStatement.java:188)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497)
at org.eclipse.jdt.core.dom.ForStatement.accept0(ForStatement.java:228)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520)
at org.eclipse.jdt.core.dom.Block.accept0(Block.java:135)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497)
at org.eclipse.jdt.core.dom.ForStatement.accept0(ForStatement.java:228)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497)
at org.eclipse.jdt.core.dom.LabeledStatement.accept0(LabeledStatement.java:166)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520)
at org.eclipse.jdt.core.dom.Block.accept0(Block.java:135)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497)
at org.eclipse.jdt.core.dom.IfStatement.accept0(IfStatement.java:189)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520)
at org.eclipse.jdt.core.dom.Block.accept0(Block.java:135)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497)
at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:504)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520)
at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:486)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520)
at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:291)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
at
org.eclipse.jdt.internal.ui.search.OccurrencesFinder.perform(OccurrencesFinder.java:81)
at
org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.updateOccurrenceAnnotations(JavaEditor.java:2907)
at
org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$6.selectionChanged(JavaEditor.java:2936)
at
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:173)
at
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:142)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
Comment 1 Philipe Mulet CLA 2004-12-02 04:46:16 EST
Only the DOM is asking for WildcardBinding.signature().
It is indeed doomed in the case of unbound wildcard.
Comment 2 Philipe Mulet CLA 2004-12-02 05:22:45 EST
Made WildcardBinding#signature() answer the genericTypeSignature instead, but
this is likely an issue in DOM key computation which shouldn't perform on the
parameterized (generic) method, and rather use the original method (and record
type arguments separately).
Comment 3 Philipe Mulet CLA 2004-12-02 05:25:38 EST
Actually, made the signature for wildcards not answer any generic information
(bound or matching variable signature).
Comment 4 Jerome Lanneluc CLA 2004-12-02 05:59:49 EST
Fixed MethodBinding#computeUniqueKey() to use the original method for the signature.

Need a regression test.
Comment 5 Jerome Lanneluc CLA 2004-12-02 06:23:29 EST
Added regression test ASTConverter15Test#test0089()
Comment 6 Frederic Fusier CLA 2004-12-15 07:04:38 EST
Verified for 3.1 M4 using build I200412142000.