JDK-6229880 : RelationSupport javadoc is incomplete/ambiguous
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-02-16
  • Updated: 2017-05-16
  • Resolved: 2005-12-21
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 b45Fixed
Description
Here after the RelationSupport javadoc to be updated :

1) RelationSupport constructors
There are some mandatory parameters in the 2 constructors. Otherwise,
the constructors throw an IllegalArgumentException.
These parameters should be clearly listed instead of just called "required value (Relation Service Object Name, etc.)"

2) Some RelationSupport throw a RelationServiceNotRegisteredException
(getAllRoles, getRole, getRoles, setRole...)
To call these methods, it is mandatory to create a RelationSupport object
using the constructor with the MBeanServer parameter.
Otherwise, we get a NullPointerExcpetion.
The javadoc should mention it.

3) RelationSupport.setRole
The javadoc says that a RoleNotFoundException is thrown if the role is not writable.
In fact, a RoleNotFoundException is also thrown when there is no defined role
for the given name (same condition as the getRole method).

4) RelationSupport.setRoles 
The javadoc says that an IllegalArgumentException is thrown if null role name.
Should be null role list.
###@###.### 2005-2-16 13:18:35 GMT

Comments
EVALUATION Spec should be clarified. ###@###.### 2005-2-16 14:07:32 GMT The specification has been clarified for points (1), (3) and (4) in the Description. The point (2) in the Description is an abnormal use of the RelationSupport class as the javadoc already says that the RelationSupport instance has to be added to the Relation Service using the addRelation method so getting an exception, independently of its type, should be enough. These API changes are covered by JCK tests: api/javax_management/relation/index.html#RelationSupportTest01 : RelationSupportTest01 - Constructor1 api/javax_management/relation/index.html#RelationSupportTest02 : RelationSupportTest02 - Constructor2 api/javax_management/relation/index.html#RelationSupportTest07 : RelationSupportTest07 - setRole method api/javax_management/relation/index.html#RelationSupportTest09 : RelationSupportTest09 - setRoles method ###@###.### 2005-06-24 09:36:28 GMT
16-02-2005