Bug 404648 - [1.8][compiler] investigate differences between ECJ & Javac

- assign new excuse for bug in javac8-, intermittently masked by another

Change-Id: Id76c5714e878ff1cac7b894aece837059f1522ed
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
index 6dde473..9636265 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
@@ -543,6 +543,7 @@
 	}
 	public static class Excuse extends JavacTestOptions {
 		protected int mismatchType;
+		public boolean isIntermittent;
 		Excuse(int mismatchType) {
 			this.mismatchType = mismatchType;
 		}
@@ -758,6 +759,10 @@
 			this.pivotCompliance = pivotCompliance;
 			this.pivotMinor = pivotMinor;
 		}
+		public JavacHasABug(int mismatchType, long pivotCompliance, int pivotMinor, boolean intermittent) {
+			this(mismatchType, pivotCompliance, pivotMinor);
+			this.isIntermittent = intermittent;
+		}
 		Excuse excuseFor(JavacCompiler compiler) {
 			if (this.minorsFixed != null) {
 				if (compiler.compliance == ClassFileConstants.JDK1_8) {
@@ -857,7 +862,9 @@
 			JavacBug8204534 = RUN_JAVAC ? // https://bugs.openjdk.java.net/browse/JDK-8204534
 				new JavacHasABug(MismatchType.EclipseErrorsJavacNone, ((long)55)<<16, 0000) : null, // FIXME: use JDK11
 			JavacBug8207032 = RUN_JAVAC ? // https://bugs.openjdk.java.net/browse/JDK-8207032
-				new JavacHasABug(MismatchType.EclipseErrorsJavacNone) : null;
+				new JavacHasABug(MismatchType.EclipseErrorsJavacNone) : null,
+			JavacBug8044196 = RUN_JAVAC ? // likely https://bugs.openjdk.java.net/browse/JDK-8044196, intermittently masked by https://bugs.openjdk.java.net/browse/JDK-8029161
+				new JavacHasABug(MismatchType.EclipseErrorsJavacNone, ClassFileConstants.JDK9, 0000, true) : null;
 
 		// bugs that have been fixed but that we've not identified
 		public static JavacHasABug
@@ -2316,7 +2323,10 @@
 		}
 	}
 	if (excuse != null) {
-		fail(testName + ": unused excuse " + excuse + " for compiler " + compiler);
+		if (excuse.isIntermittent)
+			System.err.println(testName + ": unused execuse (intermittent bug) "+excuse + " for compiler " + compiler);
+		else
+			fail(testName + ": unused excuse " + excuse + " for compiler " + compiler);
 	}
 }
 
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RepeatableAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RepeatableAnnotationTest.java
index fa2127d..e50c8f4 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RepeatableAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RepeatableAnnotationTest.java
@@ -142,19 +142,23 @@
 					"}\n"
 				}, 
 				"");
-		this.runNegativeTest(
+		Runner runner = new Runner();
+		runner.testFiles =
 			new String[] {
 				"X.java",
 				"@Foo @Foo public class X { /* Problem */\n" +
 				"}\n"
-			},
+			};
+		runner.expectedCompilerLog =
 			"----------\n" + 
 			"1. ERROR in X.java (at line 1)\n" + 
 			"	@Foo @Foo public class X { /* Problem */\n" + 
 			"	^^^^\n" + 
 			"The annotation @Foo cannot be repeated at this location since its container annotation type @FooContainer is disallowed at this location\n" + 
-			"----------\n",
-			null, false /* don't flush*/);
+			"----------\n";
+		runner.shouldFlushOutputDirectory = false;
+		runner.javacTestOptions = JavacTestOptions.JavacHasABug.JavacBug8044196;
+		runner.runNegativeTest();
 	}
 
 	// Test that a single, repeatable annotation can exist just fine an occurrence of its container annotation