Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7159445

(javac) emits inaccurate diagnostics for enhanced for-loops

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 6, 8
    • Fix Version/s: 8
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b40
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      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

        Issue Links

          Activity

          Hide
          ksrini Kumar Srinivasan added a comment -
          BT2:EVALUATION

          yes needs to be fixed, and is a very simple fix.
          Show
          ksrini Kumar Srinivasan added a comment - BT2:EVALUATION yes needs to be fixed, and is a very simple fix.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: