From baa538fda8773271d294cd6a867da8034357190a Mon Sep 17 00:00:00 2001 From: Patrick Ziegler Date: Wed, 14 Jan 2026 22:55:10 +0100 Subject: [PATCH] Remove unnecessary call to Display.syncExec in DesignPage The `internal_refreshGEF_withProgress()` method is guaranteed to be called from the SWT UI thread, as it is only called from the `internal_refreshGEF()` method. This method modifies e.g. the `PageBook` (an SWT composite), which would throw an "Invalid Thread Access" when access from any other thread. --- .../wb/internal/core/editor/DesignPage.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/editor/DesignPage.java b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/editor/DesignPage.java index 3e5a73cbd..1e1b47c1a 100644 --- a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/editor/DesignPage.java +++ b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/editor/DesignPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2025 Google, Inc. and others. + * Copyright (c) 2011, 2026 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -56,7 +56,6 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IPartListener; import org.eclipse.ui.IWorkbenchPart; @@ -452,7 +451,6 @@ boolean internal_refreshGEF() { } private void internal_refreshGEF_withProgress() throws Exception { - final Display display = Display.getCurrent(); IRunnableWithProgress runnable = new IRunnableWithProgress() { @Override @SuppressWarnings("removal") @@ -462,16 +460,7 @@ public void run(final IProgressMonitor monitor) throws InvocationTargetException // try { DesignPageSite.setProgressMonitor(monitor); - display.syncExec(new Runnable() { - @Override - public void run() { - try { - internal_refreshGEF(monitor); - } catch (Throwable e) { - ReflectionUtils.propagate(e); - } - } - }); + internal_refreshGEF(monitor); } catch (Throwable e) { ReflectionUtils.propagate(e); } finally {