8234381: API docs should mention special handling of enums in serialization

Reviewed-by: rriggs
This commit is contained in:
Joe Darcy 2019-11-19 16:26:58 -08:00
parent d5b423d17c
commit 8534e920b1
2 changed files with 15 additions and 2 deletions

View file

@ -47,6 +47,13 @@ import static java.util.Objects.requireNonNull;
* found in section 8.9 of
* <cite>The Java&trade; Language Specification</cite>.
*
* Enumeration types are all serializable and receive special handling
* by the serialization mechanism. The serialized representation used
* for enum constants cannot be customized. Declarations of methods
* and fields that would otherwise interact with serialization are
* ignored, including {@code serialVersionUID}; see the <cite>Java
* Object Serialization Specification</cite> for details.
*
* <p> Note that when using an enumeration type as the type of a set
* or as the type of the keys in a map, specialized and efficient
* {@linkplain java.util.EnumSet set} and {@linkplain