Bug 138435 - [search] Stack trace while searching
Summary: [search] Stack trace while searching
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-25 13:12 EDT by Matthew Conway CLA
Modified: 2007-07-29 09:19 EDT (History)
2 users (show)

See Also:


Attachments
Proposed patch (1.07 KB, patch)
2006-04-26 11:19 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Conway CLA 2006-04-25 13:12:41 EDT
Did a find references in workspace (Cmd-shift-G) on a toString() method for one of my classes.
eclipse 3.2RC1 on osx 10.4.6, java 1.4.2_09


java.lang.NullPointerException
at org.eclipse.jdt.internal.core.util.Util.indexOfJavaLikeExtension(Util.java:1183)
at org.eclipse.jdt.internal.core.search.matching.PossibleMatch.getQualifiedName(PossibleMatch.java:110)
at org.eclipse.jdt.internal.core.search.matching.PossibleMatch.<init>(PossibleMatch.java:41)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1189)
at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:94)
at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:212)
at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:501)
at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:538)
at org.eclipse.jdt.internal.ui.search.JavaSearchQuery.run(JavaSearchQuery.java:143)
at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:93)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Comment 1 Olivier Thomann CLA 2006-04-25 13:17:17 EDT
This could be possible if there is a member type without enclosing type.
In this case, the source file name can be null.
Comment 2 Frederic Fusier CLA 2006-04-25 14:06:48 EDT
Sounds like a duplicate of bug 130241 but while searching for a method...

Comment 3 Frederic Fusier CLA 2006-04-26 04:52:42 EDT
I cannot reproduce this exception even using a member type without enclosing type.
Is there any chance that you can provide a simple test case to help me to reproduce?
Thanks
Comment 4 Olivier Thomann CLA 2006-04-26 10:46:13 EDT
Even if there is no reproducable test case for now, there is a path in the code that could lead to a NPE.
I think this should be protected.
Comment 5 Frederic Fusier CLA 2006-04-26 11:19:16 EDT
Created attachment 39539 [details]
Proposed patch

I agree this should be fixed
Comment 6 Frederic Fusier CLA 2006-04-26 11:19:48 EDT
Philippe, may you accept this bug for RC2?
Comment 7 Philipe Mulet CLA 2006-04-26 12:14:30 EDT
+1 for 3.2RC2
Comment 8 Frederic Fusier CLA 2006-04-26 12:25:52 EDT
Patch released in HEAD.
Note that no test case was added.
Comment 9 Olivier Thomann CLA 2006-04-28 14:09:05 EDT
Verified with I20060427-1600 for 3.2RC2 (checking the source code)
Comment 10 Eclipse Webmaster CLA 2007-07-29 09:19:37 EDT
Changing OS from Mac OS to Mac OS X as per bug 185991