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

javac should report the error for default usage as the primary error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • tools
    • b28
    • Verified

        During work on JDK-8049130 for creation of golden files for negative tests, it was discovered that the error message reported for tools/javac/annotations/neg/Z3.java is not as expected.

        Currently, javac reports about the missing body or abstract decl or value() method for the test. This error message can be considered a secondary error message w.r.t. the test. javac instead should also report about the usage of default and this error should be the primary error message.

        Test name: tools/javac/annotations/neg/Z3.java
        Test code:
        enum Color { red, green, blue }
        class Colored { Color value() default Color.red; }

        Current error diagnostic (secondary):
        compiler.err.missing.meth.body.or.decl.abstract

        Expected error diagnostic (primary):
        compiler.err.default.allowed.in.intf.annotation.member

              pgovereau Paul Govereau (Inactive)
              sogoel Sonali Goel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: