JDK-6241620 : DescriptorSupport(String[],Object[]) doc contradictory concerning null parameters
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-03-16
  • Updated: 2010-07-29
  • Resolved: 2005-05-24
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 b37Fixed
Related Reports
Duplicate :  
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
EVALUATION Trivial change. ###@###.### 2005-03-16 18:53:51 GMT
16-03-2005

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
16-03-2005