jtreg fails when test with @enablePreview is executed with driver mode

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: tools
    • None

      The test like this


      /*
       * @test
       * @enablePreview
       * @run driver ${test.main.class}
       */

      public class PreviewDriverTest {
          Integer i;
          public static void main(String[] args) throws Exception {
          }
      }

      fails in valhalla repo because class is compiled with enable-preview while executed without this option.

      Test fails with:
      java.lang.UnsupportedClassVersionError: Preview features are not enabled for PreviewDriverTest (class file version 71.65535). Try running with '--enable-preview'

      It doesn't use any Valhalla feature directly but has a field Integer and javac generates additional attributes because of this.

      Fix isjust to pass --enable-preview to driver code.
      The workaround is to don't run driver tests with enable preview.

            Assignee:
            Leonid Mesnik
            Reporter:
            Leonid Mesnik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: