提交 234e6e30 编写于 作者: C chegar

Merge

......@@ -210,11 +210,6 @@ public class MBeanNotificationInfo extends MBeanFeatureInfo implements Cloneable
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;
}
}
......@@ -132,16 +132,17 @@ public class NotificationResult implements Serializable {
}
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());
}
......
......@@ -132,13 +132,9 @@ public class TargetedNotification implements Serializable {
// }
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());
}
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册