Skip to content

Commit 0360e05

Browse files
HannesWelliils-hwellmann
authored andcommitted
Prevent initial build-path errors on new external-folders in container
When adding an external-folder ('library-folder') to a classpath-container for the first time the initial build (without a rebuild, e.g. through auto-build) leads to a build-path (validation) error. This happens for example when adding to a MANIFEST.MF a new requirement on a bundle that's a directory and not a jar and the PDE 'required-Plugins' classpath container is updated.
1 parent 668fa97 commit 0360e05

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ChangeClasspathOperation.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2010 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -50,10 +50,6 @@ protected void classpathChanged(ClasspathChange change, boolean refreshExternalF
5050
project.resetCaches();
5151

5252
if (this.canChangeResources) {
53-
// workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=177922
54-
if (isTopLevelOperation() && !ResourcesPlugin.getWorkspace().isTreeLocked()) {
55-
new ClasspathValidation(project).validate();
56-
}
5753

5854
// delta, indexing and classpath markers are going to be created by the delta processor
5955
// while handling the resource change (either .classpath change, or project touched)
@@ -62,6 +58,11 @@ protected void classpathChanged(ClasspathChange change, boolean refreshExternalF
6258
// and ensure that external folders are updated as well
6359
new ExternalFolderChange(project, change.oldResolvedClasspath).updateExternalFoldersIfNecessary(refreshExternalFolder, null);
6460

61+
// workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=177922
62+
if (isTopLevelOperation() && !ResourcesPlugin.getWorkspace().isTreeLocked()) {
63+
new ClasspathValidation(project).validate();
64+
}
65+
6566
} else {
6667
DeltaProcessingState state = JavaModelManager.getDeltaState();
6768
JavaElementDelta delta = new JavaElementDelta(getJavaModel());

0 commit comments

Comments
 (0)