Skip to content

Commit

Permalink
Downgrade ReadOnly Exception to warning
Browse files Browse the repository at this point in the history
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
  • Loading branch information
EcljpseB0T committed Nov 12, 2024
1 parent 9398905 commit e567711
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit e567711

Please sign in to comment.