--- a/jdk/src/share/classes/javax/management/MBeanNotificationInfo.java Thu Jul 25 19:03:29 2013 +0100
+++ b/jdk/src/share/classes/javax/management/MBeanNotificationInfo.java Mon Jul 29 14:58:48 2013 +0100
@@ -210,11 +210,6 @@
ObjectInputStream.GetField gf = ois.readFields();
String[] t = (String[])gf.get("types", null);
- if (t == null) {
- throw new InvalidObjectException("Trying to deserialize an invalid " +
- "instance of " + MBeanNotificationInfo.class +
- "[types=null]");
- }
- types = t.length == 0 ? t : t.clone();
+ types = (t != null && t.length != 0) ? t.clone() : NO_TYPES;
}
}
--- a/jdk/src/share/classes/javax/management/remote/NotificationResult.java Thu Jul 25 19:03:29 2013 +0100
+++ b/jdk/src/share/classes/javax/management/remote/NotificationResult.java Mon Jul 29 14:58:48 2013 +0100
@@ -132,16 +132,17 @@
}
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
- ObjectInputStream.GetField gf = ois.readFields();
- TargetedNotification[] tNotifs = (TargetedNotification[])gf.get("targetedNotifications", null);
- long snStart = gf.get("earliestSequenceNumber", -1L);
- long snNext = gf.get("nextSequenceNumber", -1L);
+ ois.defaultReadObject();
try {
- validate(tNotifs, snStart, snNext);
+ validate(
+ this.targetedNotifications,
+ this.earliestSequenceNumber,
+ this.nextSequenceNumber
+ );
- this.targetedNotifications = tNotifs.length == 0 ? tNotifs : tNotifs.clone();
- this.earliestSequenceNumber = snStart;
- this.nextSequenceNumber = snNext;
+ this.targetedNotifications = this.targetedNotifications.length == 0 ?
+ this.targetedNotifications :
+ this.targetedNotifications.clone();
} catch (IllegalArgumentException e) {
throw new InvalidObjectException(e.getMessage());
}
--- a/jdk/src/share/classes/javax/management/remote/TargetedNotification.java Thu Jul 25 19:03:29 2013 +0100
+++ b/jdk/src/share/classes/javax/management/remote/TargetedNotification.java Mon Jul 29 14:58:48 2013 +0100
@@ -132,13 +132,9 @@
// }
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
- ObjectInputStream.GetField gf = ois.readFields();
- Notification notification = (Notification)gf.get("notif", null);
- Integer listenerId = (Integer)gf.get("id", null);
+ ois.defaultReadObject();
try {
- validate(notification, listenerId);
- this.notif = notification;
- this.id = listenerId;
+ validate(this.notif, this.id);
} catch (IllegalArgumentException e) {
throw new InvalidObjectException(e.getMessage());
}
--- a/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java Thu Jul 25 19:03:29 2013 +0100
+++ b/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java Mon Jul 29 14:58:48 2013 +0100
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4915825 4921009 4934965 4977469
+ * @bug 4915825 4921009 4934965 4977469 8019584
* @summary Tests behavior when client or server gets object of unknown class
* @author Eamonn McManus
* @run clean MissingClassTest SingleClassLoader