From e56771186c7e264558b28c619de2f1fdc092eb73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Kubitz?= Date: Tue, 12 Nov 2024 11:22:53 +0100 Subject: [PATCH] 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. https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/1742 --- .../model/org/eclipse/jdt/internal/core/DeltaProcessor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java index 8505d77d241..6b8bfcb460d 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java @@ -30,6 +30,7 @@ import java.util.Set; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.ILog; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.ISafeRunnable; @@ -2022,7 +2023,8 @@ public void resetProjectCaches() { */ public void registerJavaModelDelta(IJavaElementDelta delta) { if (JavaModelManager.isReadOnly()) { - throw new IllegalStateException("Its not allow to modify JavaModel during ReadOnly action. delta=" + delta); //$NON-NLS-1$ + ILog.get().warn("JavaModel change during readOnly Operation", new IllegalStateException( //$NON-NLS-1$ + "Its not allow to modify JavaModel during ReadOnly action. delta=" + delta)); //$NON-NLS-1$ } this.javaModelDeltas.add(delta); }