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

Misplaced "unnamed classes are a preview feature and are disabled by default" error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 22
    • 21
    • tools
    • b03

    Backports

      Description

        The error about disabled unnamed classes is put on a weird place - at the end of the file. Consider:
        ---
        $ cat Test.java
        void main() {
            System.err.println("Hello!");
        }

        $ java Test.java
        Test.java:4: error: unnamed classes are a preview feature and are disabled by default.

          (use --enable-preview to enable unnamed classes)
        1 error
        error: compilation failed
        ---

        Would be better if the error was placed at the first non-class member of the unnamed class.

        Attachments

          Issue Links

            Activity

              People

                jlahoda Jan Lahoda
                jlahoda Jan Lahoda
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: