--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java Mon Oct 16 18:15:41 2017 +0530
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java Fri Sep 01 14:04:20 2017 +0200
@@ -241,12 +241,19 @@
boolean firstToComplete = queue.isEmpty();
Phase prevTopLevelPhase = topLevelPhase;
+ boolean success = false;
try {
topLevelPhase = this;
doCompleteEnvs(envs);
+ success = true;
} finally {
topLevelPhase = prevTopLevelPhase;
+ if (!success && firstToComplete) {
+ //an exception was thrown, e.g. BreakAttr:
+ //the queue would become stale, clear it:
+ queue.clear();
+ }
}
if (firstToComplete) {