Bug 116311 - [search] NPE searching for reference to our Assert class
Summary: [search] NPE searching for reference to our Assert class
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1.2   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-14 14:34 EST by Olivier Thomann CLA
Modified: 2006-01-10 10:19 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2005-11-14 14:34:10 EST
Searching for references in my workspace to org.eclipse.jdt.internal.core.Assert
leads to this error:

java.lang.NullPointerException
at
org.eclipse.jdt.internal.compiler.lookup.MethodBinding.signature(MethodBinding.java:670)
at
org.eclipse.jdt.internal.compiler.lookup.MethodBinding.computeUniqueKey(MethodBinding.java:323)
at
org.eclipse.jdt.internal.compiler.lookup.MethodBinding.computeUniqueKey(MethodBinding.java:311)
at
org.eclipse.jdt.internal.compiler.lookup.Binding.computeUniqueKey(Binding.java:45)
at org.eclipse.jdt.internal.core.BinaryMethod.resolved(BinaryMethod.java:328)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.newTypeReferenceMatch(MatchLocator.java:1378)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.newTypeReferenceMatch(MatchLocator.java:1387)
at
org.eclipse.jdt.internal.core.search.matching.TypeReferenceLocator.matchReportReference(TypeReferenceLocator.java:278)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:1870)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:2223)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:2023)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(MatchLocator.java:1474)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:958)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:999)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1102)
at
org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:94)
at
org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:208)
at
org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:464)
at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:532)
at org.eclipse.jdt.internal.ui.search.JavaSearchQuery.run(JavaSearchQuery.java:134)
at
org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:94)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Comment 1 Frederic Fusier CLA 2005-11-15 03:15:58 EST
It works well for me (ie. no NPE) in a 3.2 M3 full source workspace...
Has your workspace something special?
Comment 2 Olivier Thomann CLA 2005-11-15 09:01:13 EST
I don't think so.
This is a workspace I have for a while. Maybe something got corrupted.
The problem occurs with a binary method. I can reproduce it without a problem.
I will track it down here.
It is a case where a targetParameters element is null.
Comment 3 Frederic Fusier CLA 2005-11-15 12:49:53 EST
Sounds like a problem in MatchLocator. We try to resolve although there was an
AbortCompilation exception...
Comment 4 Frederic Fusier CLA 2005-11-17 06:11:42 EST
Fixed and released in HEAD.

Unfortunately there's no test case we can write to test it...
So, it needs to be verified by hand.
Comment 5 Olivier Thomann CLA 2005-11-17 08:36:59 EST
I'll verify it once the next integration build is done.
Comment 6 Olivier Thomann CLA 2005-11-17 09:47:08 EST
Verified with HEAD.
I didn't get the NPE.
Comment 7 Frederic Fusier CLA 2005-11-17 09:49:44 EST
Thanks :-)
Comment 8 Frederic Fusier CLA 2005-11-17 13:55:17 EST
Sounds a good candidate for 3.1.2
Comment 9 Philipe Mulet CLA 2005-11-18 02:55:49 EST
What does the fix look like?
Comment 10 Frederic Fusier CLA 2005-11-18 03:57:45 EST
Really simple...

In MatchLocator.process(PossibleMatch,boolean) method, modify following line in
catch(AbortCompilation e) block:
		reportMatching(unit, true); // was partially resolved
with
		reportMatching(unit, false); // do not resolve when cu has errors
Comment 11 Frederic Fusier CLA 2005-11-23 12:49:38 EST
Released in R3_1_maintenance stream.
Comment 12 Frederic Fusier CLA 2006-01-09 06:52:05 EST
Reopen for 3.1.2 verification
Comment 13 Frederic Fusier CLA 2006-01-09 06:53:18 EST
We need to verify that this bug is fixed using R3_1_maintenance build before 3.1.2 delivery...
Comment 14 Maxime Daniel CLA 2006-01-10 06:40:47 EST
Checked that the new code is included into build M20060109-1200.
May consider as verified for 3.1.2, on the source code basis.
If Olivier still has the workspace on which the bug was detected at hand, we could also try M20060109-1200 on it.
Comment 15 Maxime Daniel CLA 2006-01-10 10:19:43 EST
Verified for 3.2 M4 using build I20051215-1506.
(On the basis of source code.)