-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P3
-
None
-
Affects Version/s: 6
-
Component/s: core-svc
The specification for
MBeanServer.registerMBean(Object object, ObjectName name)
states that it may throw:
RuntimeOperationsException – Wraps a java.lang.IllegalArgumentException:
The object passed in parameter is null or no object name is specified.
However, the wording is ambiguous and needs clarification.
Points requiring clarification
1. Meaning of “wraps a java.lang.IllegalArgumentException”
It is unclear whether the specification intends:
(a) That the message of the wrapped IllegalArgumentException must be exactly:
“The object passed in parameter is null”
OR
(b) That a RuntimeOperationsException is thrown when the object parameter is null, and the wrapped exception is an IllegalArgumentException (with implementation-specific message).
The current wording could be interpreted either way.
2. Interpretation of “no object name is specified”
The phrase “no object name is specified” is ambiguous.
The method parameter documentation states:
name – The object name of the MBean. May be null.
This raises the following questions:
Does “no object name is specified” refer to:
name == null, or
an invalid ObjectName, or
some other condition?
If name == null is explicitly allowed by the method contract, in what scenario is
RuntimeOperationsException expected for “no object name is specified”?
MBeanServer.registerMBean(Object object, ObjectName name)
states that it may throw:
RuntimeOperationsException – Wraps a java.lang.IllegalArgumentException:
The object passed in parameter is null or no object name is specified.
However, the wording is ambiguous and needs clarification.
Points requiring clarification
1. Meaning of “wraps a java.lang.IllegalArgumentException”
It is unclear whether the specification intends:
(a) That the message of the wrapped IllegalArgumentException must be exactly:
“The object passed in parameter is null”
OR
(b) That a RuntimeOperationsException is thrown when the object parameter is null, and the wrapped exception is an IllegalArgumentException (with implementation-specific message).
The current wording could be interpreted either way.
2. Interpretation of “no object name is specified”
The phrase “no object name is specified” is ambiguous.
The method parameter documentation states:
name – The object name of the MBean. May be null.
This raises the following questions:
Does “no object name is specified” refer to:
name == null, or
an invalid ObjectName, or
some other condition?
If name == null is explicitly allowed by the method contract, in what scenario is
RuntimeOperationsException expected for “no object name is specified”?
- relates to
-
JDK-8364366 MBeanServer registerMBean throws NPE
-
- Closed
-