Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-2133

Failure to compile legacy JarProxy class with Java 14

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 12.10
    • Fix Version/s: 13.1-rc-1
    • Component/s: Classloader
    • Labels:
    • Environment:
      Java 14
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ xwiki-commons-legacy-classloader-protocol-jar ---
      [INFO] Changes detected - recompiling the module!
      [INFO] Compiling 3 source files to /Users/vmassol/dev/xwiki/xwiki-commons/xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-classloader/xwiki-commons-legacy-classloader-protocols/xwiki-commons-legacy-classloader-protocol-jar/target/classes
      [INFO] -------------------------------------------------------------
      [WARNING] COMPILATION WARNING : 
      [INFO] -------------------------------------------------------------
      [WARNING] /Users/vmassol/dev/xwiki/xwiki-commons/xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-classloader/xwiki-commons-legacy-classloader-protocols/xwiki-commons-legacy-classloader-protocol-jar/src/main/java/org/xwiki/classloader/internal/protocol/jar/JarURLStreamHandler.java:[36,51] org.xwiki.classloader.internal.protocol.jar.JarURLConnection in org.xwiki.classloader.internal.protocol.jar has been deprecated
      [WARNING] /Users/vmassol/dev/xwiki/xwiki-commons/xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-classloader/xwiki-commons-legacy-classloader-protocols/xwiki-commons-legacy-classloader-protocol-jar/src/main/java/org/xwiki/classloader/internal/protocol/jar/JarURLStreamHandler.java:[36,51] org.xwiki.classloader.internal.protocol.jar.JarURLConnection in org.xwiki.classloader.internal.protocol.jar has been deprecated
      [INFO] 2 warnings 
      [INFO] -------------------------------------------------------------
      [INFO] -------------------------------------------------------------
      [ERROR] COMPILATION ERROR : 
      [INFO] -------------------------------------------------------------
      [ERROR] /Users/vmassol/dev/xwiki/xwiki-commons/xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-classloader/xwiki-commons-legacy-classloader-protocols/xwiki-commons-legacy-classloader-protocol-jar/src/main/java/org/xwiki/classloader/internal/protocol/jar/JarProxy.java:[234,31] unreported exception java.lang.Throwable; must be caught or declared to be thrown
      [INFO] 1 error
      

      The reason is that in Java 8 ZipFile#finalize() was throwing IOException (same in Java 11 BTW) but in Java 14, the JDK changed the signature (bad!) to throw Throwable.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vmassol Vincent Massol
              Reporter:
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: