langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
changeset 31939 89d4a8756f98
parent 29293 1583c6dd6df7
child 31941 8a56abc0778a
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Tue Jul 28 17:01:45 2015 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Thu Jul 30 13:20:01 2015 +0100
@@ -581,6 +581,10 @@
      * Ident = IDENTIFIER
      */
     protected Name ident() {
+        return ident(false);
+    }
+
+    protected Name ident(boolean advanceOnErrors) {
         if (token.kind == IDENTIFIER) {
             Name name = token.name();
             nextToken();
@@ -616,6 +620,9 @@
             return name;
         } else {
             accept(IDENTIFIER);
+            if (advanceOnErrors) {
+                nextToken();
+            }
             return names.error;
         }
     }
@@ -1413,7 +1420,7 @@
                         // is the mode check needed?
                         tyannos = typeAnnotationsOpt();
                     }
-                    t = toP(F.at(pos1).Select(t, ident()));
+                    t = toP(F.at(pos1).Select(t, ident(true)));
                     if (tyannos != null && tyannos.nonEmpty()) {
                         t = toP(F.at(tyannos.head.pos).AnnotatedType(tyannos, t));
                     }