mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 09:55:29 +02:00
Fix equals.
This commit is contained in:
parent
fb1a536450
commit
4d573939d8
1 changed files with 20 additions and 13 deletions
|
@ -65,20 +65,27 @@ public class Location implements ICDILocation {
|
|||
*/
|
||||
public boolean equals(ICDILocation location) {
|
||||
String ofile = location.getFile();
|
||||
if (ofile == null) {
|
||||
ofile = "";
|
||||
if (file.length() > 0 && ofile.length() > 0) {
|
||||
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();
|
||||
if (ofunction == null) {
|
||||
ofunction = "";
|
||||
}
|
||||
|
||||
if (file.equals(ofile) && line == location.getLineNumber()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (file.equals(ofile) && function.equals(ofunction)) {
|
||||
return true;
|
||||
long oaddr = location.getAddress();
|
||||
if (addr != 0 && oaddr != 0) {
|
||||
if (addr == oaddr) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.equals(location);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue