Skip to content

Commit 6b53bf4

Browse files
committed
Downgrade ReadOnly Exception to warning
Throwing an Exception here currently causes more pain then just continuing. Ideally one would rework the getter JavaProject.getResolvedClasspath() to never modify the javamodel, but it's not clear how todo that in a compatible way. eclipse-jdt/eclipse.jdt.ui#1742
1 parent 74ec8f9 commit 6b53bf4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.Set;
3131
import org.eclipse.core.resources.*;
3232
import org.eclipse.core.runtime.CoreException;
33+
import org.eclipse.core.runtime.ILog;
3334
import org.eclipse.core.runtime.IPath;
3435
import org.eclipse.core.runtime.IProgressMonitor;
3536
import org.eclipse.core.runtime.ISafeRunnable;
@@ -2022,7 +2023,9 @@ public void resetProjectCaches() {
20222023
*/
20232024
public void registerJavaModelDelta(IJavaElementDelta delta) {
20242025
if (JavaModelManager.isReadOnly()) {
2025-
throw new IllegalStateException("Its not allow to modify JavaModel during ReadOnly action. delta=" + delta); //$NON-NLS-1$
2026+
ILog.get().warn("JavaModel change during read only operation", new IllegalStateException( //$NON-NLS-1$
2027+
"JavaModel modified during 'read only' operation. Consider to report this warning to https://github.com/eclipse-jdt/eclipse.jdt.core/issues. delta=" //$NON-NLS-1$
2028+
+ delta));
20262029
}
20272030
this.javaModelDeltas.add(delta);
20282031
}

0 commit comments

Comments
 (0)