diff options
author | Michael Rennie | 2007-12-07 17:08:49 +0000 |
---|---|---|
committer | Michael Rennie | 2007-12-07 17:08:49 +0000 |
commit | 398be45f4dcf9008254de6c6a5a8475a482c60c8 (patch) | |
tree | bdbb05ee36dbf985cabb6b993d86da246d732cd0 /org.eclipse.debug.ui | |
parent | a51f8d3304663d5cdd3ffd8446be5c5b958ec347 (diff) | |
download | eclipse.platform.debug-398be45f4dcf9008254de6c6a5a8475a482c60c8.tar.gz eclipse.platform.debug-398be45f4dcf9008254de6c6a5a8475a482c60c8.tar.xz eclipse.platform.debug-398be45f4dcf9008254de6c6a5a8475a482c60c8.zip |
Bug 208127 breakpoint import does not work
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java index 6aeb6d21f..5a67c47e0 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java @@ -159,7 +159,7 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress { // get the attribute and try to convert it to either Integer, Boolean or leave it alone (String) String name = childnodes[j].getString(IImportExportConstants.IE_NODE_NAME), value = childnodes[j].getString(IImportExportConstants.IE_NODE_VALUE); - if (value != null & name != null) { + if (value != null && name != null) { if (name.equals(IInternalDebugUIConstants.WORKING_SET_NAME)) { workingsets = value; } @@ -244,18 +244,12 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress { Object localline = markers[i].getAttribute(IMarker.LINE_NUMBER); String localtype = markers[i].getType(); if (type.equals(localtype)) { - if (localline != null & line != null) { - if (line.equals(localline.toString())) { - Integer markerCharstart = (Integer) markers[i].getAttribute(IImportExportConstants.CHARSTART); - if (charstart == null) { - if (markerCharstart == null) { - return markers[i]; - } - } else if (charstart.equals(markerCharstart)) { - return markers[i]; - } - } - } else { + if(objectsEqual(line, localline) && objectsEqual(charstart, markers[i].getAttribute(IImportExportConstants.CHARSTART))) { + //if the line numbers are equal the charstarts also must be + return markers[i]; + } + else if(objectsEqual(charstart, markers[i].getAttribute(IImportExportConstants.CHARSTART))) { + //not all breakpoints have a line number, so we can compare those that do not return markers[i]; } } @@ -263,4 +257,11 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress { } return null; } + + private boolean objectsEqual(Object o1, Object o2) { + if(o1 == null && o2 == null) { + return true; + } + return o1 != null && o1.equals(o2); + } } |