United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6241620 DescriptorSupport(String[],Object[]) doc contradictory concerning null parameters
JDK-6241620 : DescriptorSupport(String[],Object[]) doc contradictory concerning null parameters

Details
Type:
Bug
Submit Date:
2005-03-16
Status:
Resolved
Updated Date:
2010-07-29
Project Name:
JDK
Resolved Date:
2005-05-24
Component:
core-svc
OS:
generic
Sub-Component:
javax.management
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description
The API documentation for the constructor javax.management.modelmbean.DescriptorSupport(String[],Object[]) says:
"The array and array elements cannot be null."
Then later it says:
"@param fieldValues Object array of the corresponding field values.  Elements of the array can be null."
Finally it says:
"Note: array sizes of parameters should match. If both arrays are null or empty, then an empty descriptor is created."

The JCK requires implementations to throw an exception if either or both parameters are null.  So the best fix to the documentation is to specify this.  There are in any case easier ways to create an empty DescriptorSupport using the other constructors, in particular the no-arg constructor.
###@###.### 2005-03-16 17:50:29 GMT

                                    

Comments
SUGGESTED FIX

Change:
"The array and array elements cannot be null."
to:
"Neither array can be null."

Change:
"If both arrays are null or empty, then an empty descriptor is created."
to:
"If both arrays are empty, then an empty descriptor is created."

The remainder of the spec for this constructor already says that elements of fieldNames cannot be null while elements of fieldValues can.

###@###.### 2005-03-16 17:50:30 GMT
                                     
2005-03-16
EVALUATION

Trivial change.
###@###.### 2005-03-16 18:53:51 GMT
                                     
2005-03-16



Hardware and Software, Engineered to Work Together