From 78ad4cc529cf979adead51a00572987720e6500d Mon Sep 17 00:00:00 2001 From: sougandhs Date: Tue, 13 Jan 2026 12:11:56 +0530 Subject: [PATCH] Remove stale breakpoint on toggling method breakpoints This commit fixes creation of method breakpoints if a stale breakpoint is present at the method entry or exit and remove the stale breakpoint fixes : https://github.com/eclipse-jdt/eclipse.jdt.debug/issues/836 --- .../debug/ui/actions/ToggleBreakpointAdapter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java index b6aa7b97c7..17638277ac 100644 --- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java +++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2025 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -1676,7 +1676,11 @@ private void toggleFieldOrMethodBreakpoints(IWorkbenchPart part, ISelection sele if (loc.getLocationType() == ValidBreakpointLocationLocator.LOCATION_LAMBDA_METHOD) { toggleLambdaMethodBreakpoints(part, ts, loc); } else if (loc.getLocationType() == ValidBreakpointLocationLocator.LOCATION_METHOD) { - toggleMethodBreakpoints(part, ts); + if (breakpoint != null) { // Issue : https://github.com/eclipse-jdt/eclipse.jdt.debug/issues/836 + deleteBreakpoint(breakpoint, part, null); + } else { + toggleMethodBreakpoints(part, ts); + } } else if (loc.getLocationType() == ValidBreakpointLocationLocator.LOCATION_FIELD) { if (BreakpointToggleUtils.isToggleTracepoint()) { BreakpointToggleUtils.report(ActionMessages.TracepointToggleAction_Unavailable, part);