From 14800b53426eb62cd77d1e4e179b63bf5b651db2 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Thu, 21 Sep 2023 10:26:02 -0400 Subject: [PATCH] Avoid UI access in async viewers which operate on non UI threads #710 The AsynchronousViewer class hierarchy reuses the Viewer interface but adds additional constraints on it, in particular it allows many of its methods to be called from non-UI threads. See javadoc summary: https://github.com/eclipse-platform/eclipse.platform/blob/e92b72761b8543358ba9811ea49807f75e98bad5/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java#L57-L72 Commit 3b9c02c4e1f8364bfb05f66fc5d046ab4d2ff8a2 added UI access to method that used to not have any, therefore this patch restores that non-UI implementation locally consistent with other methods in the async viewer that operate on the model. Fixes https://github.com/eclipse-platform/eclipse.platform/issues/710 --- .../debug/internal/ui/viewers/AsynchronousViewer.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java index b287456c9e5..a15ff5012a8 100644 --- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java +++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java @@ -414,6 +414,11 @@ protected Widget doFindInputItem(Object element) { protected void doUpdateItem(Widget item, Object element, boolean fullMap) { } + @Override + public void refresh() { + refresh(getRoot()); + } + @Override protected void internalRefresh(Object element) { // get the nodes in the model