Community
Participate
Working Groups
build 0425 I searched for references of a local variable within it's hierarchy package test; public class HierarchySearchTest { public HierarchySearchTest() { super(); } private void test() { String local=""; local="x"; } } Select 2nd local and search hierarchy for references !MESSAGE Internal Error !STACK java.lang.reflect.InvocationTargetException: java.lang.NullPointerException at org.eclipse.jdt.internal.core.search.HierarchyScope.encloses (HierarchyScope.java:159) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.report (MatchLocator.java:714) at org.eclipse.jdt.internal.core.search.matching.SearchPattern.matchReportReference (SearchPattern.java:1335) at org.eclipse.jdt.internal.core.search.matching.TypeReferencePattern.matchReportRe ference(TypeReferencePattern.java:193) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportReference (MatchLocator.java:1056) at org.eclipse.jdt.internal.core.search.matching.MatchSet.reportMatching (MatchSet.java:261) at org.eclipse.jdt.internal.core.search.matching.MatchSet.reportMatching (MatchSet.java:319) at org.eclipse.jdt.internal.core.search.matching.MatchSet.reportMatching (MatchSet.java:246) at org.eclipse.jdt.internal.core.search.matching.MatchingOpenable.locateMatchesInCo mpilationUnit(MatchingOpenable.java:312) at org.eclipse.jdt.internal.core.search.matching.MatchingOpenable.locateMatches (MatchingOpenable.java:155) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches (MatchLocator.java:1322) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches (MatchLocator.java:591) at org.eclipse.jdt.core.search.SearchEngine.search (SearchEngine.java:407) at org.eclipse.jdt.core.search.SearchEngine.search (SearchEngine.java:353) at org.eclipse.jdt.internal.ui.search.JavaSearchOperation.execute (JavaSearchOperation.java:82) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run (WorkspaceModifyOperation.java:64) at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1342) at org.eclipse.ui.actions.WorkspaceModifyOperation.run (WorkspaceModifyOperation.java:78) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run (ModalContext.java:98)
When trying to handle the working copy case, HierarchyScope was wrongly assuming that the type was in a compilation unit. Fixed by protecting this case with a isBinary() check.