Community
Participate
Working Groups
3.1 m6 java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition java.runtime.version=1.5.0-b64 I started getting the following NPE every time I searched for references to a specific method. Don't know how to reproduce. I had just deleted that method, saved, undone my changes (restoring the method), saved again, and looked for references to that method. !ENTRY org.eclipse.core.runtime 4 2 2005-04-04 19:05:15.768 !MESSAGE An internal error occurred during: "Java Search". !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.core.search.matching.MethodLocator.matchReportReference(MethodLocator.java:217) 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:1384) 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:1070) 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)
Note that looking for the references in the same project, the NPE does not occur. Looking for references in the workspace (the method is private static), causes the NPE.
I soon started having problems searching for references to other methods (not sure was looking in the same project or the entire workspace), so I had to restart Eclipse. I haven't seen the problem since then.
Raphael, Looking at code + the fact that you cannot reproduce it sounds more as a VM issue rather than a code issue. Line 217 is: if (isPrivate && !CharOperation.equals(method.declaringClass.sourceName, focus.getParent().getElementName().toCharArray())) { I've verified that: 1) method cannot be null and same for its declaringClass 2) focus cannot be null + Java Model insure that all elements have parent and name (otherwise all JDT/Core would dump multiple NPEs...). As you cannot reproduce, I will put this bug in REMIND and let you reopen it as soon as you see this issue again with hopefully a detailed test case to reproduce it. TIA
Reopen as I got one reproduceable example in duplicate bug.
*** This bug has been marked as a duplicate of 92315 ***
*** Bug 95466 has been marked as a duplicate of this bug. ***