United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6229880 : RelationSupport javadoc is incomplete/ambiguous

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

Related Reports

Sub Tasks

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



Hardware and Software, Engineered to Work Together