JDK 14 RFR of JDK-8234781: Update description of InvalidClassException to include more conditions

Joe Darcy joe.darcy at oracle.com
Tue Nov 26 01:46:28 UTC 2019


Hello,

Noticed in the context of doing some other reviews, the spec for the 
serialization exception InvalidClassException does not have an 
exhaustive and up-date-date listing of the conditions where the 
exception in thrown:

     JDK-8234781: Update description of InvalidClassException to include 
more conditions

Please review the patch below to include the missing condition and add a 
catch-all clause to implicitly cover any future changes to the 
serialization spec (correct by default, event if not as precise as 
possible). This would not preclude making more precise updates of course.

Thanks,

-Joe

diff -r a74627659f96 
src/java.base/share/classes/java/io/InvalidClassException.java
--- a/src/java.base/share/classes/java/io/InvalidClassException.java Mon 
Nov 25 15:00:32 2019 +0100
+++ b/src/java.base/share/classes/java/io/InvalidClassException.java Mon 
Nov 25 17:31:51 2019 -0800
@@ -33,6 +33,10 @@
   *      descriptor read from the stream
   * <LI> The class contains unknown datatypes
   * <LI> The class does not have an accessible no-arg constructor
+ * <LI> The ObjectStreamClass of an enum constant does not represent
+ * an enum type
+ * <LI> Other conditions given in the <cite>Java Object Serialization
+ * Specification</cite>
   * </UL>
   *
   * @author  unascribed



More information about the core-libs-dev mailing list