/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5056248
* @summary Test that an MBeanInfo works even if it is deserialized from
* an implementation where its array fields can be null.
* @author Eamonn McManus
* @run clean NullInfoArraysTest
* @run build NullInfoArraysTest
* @run main NullInfoArraysTest
*/
import javax.management.*;
public class NullInfoArraysTest {
else
}
byte[][] serializedMBeanInfos =
byte[] serializedMBeanInfo = serializedMBeanInfos[i];
throw new Exception("At least one getter returned null");
}
}
/* This method is intended to be invoked when constructing the
test for the first time, with JMX 1.1 RI in the classpath. It
constructs the SerializedMBeanInfo.java source file. There is
of course a chicken-and-egg problem for compiling: the first
time we built this test, we supplied a trivial
SerializedMBeanInfo.java with an empty array in the
serializedMBeanInfos field. */
w.println("// Generated by NullInfoArraysTest - do not edit");
w.println();
w.println("public class SerializedMBeanInfo {");
w.println(" public static final byte[][] serializedMBeanInfos = {");
null));
w.println(" };");
w.println("}");
w.close();
}
oos.writeObject(o);
w.print(" {");
w.print(", ");
}
w.println("},");
}
}