From e2d880aec2a00b54730bfe14a1c5cf4cfdceb25b Mon Sep 17 00:00:00 2001 From: Andrey Loskutov Date: Sun, 18 Jan 2026 15:15:08 +0100 Subject: [PATCH 1/2] Console does not need to start UI job every second In order to update console status line, ProcessConsole.computeName() calls resetName() every second once console is created. This causes new UI job to be started every second via timerExec(), with code already being executed on UI thread. It is a misuse of Jobs framework, it makes use of jobs dispatching where no jobs are needed. The code can use Display.execute() for a more lightweight console status update. As a nice side effect no jobs are flashing in the Progress view every second (if system jobs are shown). --- .../ui/views/console/ProcessConsole.java | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java index 3bbabefe1c7..2f619da4c9d 100644 --- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java +++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java @@ -106,7 +106,6 @@ import org.eclipse.ui.editors.text.EditorsUI; import org.eclipse.ui.part.FileEditorInput; import org.eclipse.ui.part.IPageBookViewPage; -import org.eclipse.ui.progress.UIJob; /** * A console for a system process with standard I/O streams. @@ -115,7 +114,7 @@ */ @SuppressWarnings("deprecation") public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSetListener, IPropertyChangeListener { - private IProcess fProcess = null; + private IProcess fProcess; private final List fStreamListeners = new ArrayList<>(); @@ -136,9 +135,9 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe private FileOutputStream fFileOutputStream; private boolean fAllocateConsole = true; - private String fStdInFile = null; + private String fStdInFile; - private volatile boolean fStreamsClosed = false; + private volatile boolean fStreamsClosed; /** * Create process console with default encoding. @@ -649,18 +648,12 @@ private synchronized void resetName(boolean changed) { final String newName = computeName(); String name = getName(); if (!name.equals(newName)) { - UIJob job = new UIJob("Update console title") { //$NON-NLS-1$ - @Override - public IStatus runInUIThread(IProgressMonitor monitor) { - ProcessConsole.this.setName(newName); - if (changed) { - warnOfContentChange(); - } - return Status.OK_STATUS; + DebugUIPlugin.getStandardDisplay().execute(() -> { + setName(newName); + if (changed) { + warnOfContentChange(); } - }; - job.setSystem(true); - job.schedule(); + }); } } From 0f46b6a401060874d2ea54954beaa51d81f1777f Mon Sep 17 00:00:00 2001 From: Andrey Loskutov Date: Sun, 18 Jan 2026 16:10:37 +0100 Subject: [PATCH 2/2] Fix compilation warnings after super class signature change Compiler warnings: 1) Varargs methods should only override or be overridden by other varargs methods unlike StringVariableSelectionDialog.setListElements(Object[]) and AbstractElementListSelectionDialog.setListElements(Object...) 2) Type IStringVariable[] of the last argument to method setListElements(Object...) doesn't exactly match the vararg parameter type. Cast to Object[] to confirm the non-varargs invocation, or pass individual arguments of type Object for a varargs invocation. Side effect of the signature change in org.eclipse.ui.dialogs.AbstractElementListSelectionDialog.setListElements(Object...) See https://github.com/eclipse-platform/eclipse.platform.ui/commit/647256df2f719b25f25a7565d08fb01834b52ed6 / https://github.com/eclipse-platform/eclipse.platform.ui/pull/3675 --- .../org/eclipse/debug/ui/StringVariableSelectionDialog.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java index 8cbcdb8cda4..9e86df1f4fc 100644 --- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java +++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java @@ -165,7 +165,7 @@ private void updateElements() { final Display display = DebugUIPlugin.getStandardDisplay(); BusyIndicator.showWhile(display, () -> { final IStringVariable[] elements = VariablesPlugin.getDefault().getStringVariableManager().getVariables(); - display.asyncExec(() -> setListElements(elements)); + display.asyncExec(() -> setListElements((Object[]) elements)); }); } @@ -180,7 +180,7 @@ private void updateDescription() { } @Override - protected void setListElements(Object[] elements) { + protected void setListElements(Object... elements) { ArrayList filtered = new ArrayList<>(); filtered.addAll(Arrays.asList(elements)); if(!fFilters.isEmpty() && !fShowAllSelected) { @@ -303,7 +303,7 @@ protected void editVariables() { if (showVariablesPage()) { final IStringVariable[] elements = VariablesPlugin.getDefault().getStringVariableManager() .getVariables(); - display.asyncExec(() -> setListElements(elements)); + display.asyncExec(() -> setListElements((Object[]) elements)); } }); }