The change looks good to me Joe. 

Thanks for adding the catch-all clause. This will cover the “bad” record class 
file, where the canonical constructor is not present.

-Chris.

> On 26 Nov 2019, at 01:46, Joe Darcy <joe.da...@oracle.com> wrote:
> 
> 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
> 

Reply via email to