Bug 561287 - temporary flag to check if bug 559965 is related

Added system flag DISABLE_FIX_FOR_559965 that allows temporarily "undo"
the fix for bug 559965. If the flag is set to true, the fix for bug
559965 is disabled.

Change-Id: Idb5e515af30dfe857fc450aae4b7839669fbcf77
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java
index eaaf803..74d29f8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java
@@ -52,6 +52,8 @@
 
 public static int MaxCompileLoop = 5; // perform a full build if it takes more than ? incremental compile loops
 
+private static final boolean DISABLE_FIX_FOR_559965 = Boolean.getBoolean("DISABLE_FIX_FOR_559965"); //$NON-NLS-1$
+
 protected IncrementalImageBuilder(JavaBuilder javaBuilder, State buildState, CompilationGroup compilationGroup) {
 	super(javaBuilder, true, buildState, compilationGroup);
 	this.nameEnvironment.isIncrementalBuild = true;
@@ -137,7 +139,7 @@
 
 			this.notifier.subTask(Messages.build_analyzingSources);
 			addAffectedSourceFiles();
-			if (this.testImageBuilder != null) {
+			if (this.testImageBuilder != null && !DISABLE_FIX_FOR_559965) {
 				this.testImageBuilder.addAffectedSourceFiles();
 			}
 			this.notifier.updateProgressDelta(0.05f);