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

Javac issues different error messages for the modifiers of the requires directive

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 24
    • tools
    • None
    • b26

      given code like:

      module test {
          requires static static java.sql;
          requires transitive transitive java.desktop;
      }

      javac prints:

      module-info.java:2: error: repeated modifier
          requires static static java.sql;
                          ^
      module-info.java:3: error: ';' expected
          requires transitive transitive java.desktop;
                                        ^
      module-info.java:3: error: module directive keyword or '}' expected
          requires transitive transitive java.desktop;
                                         ^
      3 errors

      I think that the error for modifier `transitive` should be the same as for `static`

            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: