View | Details | Raw Unified | Return to bug 248680
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/TestCompilationParticipant.java (+6 lines)
Lines 17-23 Link Here
17
public class TestCompilationParticipant extends CompilationParticipant {
17
public class TestCompilationParticipant extends CompilationParticipant {
18
18
19
	public static CompilationParticipant PARTICIPANT;
19
	public static CompilationParticipant PARTICIPANT;
20
	public static boolean failToInstantiate = false;
20
21
22
	public TestCompilationParticipant() {
23
		if (failToInstantiate)
24
			throw new RuntimeException();
25
	}
26
	
21
	public boolean isActive(IJavaProject project) {
27
	public boolean isActive(IJavaProject project) {
22
		return PARTICIPANT != null && PARTICIPANT.isActive(project);
28
		return PARTICIPANT != null && PARTICIPANT.isActive(project);
23
	}
29
	}
(-)src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java (+32 lines)
Lines 3070-3075 Link Here
3070
}
3070
}
3071
3071
3072
/*
3072
/*
3073
 * Ensures that a misbehaving reconcile participant doesn't interfere with a reconcile operation
3074
 * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=248680 )
3075
 */
3076
public void testReconcileParticipant12() throws CoreException {
3077
	try {
3078
		TestCompilationParticipant.failToInstantiate = true;
3079
		simulateExitRestart();
3080
		this.workingCopy = getCompilationUnit("Reconciler/src/p1/X.java").getWorkingCopy(this.wcOwner, null);
3081
		setWorkingCopyContents(
3082
			"package p1;\n" +
3083
			"import p2.*;\n" +
3084
			"public class X {\n" +
3085
			"  public void bar() {\n" +
3086
			"    System.out.println()\n" +
3087
			"  }\n" +
3088
			"}"
3089
		);
3090
		startDeltas();
3091
		this.workingCopy.reconcile(ICompilationUnit.NO_AST, false, null, null);
3092
		assertWorkingCopyDeltas(
3093
			"Unexpected participant delta",
3094
			"X[*]: {CHILDREN | FINE GRAINED}\n" + 
3095
			"	bar()[+]: {}\n" + 
3096
			"	foo()[-]: {}"
3097
		);
3098
	} finally {
3099
		stopDeltas();
3100
		TestCompilationParticipant.failToInstantiate = false;
3101
	}
3102
}
3103
3104
	/*
3073
 * Ensures that errors are fixed if renaming the .classpath file causes the missing type to be visible.
3105
 * Ensures that errors are fixed if renaming the .classpath file causes the missing type to be visible.
3074
 * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=207890)
3106
 * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=207890)
3075
 */
3107
 */
(-)model/org/eclipse/jdt/internal/core/JavaModelManager.java (-2 / +2 lines)
Lines 268-275 Link Here
268
						}
268
						}
269
					});
269
					});
270
				}
270
				}
271
				CompilationParticipant participant = (CompilationParticipant) participants[i];
271
				CompilationParticipant participant;
272
				if (participant != null && participant.isActive(project))
272
				if ((participants[i] instanceof CompilationParticipant) && (participant = (CompilationParticipant) participants[i]).isActive(project))
273
					result[index++] = participant;
273
					result[index++] = participant;
274
			}
274
			}
275
			if (index == 0)
275
			if (index == 0)

Return to bug 248680