--- a/cdt/cdt_6_0_x/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsJob.java Wed Nov 04 15:14:56 2009 -0600
+++ b/cdt/cdt_6_0_x/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsJob.java Tue Dec 15 14:30:07 2009 -0600
@@ -377,12 +377,17 @@
}
private boolean isSameName(IName n1, IName n2) {
+ if (n1 == n2)
+ return true;
+
IASTFileLocation loc1 = n1.getFileLocation();
IASTFileLocation loc2 = n2.getFileLocation();
- return loc1.getFileName().equals(loc2.getFileName()) &&
- loc1.getNodeOffset() == loc2.getNodeOffset() &&
- loc1.getNodeLength() == loc2.getNodeLength();
- }
+ if (loc1 == null || loc2 == null) {
+ return false;
+ }
+ return loc1.getFileName().equals(loc2.getFileName())
+ && loc1.getNodeOffset() == loc2.getNodeOffset()
+ && loc1.getNodeLength() == loc2.getNodeLength();}
private static boolean isInSameFunction(IASTName name1, IName name2) {
IASTDeclaration decl1 = getEnclosingDeclaration(name1);