1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 17:55:39 +02:00

Fix equals.

This commit is contained in:
Alain Magloire 2003-03-16 21:48:23 +00:00
parent fb1a536450
commit 4d573939d8

View file

@ -65,20 +65,27 @@ public class Location implements ICDILocation {
*/ */
public boolean equals(ICDILocation location) { public boolean equals(ICDILocation location) {
String ofile = location.getFile(); String ofile = location.getFile();
if (ofile == null) { if (file.length() > 0 && ofile.length() > 0) {
ofile = ""; if (file.equals(ofile)) {
int oline = location.getLineNumber();
if (line != 0 && oline != 0) {
if (line == oline) {
return true;
}
}
String ofunction = location.getFunction();
if (function.length() > 0 && ofunction.length() > 0) {
if (function.equals(ofunction)) {
return true;
}
}
}
} }
String ofunction = location.getFunction(); long oaddr = location.getAddress();
if (ofunction == null) { if (addr != 0 && oaddr != 0) {
ofunction = ""; if (addr == oaddr) {
} return true;
}
if (file.equals(ofile) && line == location.getLineNumber()) {
return true;
}
if (file.equals(ofile) && function.equals(ofunction)) {
return true;
} }
return super.equals(location); return super.equals(location);
} }