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

jdk/javadoc/doclet/testValueTag/TestValueTagInModule.java missing modules declaration

    XMLWordPrintable

Details

    Description

      If the test jdk/javadoc/doclet/testValueTag/TestValueTagInModule.java is run on its own, it fails with:

      /home/erik/hg/jdk/open/test/langtools/tools/lib/toolbox/JavacTask.java:46: error: package com.sun.tools.javac.api is not visible
      import com.sun.tools.javac.api.JavacTaskImpl;
                                ^
        (package com.sun.tools.javac.api is declared in module jdk.compiler, which does not export it to the unnamed module)
      /home/erik/hg/jdk/open/test/langtools/tools/lib/toolbox/JavacTask.java:47: error: package com.sun.tools.javac.api is not visible
      import com.sun.tools.javac.api.JavacTool;
                                ^
        (package com.sun.tools.javac.api is declared in module jdk.compiler, which does not export it to the unnamed module)
      Note: Some input files use unchecked or unsafe operations.
      Note: Recompile with -Xlint:unchecked for details.
      2 errors

      This is because a test lib it uses needs the jdk.compiler module to compile. The reason this works in langtools/:tier1 is that this test is rarely the first test to use this lib, so the lib is already compiled when it's time for this test.

      I discovered this while experimenting with concurrency settings for testing and this test started failing with higher concurrency.

      Suggested fix:

      diff -r fad3614d1f0f test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTagInModule.java
      --- a/test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTagInModule.java
      +++ b/test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTagInModule.java
      @@ -27,6 +27,8 @@
        * @summary {@value} should be permitted in module documentation
        * @library /tools/lib ../lib
        * @modules jdk.javadoc/jdk.javadoc.internal.tool
      + * jdk.compiler/com.sun.tools.javac.api
      + * jdk.compiler/com.sun.tools.javac.main
        * @build JavadocTester
        * @run main TestValueTagInModule
        */

      Attachments

        Activity

          People

            erikj Erik Joelsson
            erikj Erik Joelsson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: