(javac) emits inaccurate diagnostics for enhanced for-loops

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: 6, 8
    • Component/s: tools
    • b40
    • generic
    • generic
    • Verified

      javac emits incorrect diagnostics for a bad "for-each" statement,
      here is an example:
      % javac Test.java
      Test.java:4: error: not a statement
            for (a : x) { }
                 ^
      Test.java:4: error: ';' expected
            for (a : x) { }
                  ^
      Test.java:4: error: illegal start of expression
            for (a : x) { }
                   ^
      Test.java:4: error: ';' expected
            for (a : x) { }
                    ^
      4 errors

            Assignee:
            Kumar Srinivasan
            Reporter:
            Kumar Srinivasan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: