# HG changeset patch # User timkelly # Date 1260909007 21600 # Node ID d00b6e7a8c94e13a8030b8bd1867f8ad22ca1444 # Parent 177481f2140d2f80838f3da67453b94195863c2c fix bug 10386 (mrege from CDT 6.0.1 HEAD) diff -r 177481f2140d -r d00b6e7a8c94 cdt/cdt_6_0_x/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsJob.java --- 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);