Skip to content

Commit 3ed582d

Browse files
committed
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.
1 parent 512b94b commit 3ed582d

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateClasspathJob.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*******************************************************************************/
1515
package org.eclipse.pde.internal.ui.wizards.tools;
1616

17+
import java.util.ArrayList;
1718
import java.util.List;
1819

1920
import org.eclipse.core.resources.IFile;
@@ -42,10 +43,15 @@ public static Job scheduleFor(List<IPluginModelBase> models, boolean user) {
4243
WorkspaceJob job = new WorkspaceJob(PDEUIMessages.UpdateClasspathJob_title) {
4344
@Override
4445
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
46+
List<IProject> toUpdate = new ArrayList<>();
4547
SubMonitor mon = SubMonitor.convert(monitor, PDEUIMessages.UpdateClasspathJob_task, models.size());
4648
for (IPluginModelBase model : models) {
47-
updateClasspath(model, mon.split(1));
49+
IProject project = updateClasspath(model, mon.split(1));
50+
if (project != null) {
51+
toUpdate.add(project);
52+
}
4853
}
54+
ClasspathComputer.requestClasspathUpdate(toUpdate);
4955
return Status.OK_STATUS;
5056
}
5157
};
@@ -55,7 +61,7 @@ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
5561
return job;
5662
}
5763

58-
private static void updateClasspath(IPluginModelBase model, SubMonitor monitor) throws CoreException {
64+
private static IProject updateClasspath(IPluginModelBase model, SubMonitor monitor) throws CoreException {
5965
try {
6066
monitor.subTask(model.getPluginBase().getId());
6167
// no reason to compile classpath for a non-Java model
@@ -70,13 +76,15 @@ private static void updateClasspath(IPluginModelBase model, SubMonitor monitor)
7076
file.deleteMarkers(PDEMarkerFactory.MARKER_ID, true, IResource.DEPTH_ZERO);
7177
}
7278
ClasspathComputer.setClasspath(project, model);
79+
return project;
7380
}
7481
}
7582
} catch (CoreException e) {
7683
String message = PDEUIMessages.UpdateClasspathJob_error_message;
7784
PDEPlugin.logException(e, PDEUIMessages.UpdateClasspathJob_error_title, message);
7885
throw new CoreException(Status.error(message, e));
7986
}
87+
return null;
8088
}
8189

8290
}

0 commit comments

Comments
 (0)