aboutsummaryrefslogtreecommitdiff
path: root/src/java.base/share/classes/java/lang/ClassNotFoundException.java
diff options
context:
space:
mode:
authorJoe Darcy <darcy@openjdk.org>2019-08-29 16:31:34 -0700
committerJoe Darcy <darcy@openjdk.org>2019-08-29 16:31:34 -0700
commit9d764ee48ee7c2e7be7a25aee2ed7bed2fcd2000 (patch)
tree0de856dc2c4c03d6aa087666b58c34f88b8b553b /src/java.base/share/classes/java/lang/ClassNotFoundException.java
parent6d064a747e3d35cc51d0b57800ea0544f0545ca3 (diff)
downloadopenjdk-9d764ee48ee7c2e7be7a25aee2ed7bed2fcd2000.tar.gz
openjdk-9d764ee48ee7c2e7be7a25aee2ed7bed2fcd2000.zip
8229997: Apply java.io.Serial annotations in java.base
Reviewed-by: alanb, rriggs
Diffstat (limited to 'src/java.base/share/classes/java/lang/ClassNotFoundException.java')
-rw-r--r--src/java.base/share/classes/java/lang/ClassNotFoundException.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/java.base/share/classes/java/lang/ClassNotFoundException.java b/src/java.base/share/classes/java/lang/ClassNotFoundException.java
index b9695bbd7e4..a833efe8f7d 100644
--- a/src/java.base/share/classes/java/lang/ClassNotFoundException.java
+++ b/src/java.base/share/classes/java/lang/ClassNotFoundException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -59,6 +59,7 @@ public class ClassNotFoundException extends ReflectiveOperationException {
/**
* use serialVersionUID from JDK 1.1.X for interoperability
*/
+ @java.io.Serial
private static final long serialVersionUID = 9176873029745254542L;
/**
@@ -111,6 +112,7 @@ public class ClassNotFoundException extends ReflectiveOperationException {
*
* @serialField ex Throwable
*/
+ @java.io.Serial
private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("ex", Throwable.class)
};
@@ -124,6 +126,7 @@ public class ClassNotFoundException extends ReflectiveOperationException {
* in the older implementation and ClassNotFoundException::cause
* was set to null.
*/
+ @java.io.Serial
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
ObjectInputStream.GetField fields = s.readFields();
Throwable exception = (Throwable) fields.get("ex", null);
@@ -136,6 +139,7 @@ public class ClassNotFoundException extends ReflectiveOperationException {
* To maintain compatibility with older implementation, write a serial
* "ex" field with the cause as the value.
*/
+ @java.io.Serial
private void writeObject(ObjectOutputStream out) throws IOException {
ObjectOutputStream.PutField fields = out.putFields();
fields.put("ex", super.getCause());