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"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 14
    • None
    • tools
    • None
    • b26
    • generic
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: