1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# HG changeset patch
# User jbachorik
# Date 1374244166 -7200
# Fri Jul 19 16:29:26 2013 +0200
# Node ID 42cdf6988c2b81b322bf89778ddeb47265cd3bba
# Parent a8132d72370c1f2467c9bb966d9355b387c35039
8019584: javax/management/remote/mandatory/loading/MissingClassTest.java failed in nightly against jdk7u45: java.io.InvalidObjectException: Invalid notification: null
Reviewed-by: mchung, sjiang, dfuchs, ahgross
diff -r a8132d72370c -r 42cdf6988c2b src/share/classes/javax/management/remote/NotificationResult.java
--- jdk/src/share/classes/javax/management/remote/NotificationResult.java Mon Jul 15 16:00:57 2013 +0100
+++ jdk/src/share/classes/javax/management/remote/NotificationResult.java Fri Jul 19 16:29:26 2013 +0200
@@ -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());
}
diff -r a8132d72370c -r 42cdf6988c2b src/share/classes/javax/management/remote/TargetedNotification.java
--- jdk/src/share/classes/javax/management/remote/TargetedNotification.java Mon Jul 15 16:00:57 2013 +0100
+++ jdk/src/share/classes/javax/management/remote/TargetedNotification.java Fri Jul 19 16:29:26 2013 +0200
@@ -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());
}
diff -r a8132d72370c -r 42cdf6988c2b test/javax/management/remote/mandatory/loading/MissingClassTest.java
--- jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java Mon Jul 15 16:00:57 2013 +0100
+++ jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java Fri Jul 19 16:29:26 2013 +0200
@@ -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
|