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

javac accepts enums being referenced by 'uses' statement

XMLWordPrintable

    • 9
    • b118
    • Verified

      Currently JDK9b111 javac successfully compiles following code:

         a/module-info.java:
         module a {
              uses pkg.FinalClassST;
              uses pkg.EnumST;
              uses pkg.AnnotationST;
         }

         a/pkg/AnnotationST.java:
         package pkg;
         public @interface AnnotationST{}

         a/pkg/EnumST.java:
         package pkg;
         public enum EnumST {A,B}

         a/pkg/FinalClassST.java:
         package pkg;
         public final class FinalClassST{}

      These seem to be erroneous for javac to accept such situations.

      The minimized testcase is attached; in order to run it please:
      1. unzip attached archive on Windows machine;
      2. rename test9\test_bat to test9\test.bat;
      3. modify test.bat by changing JDK_HOME variable to point to your JDK installation;
      4. run test.bat.

            vromero Vicente Arturo Romero Zaldivar
            grakov Georgiy Rakov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: