JDK-6253903 : Serialized Form javadoc for JMX API should list serialVersionUID of all serializable classes
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 5.0,6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,solaris_2.6
  • CPU: generic,sparc
  • Submitted: 2005-04-12
  • Updated: 2024-06-12
  • Resolved: 2005-12-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b63Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Version 1.0 of the JMX API did not explicitly specify the serial form of all classes, and this form was essentially incorrect for certain classes.  Version 1.1 of the API rectified this by defining the serial form explicitly for all classes.  At this time code was introduced to allow continued serial interoperation with the 1.0 classes if a system property is specified.  The serialVersionUID of the relevant classes is different when the property is present than when it is absent.  Since the serialVersionUID is not a compile-time constant, it does not appear in the Javadoc output for these classes.  The classes should be augmented with appropriate @serial tags so that the correct serialVersionUID appears in the documentation.  Otherwise compatible implementations need to analyse the Reference Implementation (e.g. with the serialver tool) in order to determine the correct value.
###@###.### 2005-04-12 12:33:27 GMT

Comments
EVALUATION Currently there are 19 classes defining oldSerialVersionUID and newSerialVersionUID, and setting in a static initialization block their actual serialVersionUID to either one of these values depending on the system property jmx.serial.form. Ideally we would like this information to appear in the Serialized Form javadoc page, as the first information for each class. I did not manage to achieve that so far because the @serial tag must document default serializable fields (so in particular non static) and is ignored in other cases. It is also ignored if used in the main description of the class to add a comment for the Serialized Form page. Unless I am missing something, possible options I see are: * either add this serialVersionUID information to the the main javadoc description of the class (but it will not appear in the Serialized Form page) * or add it to the writeObject and readObject methods javadoc information for the 2 classes that extend the default mechanism, and to the @serial information of an already existing field for the 17 others (a bit ugly though). For information, the impacted classes are: javax/management/ClassAttributeValueExp.java javax/management/modelmbean/DescriptorSupport.java javax/management/modelmbean/InvalidTargetObjectTypeException.java javax/management/modelmbean/ModelMBeanAttributeInfo.java javax/management/modelmbean/ModelMBeanConstructorInfo.java javax/management/modelmbean/ModelMBeanInfoSupport.java javax/management/modelmbean/ModelMBeanNotificationInfo.java javax/management/modelmbean/ModelMBeanOperationInfo.java javax/management/modelmbean/XMLParseException.java javax/management/Notification.java javax/management/NumericValueExp.java javax/management/ObjectName.java javax/management/relation/MBeanServerNotificationFilter.java javax/management/relation/RelationNotification.java javax/management/relation/RelationTypeSupport.java javax/management/relation/RoleInfo.java javax/management/relation/Role.java javax/management/relation/RoleResult.java javax/management/relation/RoleUnresolved.java
22-09-2005

EVALUATION Should be sufficient to visit all classes that define a field called oldSerialVersionUID and add the appropriate tag to them. The Javadoc output for these classes will look different from that of classes that have a plain constant serialVersionUID, but that is all right. ###@###.### 2005-04-12 12:33:28 GMT
12-04-2005