src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java
changeset 47350 d65c3b21081c
parent 47248 22d665f53a4a
child 48054 702043a4cdeb
--- 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) {