Bug 90915 - [1.5][search] NPE in PatternLocator
Summary: [1.5][search] NPE in PatternLocator
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-09 21:59 EDT by Adam Kiezun CLA
Modified: 2005-05-12 09:32 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2005-04-09 21:59:32 EDT
3.1M6
got this while searching for refs in project
java.lang.NullPointerException
at
org.eclipse.jdt.internal.core.search.matching.PatternLocator.updateMatch(PatternLocator.java:351)
at
org.eclipse.jdt.internal.core.search.matching.MethodLocator.matchReportReference(MethodLocator.java:265)
at
org.eclipse.jdt.internal.core.search.matching.MethodLocator.matchReportReference(MethodLocator.java:221)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:1775)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:2039)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:1842)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(MatchLocator.java:1378)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:929)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:968)
at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1085)
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:394)
at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:532)
at org.eclipse.jdt.internal.ui.search.JavaSearchQuery.run(JavaSearchQuery.java:131)
at
org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:93)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:67)
Comment 1 Frederic Fusier CLA 2005-04-10 07:00:34 EDT
Can you provide a more detailed test case to helpme to reproduce (what kind of
refs were you searching, using search dialog or direclty from popup-menus, etc...)?
Thanks
Comment 2 Adam Kiezun CLA 2005-04-10 10:33:13 EDT
don't remember exactly but i think i selected a declaration of a method in an
anonymous class and (i'm sure of that one) did : search for references in
project (from menu)
Comment 3 Frederic Fusier CLA 2005-04-10 10:49:05 EDT
I guess you were editing 1.5 code, right?
Would be possible that you put it in this bug?
Comment 4 Frederic Fusier CLA 2005-04-10 10:57:45 EDT
I got it with following simple test case:
import java.util.*;
public class X<T> {
	void foo() {
		List<String> list = new ArrayList<String>() {
			public boolean add ( String o) {
				return false;
			}
		};
		list.add("");
	}
}
Select add method declaration and search for reference in project...
Thanks for the info
Comment 5 Adam Kiezun CLA 2005-04-10 11:00:40 EDT
yup, i just got a 'mid-air collision' when i about to submit a test case
virtually identical to yours.
Comment 6 Frederic Fusier CLA 2005-04-10 17:20:22 EDT
Fixed and release in HEAD.

[jdt-core-internal]
Test case added in JavaSearchBugsTests.
Comment 7 Maxime Daniel CLA 2005-05-12 09:18:33 EDT
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.