src/java.base/share/classes/java/lang/ClassNotFoundException.java
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 51772 5432cebf6627
child 58679 9c3209ff7550
--- a/src/java.base/share/classes/java/lang/ClassNotFoundException.java	Thu Oct 17 20:27:44 2019 +0100
+++ b/src/java.base/share/classes/java/lang/ClassNotFoundException.java	Thu Oct 17 20:53:35 2019 +0100
@@ -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
@@ -34,10 +34,10 @@
  * Thrown when an application tries to load in a class through its
  * string name using:
  * <ul>
- * <li>The <code>forName</code> method in class <code>Class</code>.
- * <li>The <code>findSystemClass</code> method in class
- *     <code>ClassLoader</code> .
- * <li>The <code>loadClass</code> method in class <code>ClassLoader</code>.
+ * <li>The {@code forName} method in class {@code Class}.
+ * <li>The {@code findSystemClass} method in class
+ *     {@code ClassLoader} .
+ * <li>The {@code loadClass} method in class {@code ClassLoader}.
  * </ul>
  * <p>
  * but no definition for the class with the specified name could be found.
@@ -59,17 +59,18 @@
     /**
      * use serialVersionUID from JDK 1.1.X for interoperability
      */
+     @java.io.Serial
      private static final long serialVersionUID = 9176873029745254542L;
 
     /**
-     * Constructs a <code>ClassNotFoundException</code> with no detail message.
+     * Constructs a {@code ClassNotFoundException} with no detail message.
      */
     public ClassNotFoundException() {
         super((Throwable)null);  // Disallow initCause
     }
 
     /**
-     * Constructs a <code>ClassNotFoundException</code> with the
+     * Constructs a {@code ClassNotFoundException} with the
      * specified detail message.
      *
      * @param   s   the detail message.
@@ -79,7 +80,7 @@
     }
 
     /**
-     * Constructs a <code>ClassNotFoundException</code> with the
+     * Constructs a {@code ClassNotFoundException} with the
      * specified detail message and optional exception that was
      * raised while loading the class.
      *
@@ -99,7 +100,7 @@
      * The {@link Throwable#getCause()} method is now the preferred means of
      * obtaining this information.
      *
-     * @return the <code>Exception</code> that was raised while loading a class
+     * @return the {@code Exception} that was raised while loading a class
      * @since 1.2
      */
     public Throwable getException() {
@@ -111,6 +112,7 @@
      *
      * @serialField ex Throwable
      */
+    @java.io.Serial
     private static final ObjectStreamField[] serialPersistentFields = {
         new ObjectStreamField("ex", Throwable.class)
     };
@@ -124,6 +126,7 @@
      * 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 @@
      * 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());