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

Wrong module name for "package P is declared in the unnamed module, but module M does not read it"

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 14
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b26
    • CPU:
      generic
    • OS:
      generic

      Description

      If a test case is TestNG based, and it uses a module with @library directive, javac fails to compile it, somehow considering testng.jar as a module. Here is the excerpt of the compile error:

      ```
      Anyway, the test creates a SPI implementation as a library module, then try to use it in testng, however the test fails to compile with the following:
      /projects/jdk/jdk/cnp/open/test/jdk/java/text/Format/CompactNumberFormat/SPIProviderTest.java:37: error: package org.testng is not visible
      import static org.testng.Assert.*;
                       ^
        (package org.testng is declared in the unnamed module, but module org.testng does not read it)
      ```

      The entire .jtr file, as well as the test case are attached.

        Attachments

          Activity

            People

            • Assignee:
              jlahoda Jan Lahoda
              Reporter:
              naoto Naoto Sato
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: