Bug 22946 - search: NPE
Summary: search: NPE
Status: RESOLVED DUPLICATE of bug 21485
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-28 09:50 EDT by Adam Kiezun CLA
Modified: 2002-08-29 06:53 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 2002-08-28 09:50:47 EDT
1. have this cu (A.java)
package p;
import p.A;
class A {
	public void m() {}
	public void m1() {}
}
2. search for refs to A
3. 
java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.canBeSeenBy
(ReferenceBinding.java:177)
at org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage
(Scope.java:955)
at org.eclipse.jdt.internal.core.search.matching.MatchSet.reportMatching
(MatchSet.java:222)
at 
org.eclipse.jdt.internal.core.search.matching.MatchingOpenable.locateMatchesInCo
mpilationUnit(MatchingOpenable.java:331)
at org.eclipse.jdt.internal.core.search.matching.MatchingOpenable.locateMatches
(MatchingOpenable.java:174)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches
(MatchLocator.java:1323)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches
(MatchLocator.java:586)
at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:411)
at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:357)
at org.eclipse.jdt.internal.ui.search.JavaSearchOperation.execute
(JavaSearchOperation.java:84)
at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run
(WorkspaceModifyOperation.java:64)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1361)
at org.eclipse.ui.actions.WorkspaceModifyOperation.run
(WorkspaceModifyOperation.java:78)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:98)
Comment 1 Erich Gamma CLA 2002-08-28 12:28:34 EDT
The NPE is caused by the "self-import" import p.A.
Removing the self import avoids the problem.

Such kinds of self-imports are rare.
Comment 2 Adam Kiezun CLA 2002-08-28 12:30:42 EDT
you get the same NPE if p.A is imported in another cu in p
and that's more common
Comment 3 Jerome Lanneluc CLA 2002-08-29 05:44:20 EDT

*** This bug has been marked as a duplicate of 21485 ***