diff options
author | Michael Rennie | 2009-09-25 15:13:52 +0000 |
---|---|---|
committer | Michael Rennie | 2009-09-25 15:13:52 +0000 |
commit | 27badabde91d5b964c5b9967fc1332dd1f4ee4ae (patch) | |
tree | 58c56048c9587d12ea93aab86c19214c7c7a9f84 /org.eclipse.debug.ui | |
parent | 353f0a0ba576b2fece21fef95286e1df9790f0d0 (diff) | |
download | eclipse.platform.debug-27badabde91d5b964c5b9967fc1332dd1f4ee4ae.tar.gz eclipse.platform.debug-27badabde91d5b964c5b9967fc1332dd1f4ee4ae.tar.xz eclipse.platform.debug-27badabde91d5b964c5b9967fc1332dd1f4ee4ae.zip |
Bug 223315 - [breakpoints] Inner class defined in a method can produce multiple breakpoints in the same line
Diffstat (limited to 'org.eclipse.debug.ui')
2 files changed, 18 insertions, 6 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportBreakpoints.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportBreakpoints.java index 604a34717..0cd0a82dc 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportBreakpoints.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportBreakpoints.java @@ -43,7 +43,7 @@ public class ImportBreakpoints extends AbstractDebugActionDelegate { WizardDialog wizdialog = new WizardDialog(DebugUIPlugin.getShell(), wiz); wizdialog.setBlockOnOpen(true); wizdialog.open(); - }//end run + } /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(java.lang.Object) @@ -55,5 +55,5 @@ public class ImportBreakpoints extends AbstractDebugActionDelegate { */ protected void update(IAction action, ISelection s) { getAction().setEnabled(true); - }//end update -}//end class + } +} 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 712f8f2b5..b858f583f 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,9 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress { fCurrentWorkingSetProperty = null; localmonitor.worked(1); } - fManager.addBreakpoints((IBreakpoint[])fAdded.toArray(new IBreakpoint[fAdded.size()])); + if(fAdded.size() > 0) { + fManager.addBreakpoints((IBreakpoint[])fAdded.toArray(new IBreakpoint[fAdded.size()])); + } } catch(FileNotFoundException e) { throw new InvocationTargetException(e, @@ -288,9 +290,10 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress { } catch(CoreException ce) {} } + IBreakpoint breakpoint = null; try { // create the breakpoint - IBreakpoint breakpoint = fManager.createBreakpoint(marker); + breakpoint = fManager.createBreakpoint(marker); breakpoint.setEnabled(((Boolean)attributes.get(IImportExportConstants.IE_BP_ENABLED)).booleanValue()); breakpoint.setPersisted(((Boolean)attributes.get(IImportExportConstants.IE_BP_PERSISTANT)).booleanValue()); breakpoint.setRegistered(((Boolean)attributes.get(IImportExportConstants.IE_BP_REGISTERED)).booleanValue()); @@ -305,7 +308,16 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress { } } } - catch(CoreException ce) {} + catch(CoreException ce) { + //Something bad happened while trying to restore the breakpoint, remove it from the cached list and delete the marker + //to ensure the manager does not hold bogus breakpoints + if(breakpoint != null) { + try { + fAdded.remove(breakpoint); + marker.delete(); + } catch (CoreException e) {} + } + } } /** |