Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-8033 JDK 9 support
  3. FLINK-11316

JarFileCreatorTest fails when run with Java 9

    XMLWordPrintableJSON

Details

    Description

      Description
      JarFileCreatorTest fails when run with Java 9. Because JarFileCreator is not used in production, the class and its tests can be deleted.

      Stacktrace:

      java.lang.IllegalArgumentException
      	at org.apache.flink.shaded.asm5.org.objectweb.asm.ClassReader.<init>(Unknown Source)
      	at org.apache.flink.shaded.asm5.org.objectweb.asm.ClassReader.<init>(Unknown Source)
      	at org.apache.flink.shaded.asm5.org.objectweb.asm.ClassReader.<init>(Unknown Source)
      	at org.apache.flink.runtime.util.JarFileCreator.addDependencies(JarFileCreator.java:146)
      	at org.apache.flink.runtime.util.JarFileCreator.createJarFile(JarFileCreator.java:178)
      	at org.apache.flink.runtime.util.JarFileCreatorTest.TestAnonymousInnerClassTrick1(JarFileCreatorTest.java:57)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      

      Steps to reproduce
      With the Java 9 compiler in the path, run:

      mvn test -Pjava9 -DfailIfNoTests=false -Dfast -Dtest=org.apache.flink.runtime.util.JarFileCreatorTest
      

      Alternatively, run the test from IntelliJ with the java9 profile enabled.

      Acceptance Criteria

      • JarFileCreator and JarFileCreatorTest are deleted
      • Usage of JarFileCreator in ClassLoaderUtilsTest#testWithURLClassLoader is replaced with an alternative

      Attachments

        Issue Links

          Activity

            People

              tison Zili Chen
              gjy Gary Yao
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m