Skip to content

Commit 9df210d

Browse files
authored
Remove stale breakpoint on toggling method breakpoints (#837)
This commit fixes unwanted creation of method breakpoints if a stale breakpoint is present at the method entry or exit and removes the stale breakpoint fixes : #836
1 parent 2e3d5c8 commit 9df210d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2025 IBM Corporation and others.
2+
* Copyright (c) 2000, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -1676,7 +1676,11 @@ private void toggleFieldOrMethodBreakpoints(IWorkbenchPart part, ISelection sele
16761676
if (loc.getLocationType() == ValidBreakpointLocationLocator.LOCATION_LAMBDA_METHOD) {
16771677
toggleLambdaMethodBreakpoints(part, ts, loc);
16781678
} else if (loc.getLocationType() == ValidBreakpointLocationLocator.LOCATION_METHOD) {
1679-
toggleMethodBreakpoints(part, ts);
1679+
if (breakpoint != null) { // Issue : https://github.com/eclipse-jdt/eclipse.jdt.debug/issues/836
1680+
deleteBreakpoint(breakpoint, part, null);
1681+
} else {
1682+
toggleMethodBreakpoints(part, ts);
1683+
}
16801684
} else if (loc.getLocationType() == ValidBreakpointLocationLocator.LOCATION_FIELD) {
16811685
if (BreakpointToggleUtils.isToggleTracepoint()) {
16821686
BreakpointToggleUtils.report(ActionMessages.TracepointToggleAction_Unavailable, part);

0 commit comments

Comments
 (0)