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

error message should adapt to the corresponding top level element

XMLWordPrintable

    • b157
    • Verified

        cat > Test.java << EOF
        > public interface Test2 {}
        > EOF

        javac Test.java
        Test.java:1: error: class Test2 is public, should be declared in a file named Test2.java
        public interface Test2 {}
               ^
        1 error

        the error message should refer to an interface no a class. The same occurs for enums.

              vromero Vicente Arturo Romero Zaldivar
              vromero Vicente Arturo Romero Zaldivar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: