From 5e1125c66369681f9714f20e17c78dd8656feaf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Tue, 7 May 2024 19:52:38 +0200 Subject: [PATCH] Always run asnyc if the workspace tree is locked Setting a classpath container to a project while the workspace tree is locked has the effect that the container is updated but the project is not build at all. This overrides the hint to run async in such case to make sure the project is build appropriately. --- .../src/org/eclipse/pde/internal/core/PluginModelManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginModelManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginModelManager.java index 4511a39cd26..f983fa0e647 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginModelManager.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginModelManager.java @@ -37,6 +37,7 @@ import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.Adapters; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.ILog; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; @@ -384,7 +385,7 @@ private void updateAffectedEntries(StateDelta delta, boolean runAsynch) { index++; } // TODO Consider always running in a job - better reporting and cancellation options - if (runAsynch) { + if (runAsynch || ResourcesPlugin.getWorkspace().isTreeLocked()) { // We may be in the UI thread, so the classpath is updated in a job to avoid blocking (bug 376135) fUpdateJob.add(projects, containers); fUpdateJob.schedule(); @@ -393,6 +394,7 @@ private void updateAffectedEntries(StateDelta delta, boolean runAsynch) { try { JavaCore.setClasspathContainer(PDECore.REQUIRED_PLUGINS_CONTAINER_PATH, projects, containers, null); } catch (JavaModelException e) { + ILog.get().error("Setting classpath containers failed!", e); //$NON-NLS-1$ } } }