< prev index next >
src/java.base/share/classes/java/lang/Throwable.java
Print this page
@@ -112,10 +112,11 @@
* @jls 11.2 Compile-Time Checking of Exceptions
* @since 1.0
*/
public class Throwable implements Serializable {
/** use serialVersionUID from JDK 1.0.2 for interoperability */
+ @java.io.Serial
private static final long serialVersionUID = -3042686055658047285L;
/**
* The JVM saves some indication of the stack backtrace in this slot.
*/
@@ -899,10 +900,11 @@
*
* Note that there are no constraints on the value the {@code
* cause} field can hold; both {@code null} and {@code this} are
* valid values for the field.
*/
+ @java.io.Serial
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException {
s.defaultReadObject(); // read in all fields
// Set suppressed exceptions and stack trace elements fields
@@ -987,10 +989,11 @@
*
* A {@code null} stack trace field is represented in the serial
* form as a one-element array whose element is equal to {@code
* new StackTraceElement("", "", null, Integer.MIN_VALUE)}.
*/
+ @java.io.Serial
private synchronized void writeObject(ObjectOutputStream s)
throws IOException {
// Ensure that the stackTrace field is initialized to a
// non-null value, if appropriate. As of JDK 7, a null stack
// trace field is a valid value indicating the stack trace
< prev index next >