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

[TESTBUG] javadoc/doclet/InheritDocForUserTags fails with -othervm

XMLWordPrintable

        When the above test is run with jtreg -othervm it fails with:

         JavadocTester.java:99: error: unknown tag: Test
             * @Test
                     ^

        However the test will pass if jtreg is run in the agentvm mode. But the agentvm mode seems to be hiding a bug in the test: InheritDocForUserTags/DocTest.java has a class SimpleInheritDocDocTest extends DocTest which uses the javadoc @inheritDoc tag to inherit its documentation from DocTest. But the javadoc comment for DocTest is incorrectly placed before the import statement at the top of the file, rather than directly preceeding the class declaration. DocTest's parent class JavadocTester then has an error in its doc comment: it has an unescaped @ in "@Test" in a code sample, which javadoc interprets as a documentation tag and then errors out on.

        The reason it passes with -agentvm is that in this mode, javadoc cannot find the source file for JavadocTester and so uses the class file:

        [loading /home/nicgas01/jdk/build/linux-aarch64-server-fastdebug/test-su\ pport/jtreg_test_langtools_jdk_javadoc_doclet_InheritDocForUserTags_DocT\ est_java/classes/0/jdk/javadoc/lib/javadoc/tester/JavadocTester.class]

        Whereas with -othervm it can find the source file and parses it:

        [loading /home/nicgas01/jdk/test/langtools/jdk/javadoc/lib/javadoc/teste\ r/JavadocTester.java]

        This seems to be because othervm mode will set -sourcepath whereas agentvm mode is missing this line:

        source path: /home/nicgas01/jdk/test/langtools/jdk/javadoc/lib

              ngasson Nick Gasson
              ngasson Nick Gasson
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: