Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8334165

Remove serialVersionUID compatibility logic from JMX

XMLWordPrintable

      Various JMX classes are serializable, but unlike most serializable classes, they compute a serialVersionUID value instead of defining that value as a constant. The reason for this is for serialization compatibility with JMX 1.0. These classes used certain SVUID values in 1.0 and different values in 1.1 and later; thus, by default, 1.0 was serialization incompatible with 1.1 and later.

      There is a switch to change the behavior. If the `jmx.serial.form` system property is set to "1.0" these classes will use the "old" SVUID values corresponding to those used in 1.0; otherwise they will use the "new" SVUID values for 1.1 and later. This enables the JMX running in a given JVM to be compatible with 1.0 or with 1.1-and-later, but not both.

      JMX 1.0 is very old at this point -- not sure exactly how old -- and so it seems unnecessary to continue to support this compatibility mode. It should eventually be removed. Initially this likely involves deprecating the `jmx.serial.form` property for removal, issuing release notes, performing community outreach etc.

      After a suitable waiting period, the JMX code should be changed to declare serialVersionUID as a constant (`private static final`) using the "new" values, and extraneous fields should be removed. The documentation for the SVUID value can be removed from the javadoc, as the constant SVUID values will be listed automatically on the JDK's Serialized Form page.

      See JDK-6253903 for a list of the JMX classes affected.

            kevinw Kevin Walls
            smarks Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: