From 4d573939d8d19fb2482d0b05b3a2916941ceb083 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Sun, 16 Mar 2003 21:48:23 +0000 Subject: [PATCH] Fix equals. --- .../cdt/debug/mi/core/cdi/Location.java | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Location.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Location.java index d411a71d426..573f5316d80 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Location.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Location.java @@ -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); }