### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.debug.ui Index: ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddExceptionAction.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddExceptionAction.java,v retrieving revision 1.16 diff -u -r1.16 AddExceptionAction.java --- ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddExceptionAction.java 17 Jul 2007 17:14:14 -0000 1.16 +++ ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddExceptionAction.java 10 Dec 2009 20:30:22 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2009 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -122,9 +122,10 @@ BreakpointUtils.addJavaBreakpointAttributes(map, type); IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints( JDIDebugModel.getPluginIdentifier()); + IJavaBreakpoint breakpoint = null; boolean exists = false; for (int j = 0; j < breakpoints.length; j++) { - IJavaBreakpoint breakpoint = (IJavaBreakpoint) breakpoints[j]; + breakpoint = (IJavaBreakpoint) breakpoints[j]; if (breakpoint instanceof IJavaExceptionBreakpoint) { if (breakpoint.getTypeName().equals(type.getFullyQualifiedName())) { exists = true; @@ -132,6 +133,7 @@ } } } + // If the breakpoint does not exist, add it. If it does exist, make sure it is enabled. if (!exists) { new Job(BreakpointMessages.AddExceptionAction_0) { protected IStatus run(IProgressMonitor monitor) { @@ -146,6 +148,18 @@ } }.schedule(); + } else { + final IJavaBreakpoint existingBreakpoint = breakpoint; + new Job(BreakpointMessages.AddExceptionAction_EnableExceptionBreakpoint) { + protected IStatus run(IProgressMonitor monitor) { + try { + existingBreakpoint.setEnabled(true); + return Status.OK_STATUS; + } catch (final CoreException e) { + return e.getStatus(); + } + } + }.schedule(); } } Index: ui/org/eclipse/jdt/internal/debug/ui/breakpoints/BreakpointMessages.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/BreakpointMessages.java,v retrieving revision 1.17 diff -u -r1.17 BreakpointMessages.java --- ui/org/eclipse/jdt/internal/debug/ui/breakpoints/BreakpointMessages.java 31 Mar 2009 20:43:07 -0000 1.17 +++ ui/org/eclipse/jdt/internal/debug/ui/breakpoints/BreakpointMessages.java 10 Dec 2009 20:30:22 -0000 @@ -17,6 +17,8 @@ public static String AddExceptionAction_0; public static String AddExceptionAction_1; + + public static String AddExceptionAction_EnableExceptionBreakpoint; public static String AddExceptionDialog_13; public static String AddExceptionDialog_15; public static String AddExceptionDialog_16; Index: ui/org/eclipse/jdt/internal/debug/ui/breakpoints/BreakpointMessages.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/BreakpointMessages.properties,v retrieving revision 1.21 diff -u -r1.21 BreakpointMessages.properties --- ui/org/eclipse/jdt/internal/debug/ui/breakpoints/BreakpointMessages.properties 31 Mar 2009 20:43:07 -0000 1.21 +++ ui/org/eclipse/jdt/internal/debug/ui/breakpoints/BreakpointMessages.properties 10 Dec 2009 20:30:22 -0000 @@ -11,6 +11,7 @@ AddExceptionAction_0=Add Java Exception Breakpoint AddExceptionAction_1=Choose an e&xception (? = any character, * = any string) +AddExceptionAction_EnableExceptionBreakpoint=Enable Java Exception Breakpoint AddExceptionDialog_15=Suspend on &caught exceptions AddExceptionDialog_16=Suspend on &uncaught exceptions