Derby
  1. Derby
  2. DERBY-5542

Remove checks for Java version being greater than or equal to 1.4

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 10.9.1.0
    • Fix Version/s: 10.9.1.0
    • Component/s: Miscellaneous
    • Labels:
      None

      Description

      The code contains some checks for JVMInfo.JDK_ID >= JVMInfo.J2SE_14. That condition evaluates to true on all currently supported platforms (including on CDC/FP), so the checks can be removed.

      1. d5542.diff
        3 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        Attaching a patch that removes these unnecessary checks from conditions in BaseMonitor, EmbedXAResource and CorruptDiskStorageFactory.

        All the regression tests passed with the patch.

        Show
        Knut Anders Hatlen added a comment - Attaching a patch that removes these unnecessary checks from conditions in BaseMonitor, EmbedXAResource and CorruptDiskStorageFactory. All the regression tests passed with the patch.
        Hide
        Mike Matrigali added a comment -

        Do you happen to know what now happens if you try to run 10.8 with a pre-jdk14 jvm. It would be nice if you got some reasonable error or warning vs. some wierd error now that the old code path is gone. Doing this in one place at boot is probably reasonable cost vs the multiple checks that you are going after.

        Show
        Mike Matrigali added a comment - Do you happen to know what now happens if you try to run 10.8 with a pre-jdk14 jvm. It would be nice if you got some reasonable error or warning vs. some wierd error now that the old code path is gone. Doing this in one place at boot is probably reasonable cost vs the multiple checks that you are going after.
        Hide
        Knut Anders Hatlen added a comment -

        Since we compile every class in Derby with target level 1.4 or higher, none of the classes will even load on a pre-jdk14 jvm. This is what I see with Java 1.3 and Derby 10.8.2.2:

        java.lang.UnsupportedClassVersionError: org/apache/derby/tools/sysinfo (Unsupported major.minor version 48.0)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:243)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:51)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:288)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)

        Even though most of the engine classes must still be compiled with target level 1.4 for CDC/FP support, we'll probably want to change the target level to 1.5 for the JDBC 3.0 specific classes (like EmbeddedDriver and EmbeddedDataSource), so that a similar error will be seen when trying to load Derby 10.9 on Java 1.4.

        Show
        Knut Anders Hatlen added a comment - Since we compile every class in Derby with target level 1.4 or higher, none of the classes will even load on a pre-jdk14 jvm. This is what I see with Java 1.3 and Derby 10.8.2.2: java.lang.UnsupportedClassVersionError: org/apache/derby/tools/sysinfo (Unsupported major.minor version 48.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:488) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106) at java.net.URLClassLoader.defineClass(URLClassLoader.java:243) at java.net.URLClassLoader.access$100(URLClassLoader.java:51) at java.net.URLClassLoader$1.run(URLClassLoader.java:190) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:183) at java.lang.ClassLoader.loadClass(ClassLoader.java:294) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:288) at java.lang.ClassLoader.loadClass(ClassLoader.java:250) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310) Even though most of the engine classes must still be compiled with target level 1.4 for CDC/FP support, we'll probably want to change the target level to 1.5 for the JDBC 3.0 specific classes (like EmbeddedDriver and EmbeddedDataSource), so that a similar error will be seen when trying to load Derby 10.9 on Java 1.4.
        Hide
        Knut Anders Hatlen added a comment -

        Committed revision 1220671.

        Show
        Knut Anders Hatlen added a comment - Committed revision 1220671.

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development