### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/TestCompilationParticipant.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TestCompilationParticipant.java,v retrieving revision 1.2 diff -u -r1.2 TestCompilationParticipant.java --- src/org/eclipse/jdt/core/tests/model/TestCompilationParticipant.java 27 Jun 2008 16:02:39 -0000 1.2 +++ src/org/eclipse/jdt/core/tests/model/TestCompilationParticipant.java 26 Sep 2008 09:40:47 -0000 @@ -17,7 +17,13 @@ public class TestCompilationParticipant extends CompilationParticipant { public static CompilationParticipant PARTICIPANT; + public static boolean failToInstantiate = false; + public TestCompilationParticipant() { + if (failToInstantiate) + throw new RuntimeException(); + } + public boolean isActive(IJavaProject project) { return PARTICIPANT != null && PARTICIPANT.isActive(project); } Index: src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java,v retrieving revision 1.140 diff -u -r1.140 ReconcilerTests.java --- src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 9 Sep 2008 16:42:52 -0000 1.140 +++ src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 26 Sep 2008 09:40:47 -0000 @@ -3070,6 +3070,38 @@ } /* + * Ensures that a misbehaving reconcile participant doesn't interfere with a reconcile operation + * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=248680 ) + */ +public void testReconcileParticipant12() throws CoreException { + try { + TestCompilationParticipant.failToInstantiate = true; + simulateExitRestart(); + this.workingCopy = getCompilationUnit("Reconciler/src/p1/X.java").getWorkingCopy(this.wcOwner, null); + setWorkingCopyContents( + "package p1;\n" + + "import p2.*;\n" + + "public class X {\n" + + " public void bar() {\n" + + " System.out.println()\n" + + " }\n" + + "}" + ); + startDeltas(); + this.workingCopy.reconcile(ICompilationUnit.NO_AST, false, null, null); + assertWorkingCopyDeltas( + "Unexpected participant delta", + "X[*]: {CHILDREN | FINE GRAINED}\n" + + " bar()[+]: {}\n" + + " foo()[-]: {}" + ); + } finally { + stopDeltas(); + TestCompilationParticipant.failToInstantiate = false; + } +} + + /* * Ensures that errors are fixed if renaming the .classpath file causes the missing type to be visible. * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=207890) */ #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/internal/core/JavaModelManager.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java,v retrieving revision 1.411 diff -u -r1.411 JavaModelManager.java --- model/org/eclipse/jdt/internal/core/JavaModelManager.java 12 Sep 2008 15:42:59 -0000 1.411 +++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 26 Sep 2008 09:40:48 -0000 @@ -268,8 +268,8 @@ } }); } - CompilationParticipant participant = (CompilationParticipant) participants[i]; - if (participant != null && participant.isActive(project)) + CompilationParticipant participant; + if ((participants[i] instanceof CompilationParticipant) && (participant = (CompilationParticipant) participants[i]).isActive(project)) result[index++] = participant; } if (index == 0)