Skip to content

Commit 87148a4

Browse files
committed
Remove Debug listener & Add Debug Launch check on HCR pop close
Added launch check prior pop-up close and Remove debug event listener when HCR failure dialog is closed after thread termination
1 parent 4da0d59 commit 87148a4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/HotCodeReplaceErrorDialog.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
import org.eclipse.swt.layout.GridData;
3434
import org.eclipse.swt.widgets.Button;
3535
import org.eclipse.swt.widgets.Composite;
36-
import org.eclipse.swt.widgets.Display;
3736
import org.eclipse.swt.widgets.Shell;
37+
import org.eclipse.ui.PlatformUI;
3838

3939
/**
4040
* An error dialog reporting a problem with a debug
@@ -159,9 +159,14 @@ public void run() {
159159
@Override
160160
public void handleDebugEvents(DebugEvent[] events) {
161161
for (DebugEvent event : events) {
162-
if (event.getSource() instanceof JDIThread de) {
163-
if (de.isTerminated()) {
164-
Display.getDefault().asyncExec(() -> this.close());
162+
if (event.getSource() instanceof JDIThread jdiThread) {
163+
if(!jdiThread.isTerminated()) {
164+
continue;
165+
}
166+
if (jdiThread.getDebugTarget().equals(target.getDebugTarget())) {
167+
DebugPlugin.getDefault().removeDebugEventListener(this);
168+
PlatformUI.getWorkbench().getDisplay().asyncExec(this::close);
169+
return;
165170
}
166171
}
167172
}

0 commit comments

Comments
 (0)