1
1
/*
2
- * Copyright (c) 1998, 2019 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 1998, 2021 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -96,23 +96,28 @@ public String toString() {
96
96
97
97
98
98
/**
99
- * Serializable fields for UndeclaredThrowableException.
99
+ * The exception thrown by the privileged computation that resulted
100
+ * in this {@code PrivilegedActionException}.
100
101
*
101
- * @serialField undeclaredThrowable Throwable
102
+ * @serialField exception Exception the thrown Exception
102
103
*/
103
104
@ java .io .Serial
104
105
private static final ObjectStreamField [] serialPersistentFields = {
105
106
new ObjectStreamField ("exception" , Exception .class )
106
107
};
107
108
108
- /*
109
+ /**
109
110
* Reconstitutes the PrivilegedActionException instance from a stream
110
111
* and initialize the cause properly when deserializing from an older
111
112
* version.
112
113
*
113
- * The getException and getCause method returns the private "exception"
114
+ * <p> The getException and getCause method returns the private "exception"
114
115
* field in the older implementation and PrivilegedActionException::cause
115
116
* was set to null.
117
+ *
118
+ * @param s the {@code ObjectInputStream} from which data is read
119
+ * @throws IOException if an I/O error occurs
120
+ * @throws ClassNotFoundException if a serialized class cannot be loaded
116
121
*/
117
122
@ java .io .Serial
118
123
private void readObject (ObjectInputStream s ) throws IOException , ClassNotFoundException {
@@ -123,9 +128,12 @@ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundEx
123
128
}
124
129
}
125
130
126
- /*
131
+ /**
127
132
* To maintain compatibility with older implementation, write a serial
128
133
* "exception" field with the cause as the value.
134
+ *
135
+ * @param out the {@code ObjectOutputStream} to which data is written
136
+ * @throws IOException if an I/O error occurs
129
137
*/
130
138
@ java .io .Serial
131
139
private void writeObject (ObjectOutputStream out ) throws IOException {
0 commit comments