Bug 252588

Summary: NPE resolving types
Product: [Eclipse Project] JDT Reporter: John Arthorne <john.arthorne>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, Olivier_Thomann
Version: 3.5Keywords: needinfo
Target Milestone: 3.6 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
org.eclipse.core.tools bundle none

Description John Arthorne CLA 2008-10-29 10:06:42 EDT
The org.eclipse.core.tools plugin has a tool for finding unreferenced methods. This has been working fine for a few years, but lately it has been sometimes throwing this NPE.  I realize I'm calling internal code here, but thought I should report this anyway in case there is a real problem:

java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(SourceTypeBinding.java:1292)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.methods(SourceTypeBinding.java:1087)
at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.availableMethods(ReferenceBinding.java:174)
at org.eclipse.jdt.core.dom.TypeBinding.getDeclaredMethods(TypeBinding.java:231)
at org.eclipse.jdt.internal.corext.dom.Bindings.findOverriddenMethodInType(Bindings.java:439)
at org.eclipse.jdt.internal.corext.dom.Bindings.findOverriddenMethodInHierarchy(Bindings.java:456)
at org.eclipse.jdt.internal.corext.dom.Bindings.findOverriddenMethodInHierarchy(Bindings.java:467)
at org.eclipse.jdt.internal.corext.dom.Bindings.findOverriddenMethodInHierarchy(Bindings.java:467)
at org.eclipse.jdt.internal.corext.dom.Bindings.findOverriddenMethod(Bindings.java:490)
at org.eclipse.core.tools.search.FindUnusedMembers.methodOverrides(FindUnusedMembers.java:124)
at org.eclipse.core.tools.search.FindUnusedMembers.doSearchType(FindUnusedMembers.java:139)
at org.eclipse.core.tools.search.FindUnusedMembers.doSearchCU(FindUnusedMembers.java:116)
at org.eclipse.core.tools.search.FindUnusedMembers.process(FindUnusedMembers.java:207)
at org.eclipse.core.tools.search.FindUnusedSearchQuery.run(FindUnusedSearchQuery.java:68)
at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:93)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Jerome Lanneluc CLA 2008-11-17 07:32:03 EST
Any steps to reproduce?
Comment 2 John Arthorne CLA 2008-11-17 20:56:20 EST
Created attachment 118112 [details]
org.eclipse.core.tools bundle

I changed the org.eclipse.core.tools code in HEAD to use different API so the problem no longer occurs. Here is the old version of org.eclipse.core.tools which exhibits the problem.
Comment 3 John Arthorne CLA 2008-11-17 20:57:21 EST
(steps are to install this bundle in a recent build, and select "Find Unused Members" from the context menu on some compilation unit.
Comment 4 Jerome Lanneluc CLA 2008-11-18 06:39:14 EST
(In reply to comment #3)
> (steps are to install this bundle in a recent build, and select "Find Unused
> Members" from the context menu on some compilation unit.
> 
Unfortunately this doesn't throw a NPE for me.
Comment 5 Olivier Thomann CLA 2009-12-09 10:25:07 EST
Closing as WORKSFORME.
Please reopen if you can provide steps to reproduce.
Comment 6 Jay Arthanareeswaran CLA 2009-12-10 00:59:39 EST
Verified for 3.6M4
Comment 7 Olivier Thomann CLA 2009-12-10 09:06:33 EST
Verified.