JDK-6717257 : MBeanServer doesn't describe RuntimeException for methods inherited from MBeanServerConnection
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-06-20
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
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 7
7 b34Fixed
Related Reports
Relates :  
Description
The doc comments in MBeanServer were mostly deleted in JDK 6 / JMX 1.4, to inherit the specifications from the parent interface MBeanServerConnection.  Unfortunately, the @throws declarations for unchecked exceptions such as RuntimeOperationsException are not inherited.  This makes sense, though not obviously: if they *were* inherited then there would be no way to remove them in a subclass.  With a checked exception, if it doesn't apply to the subclass then you simply remove it from the throws clause of the method declaration, and javadoc then doesn't inherit the corresponding @throws text.  (This is the case with IOException in MBeanServerConnection and MBeanServer.)  But with an unchecked exception it doesn't have to appear in the throws clause to be throwable, and indeed putting it there is considered bad style.

The upshot for us is that the documentation of MBeanServer is incorrect in that it omits this specification.  Users can figure things out by looking at MBeanServerConnection or JDK 5, but we should obviously fix this.  The specification in JDK 6 is frozen but we can fix this in JDK 7.

Comments
SUGGESTED FIX Add to the relevant methods: /** * @throws RuntimeOperationsException {@inheritDoc} */
20-06-2008

EVALUATION Obvious and necessary fix.
20-06-2008