Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-2200

JEP 443: Illegal field name "" in class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Information Provided
    • 3.1.2
    • None
    • Maven Surefire Plugin
    • None
    • JDK 21 GA
      Maven 3.9.4
      junit-jupiter 5.10.0
      maven-surefire-plugin 3.1.2
      maven-compiler-plugin 3.11.0

    Description

      When running a test class that makes use of JEP 443, surefire reports an Error, despite being run with --enable-preview.

      [ERROR] Illegal field name "" in class com.example.Demo

      Example:

      class Demo {
          @Test
          public void test() {
              Function<Object, Integer> foo = _ -> 1;
              // ...
          }
      }

      It is worth noting, that compiler:3.11.0:testCompile completes just fine.

      The maven-compiler-plugin requires <compilerArg>--enable-preview</compilerArg> and maven-surefire-plugin require <argLine>-enable-preview</argLine>.

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sebastianstenzel Sebastian Stenzel
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: