JDK-6289244 : Clarify field(s) added to the Descriptor provided as constructor parameter
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-06-22
  • Updated: 2010-07-29
  • Resolved: 2006-04-14
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 b81Fixed
Related Reports
Relates :  
Description
Since b41 which comes with the fix for 6254721, the field openType is added to the Descriptor provided to the constructor of classes OpenMBeanOperationInfoSupport, OpenMBeanParameterInfoSupport and OpenMBeanAttributeInfoSupport.
The issue is that it contradicts the javadoc for descriptor parameter that says "This may be null in which case the operation's descriptor will be empty.".
###@###.### 2005-06-22 10:15:29 GMT

Comments
EVALUATION The rewording in the Suggested Fix (saying that null is equivalent to an empty descriptor rather than saying that the resultant descriptor is empty) is an excellent idea. In practice the only classes that produce a different descriptor on output are OpenMBeanAttributeInfoSupport, OpenMBeanOperationInfoSupport, OpenMBeanParameterInfoSupport. I do not think there is any special problem with concurrent modification of mutable descriptors. The constructors in question take a snapshot of the descriptor and use that snapshot to make another descriptor with the added fields.
15-03-2006

SUGGESTED FIX (1) The javadoc should clearly say that extra fields can be added to the Descriptor provided to the constructor. It is unclear to me what is the best way to handle the case the provided Descriptor is mutable, then some extra fields are added but unluckily another thread modifies the original Descriptor. (2) The sentence "This may be null in which case the operation's descriptor will be empty." should be rephrased to say that providing a null Descriptor is equivalent to providing an empty Descriptor. That sentence is present in constructor for the following classes: javax.management.MBeanAttributeInfo javax.management.MBeanConstructorInfo javax.management.MBeanFeatureInfo javax.management.MBeanInfo javax.management.MBeanNotificationInfo javax.management.MBeanOperationInfo javax.management.MBeanParameterInfo javax.management.openmbean.OpenMBeanAttributeInfoSupport javax.management.openmbean.OpenMBeanConstructorInfoSupport javax.management.openmbean.OpenMBeanInfoSupport javax.management.openmbean.OpenMBeanOperationInfoSupport javax.management.openmbean.OpenMBeanParameterInfoSupport ###@###.### 2005-06-22 10:15:29 GMT
22-06-2005