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

Test langtools/test/tools/javac/NoClass.java is failing when run together with langtools/test/tools/javac/DuplicateImport.java

XMLWordPrintable

    • b31
    • Verified

        When the golden/expected output was added to the javac/NoClass.java test as part of JDK-8055079, the test started to fail when run together with javac/DuplicateImport.java. The reason is the NoClass test expects that package "nonexistent.pack" does not exist, while the package is defined by the DuplicateImport test. And so while the compilation of NoClass fails correctly (which is why the test was passing so far), it fails with an incorrect error, causing the test failure. Note that this reveals an inherent bug in NoClass test - the test was behaving differently when run in batch with other tests and when run separately.

        There is test langtools/test/tools/javac/importChecks/InvalidImportsNoClasses.java, which is equivalent to the intended functionality of NoClass, so it may be enough to remove the NoClass test, and keep the InvalidImportsNoClasses test.

              jlahoda Jan Lahoda
              jlahoda Jan Lahoda
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: