From adb785f442bb3af69dbc2e5c781b989a533ff58a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Sat, 26 Jul 2025 19:39:40 +0200 Subject: [PATCH] Let UpdateBuildpathWizard request ClasspathUpdate Currently the UpdateBuildPathWizard updates some classpath settings but this does not mean the classpath is recomputed as values are cached. To makes sure everything is up-to-date the UpdateClasspathJob of the wizard now also request an classpath Update for all processed projects. --- .../ui/wizards/tools/UpdateClasspathJob.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateClasspathJob.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateClasspathJob.java index 4fc2ed642e1..2f5ebcf7906 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateClasspathJob.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateClasspathJob.java @@ -14,6 +14,7 @@ *******************************************************************************/ package org.eclipse.pde.internal.ui.wizards.tools; +import java.util.ArrayList; import java.util.List; import org.eclipse.core.resources.IFile; @@ -42,10 +43,15 @@ public static Job scheduleFor(List models, boolean user) { WorkspaceJob job = new WorkspaceJob(PDEUIMessages.UpdateClasspathJob_title) { @Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { + List toUpdate = new ArrayList<>(); SubMonitor mon = SubMonitor.convert(monitor, PDEUIMessages.UpdateClasspathJob_task, models.size()); for (IPluginModelBase model : models) { - updateClasspath(model, mon.split(1)); + IProject project = updateClasspath(model, mon.split(1)); + if (project != null) { + toUpdate.add(project); + } } + ClasspathComputer.requestClasspathUpdate(toUpdate); return Status.OK_STATUS; } }; @@ -55,7 +61,7 @@ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { return job; } - private static void updateClasspath(IPluginModelBase model, SubMonitor monitor) throws CoreException { + private static IProject updateClasspath(IPluginModelBase model, SubMonitor monitor) throws CoreException { try { monitor.subTask(model.getPluginBase().getId()); // no reason to compile classpath for a non-Java model @@ -70,6 +76,7 @@ private static void updateClasspath(IPluginModelBase model, SubMonitor monitor) file.deleteMarkers(PDEMarkerFactory.MARKER_ID, true, IResource.DEPTH_ZERO); } ClasspathComputer.setClasspath(project, model); + return project; } } } catch (CoreException e) { @@ -77,6 +84,7 @@ private static void updateClasspath(IPluginModelBase model, SubMonitor monitor) PDEPlugin.logException(e, PDEUIMessages.UpdateClasspathJob_error_title, message); throw new CoreException(Status.error(message, e)); } + return null; } }