United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6289244 Clarify field(s) added to the Descriptor provided as constructor parameter
JDK-6289244 : Clarify field(s) added to the Descriptor provided as constructor parameter

Details
Type:
Bug
Submit Date:
2005-06-22
Status:
Closed
Updated Date:
2010-07-29
Project Name:
JDK
Resolved Date:
2006-04-14
Component:
core-svc
OS:
generic
Sub-Component:
javax.management
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Relates:

Sub Tasks

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
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
                                     
2005-06-22
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.
                                     
2006-03-15



Hardware and Software, Engineered to Work Together