6405862: Allow CompositeType to have zero items
authoremcmanus
Tue, 02 Sep 2008 14:14:05 +0200
changeset 1154 4561ee1fb2b7
parent 1153 6b88c071a015
child 1155 a9a142fcf1b5
6405862: Allow CompositeType to have zero items 6737133: Compilation failure of test/javax/management/eventService/LeaseManagerDeadlockTest.java 6737140: Javadoc of some throw clauses of MBeanServer and MBeanServerConnection is garbled 6737143: createMBean of MBeanServer should acquire 2 extra throw clauses present in MBeanServerConnection Reviewed-by: dfuchs
jdk/src/share/classes/javax/management/MBeanServer.java
jdk/src/share/classes/javax/management/MBeanServerConnection.java
jdk/src/share/classes/javax/management/openmbean/CompositeType.java
jdk/test/javax/management/eventService/LeaseManagerDeadlockTest.java
--- a/jdk/src/share/classes/javax/management/MBeanServer.java	Mon Sep 01 17:11:58 2008 +0200
+++ b/jdk/src/share/classes/javax/management/MBeanServer.java	Tue Sep 02 14:14:05 2008 +0200
@@ -264,6 +264,8 @@
      * is sent as described <a href="#notif">above</a>.</p>
      *
      * @throws RuntimeOperationsException {@inheritDoc}
+     * @throws RuntimeMBeanException {@inheritDoc}
+     * @throws RuntimeErrorException {@inheritDoc}
      */
     public ObjectInstance createMBean(String className, ObjectName name)
             throws ReflectionException, InstanceAlreadyExistsException,
@@ -276,6 +278,8 @@
      * is sent as described <a href="#notif">above</a>.</p>
      *
      * @throws RuntimeOperationsException {@inheritDoc}
+     * @throws RuntimeMBeanException {@inheritDoc}
+     * @throws RuntimeErrorException {@inheritDoc}
      */
     public ObjectInstance createMBean(String className, ObjectName name,
                                       ObjectName loaderName)
@@ -289,6 +293,8 @@
      * is sent as described <a href="#notif">above</a>.</p>
      *
      * @throws RuntimeOperationsException {@inheritDoc}
+     * @throws RuntimeMBeanException {@inheritDoc}
+     * @throws RuntimeErrorException {@inheritDoc}
      */
     public ObjectInstance createMBean(String className, ObjectName name,
                                       Object params[], String signature[])
@@ -302,6 +308,8 @@
      * is sent as described <a href="#notif">above</a>.</p>
      *
      * @throws RuntimeOperationsException {@inheritDoc}
+     * @throws RuntimeMBeanException {@inheritDoc}
+     * @throws RuntimeErrorException {@inheritDoc}
      */
     public ObjectInstance createMBean(String className, ObjectName name,
                                       ObjectName loaderName, Object params[],
--- a/jdk/src/share/classes/javax/management/MBeanServerConnection.java	Mon Sep 01 17:11:58 2008 +0200
+++ b/jdk/src/share/classes/javax/management/MBeanServerConnection.java	Tue Sep 02 14:14:05 2008 +0200
@@ -78,19 +78,19 @@
      * MBean will not be registered.
      * @exception RuntimeMBeanException If the <CODE>postRegister</CODE>
      * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws a
-     * <CODE>RuntimeException</CODE>, the <CODE>createMBean<CODE> method will
+     * <CODE>RuntimeException</CODE>, the <CODE>createMBean</CODE> method will
      * throw a <CODE>RuntimeMBeanException</CODE>, although the MBean creation
      * and registration succeeded. In such a case, the MBean will be actually
-     * registered even though the <CODE>createMBean<CODE> method
+     * registered even though the <CODE>createMBean</CODE> method
      * threw an exception. Note that <CODE>RuntimeMBeanException</CODE> can
      * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
      * will not be registered.
      * @exception RuntimeErrorException If the <CODE>postRegister</CODE>
      * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws an
-     * <CODE>Error</CODE>, the <CODE>createMBean<CODE> method will
+     * <CODE>Error</CODE>, the <CODE>createMBean</CODE> method will
      * throw a <CODE>RuntimeErrorException</CODE>, although the MBean creation
      * and registration succeeded. In such a case, the MBean will be actually
-     * registered even though the <CODE>createMBean<CODE> method
+     * registered even though the <CODE>createMBean</CODE> method
      * threw an exception.  Note that <CODE>RuntimeErrorException</CODE> can
      * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
      * will not be registered.
@@ -150,19 +150,19 @@
      * MBean will not be registered.
      * @exception RuntimeMBeanException If the <CODE>postRegister</CODE>
      * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws a
-     * <CODE>RuntimeException</CODE>, the <CODE>createMBean<CODE> method will
+     * <CODE>RuntimeException</CODE>, the <CODE>createMBean</CODE> method will
      * throw a <CODE>RuntimeMBeanException</CODE>, although the MBean creation
      * and registration succeeded. In such a case, the MBean will be actually
-     * registered even though the <CODE>createMBean<CODE> method
+     * registered even though the <CODE>createMBean</CODE> method
      * threw an exception.  Note that <CODE>RuntimeMBeanException</CODE> can
      * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
      * will not be registered.
      * @exception RuntimeErrorException If the <CODE>postRegister</CODE>
      * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws an
-     * <CODE>Error</CODE>, the <CODE>createMBean<CODE> method will
+     * <CODE>Error</CODE>, the <CODE>createMBean</CODE> method will
      * throw a <CODE>RuntimeErrorException</CODE>, although the MBean creation
      * and registration succeeded. In such a case, the MBean will be actually
-     * registered even though the <CODE>createMBean<CODE> method
+     * registered even though the <CODE>createMBean</CODE> method
      * threw an exception.  Note that <CODE>RuntimeErrorException</CODE> can
      * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
      * will not be registered.
@@ -225,19 +225,19 @@
      * MBean will not be registered.
      * @exception RuntimeMBeanException If the <CODE>postRegister</CODE>
      * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws a
-     * <CODE>RuntimeException</CODE>, the <CODE>createMBean<CODE> method will
+     * <CODE>RuntimeException</CODE>, the <CODE>createMBean</CODE> method will
      * throw a <CODE>RuntimeMBeanException</CODE>, although the MBean creation
      * and registration succeeded. In such a case, the MBean will be actually
-     * registered even though the <CODE>createMBean<CODE> method
+     * registered even though the <CODE>createMBean</CODE> method
      * threw an exception.  Note that <CODE>RuntimeMBeanException</CODE> can
      * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
      * will not be registered.
      * @exception RuntimeErrorException If the <CODE>postRegister</CODE>
      * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws an
-     * <CODE>Error</CODE>, the <CODE>createMBean<CODE> method will
+     * <CODE>Error</CODE>, the <CODE>createMBean</CODE> method will
      * throw a <CODE>RuntimeErrorException</CODE>, although the MBean creation
      * and registration succeeded. In such a case, the MBean will be actually
-     * registered even though the <CODE>createMBean<CODE> method
+     * registered even though the <CODE>createMBean</CODE> method
      * threw an exception.  Note that <CODE>RuntimeErrorException</CODE> can
      * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
      * will not be registered.
@@ -297,19 +297,19 @@
      * MBean will not be registered.
      * @exception RuntimeMBeanException If the <CODE>postRegister</CODE>
      * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws a
-     * <CODE>RuntimeException</CODE>, the <CODE>createMBean<CODE> method will
+     * <CODE>RuntimeException</CODE>, the <CODE>createMBean</CODE> method will
      * throw a <CODE>RuntimeMBeanException</CODE>, although the MBean creation
      * and registration succeeded. In such a case, the MBean will be actually
-     * registered even though the <CODE>createMBean<CODE> method
+     * registered even though the <CODE>createMBean</CODE> method
      * threw an exception.  Note that <CODE>RuntimeMBeanException</CODE> can
      * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
      * will not be registered.
      * @exception RuntimeErrorException If the <CODE>postRegister</CODE> method
      * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws an
-     * <CODE>Error</CODE>, the <CODE>createMBean<CODE> method will
+     * <CODE>Error</CODE>, the <CODE>createMBean</CODE> method will
      * throw a <CODE>RuntimeErrorException</CODE>, although the MBean creation
      * and registration succeeded. In such a case, the MBean will be actually
-     * registered even though the <CODE>createMBean<CODE> method
+     * registered even though the <CODE>createMBean</CODE> method
      * threw an exception.  Note that <CODE>RuntimeErrorException</CODE> can
      * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
      * will not be registered.
@@ -351,19 +351,19 @@
      * has thrown an exception.
      * @exception RuntimeMBeanException If the <CODE>postDeregister</CODE>
      * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws a
-     * <CODE>RuntimeException</CODE>, the <CODE>unregisterMBean<CODE> method
+     * <CODE>RuntimeException</CODE>, the <CODE>unregisterMBean</CODE> method
      * will throw a <CODE>RuntimeMBeanException</CODE>, although the MBean
      * unregistration succeeded. In such a case, the MBean will be actually
-     * unregistered even though the <CODE>unregisterMBean<CODE> method
+     * unregistered even though the <CODE>unregisterMBean</CODE> method
      * threw an exception.  Note that <CODE>RuntimeMBeanException</CODE> can
      * also be thrown by <CODE>preDeregister</CODE>, in which case the MBean
      * will remain registered.
      * @exception RuntimeErrorException If the <CODE>postDeregister</CODE>
      * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws an
-     * <CODE>Error</CODE>, the <CODE>unregisterMBean<CODE> method will
+     * <CODE>Error</CODE>, the <CODE>unregisterMBean</CODE> method will
      * throw a <CODE>RuntimeErrorException</CODE>, although the MBean
      * unregistration succeeded. In such a case, the MBean will be actually
-     * unregistered even though the <CODE>unregisterMBean<CODE> method
+     * unregistered even though the <CODE>unregisterMBean</CODE> method
      * threw an exception.  Note that <CODE>RuntimeMBeanException</CODE> can
      * also be thrown by <CODE>preDeregister</CODE>, in which case the MBean
      * will remain registered.
--- a/jdk/src/share/classes/javax/management/openmbean/CompositeType.java	Mon Sep 01 17:11:58 2008 +0200
+++ b/jdk/src/share/classes/javax/management/openmbean/CompositeType.java	Tue Sep 02 14:14:05 2008 +0200
@@ -89,7 +89,7 @@
      * <br>&nbsp;
      * @param  itemNames  The names of the items contained in the
      *                    composite data values described by this <code>CompositeType</code> instance;
-     *                    cannot be null and should contain at least one element; no element can be a null or empty string.
+     *                    cannot be null; no element can be null or an empty string.
      *                    Note that the order in which the item names are given is not important to differentiate a
      *                    <code>CompositeType</code> instance from another;
      *                    the item names are internally stored sorted in ascending alphanumeric order.
@@ -97,7 +97,7 @@
      * @param  itemDescriptions  The descriptions, in the same order as <var>itemNames</var>, of the items contained in the
      *                           composite data values described by this <code>CompositeType</code> instance;
      *                           should be of the same size as <var>itemNames</var>;
-     *                           no element can be a null or empty string.
+     *                           no element can be null or an empty string.
      * <br>&nbsp;
      * @param  itemTypes  The open type instances, in the same order as <var>itemNames</var>, describing the items contained
      *                    in the composite data values described by this <code>CompositeType</code> instance;
@@ -125,7 +125,7 @@
         //
         super(CompositeData.class.getName(), typeName, description, false);
 
-        // Check the 3 arrays are not null or empty (ie length==0) and that there is no null element or empty string in them
+        // Check the 3 arrays are not null and that there is no null element or empty string in them
         //
         checkForNullElement(itemNames, "itemNames");
         checkForNullElement(itemDescriptions, "itemDescriptions");
--- a/jdk/test/javax/management/eventService/LeaseManagerDeadlockTest.java	Mon Sep 01 17:11:58 2008 +0200
+++ b/jdk/test/javax/management/eventService/LeaseManagerDeadlockTest.java	Tue Sep 02 14:14:05 2008 +0200
@@ -26,6 +26,7 @@
  * @bug 6717789
  * @summary Check that a lock is not held when a LeaseManager expires.
  * @author Eamonn McManus
+ * @compile -XDignore.symbol.file=true LeaseManagerDeadlockTest.java
  */
 
 import com.sun.jmx.event.LeaseManager;