JDK 12 RFR of JDK-8207751: Remove misleading serialVersionUID from JulienFields.Field
lance.andersen at oracle.com
Tue Jul 17 23:25:28 UTC 2018
I assume we do not need to add a specific test for this clean-up?
> On Jul 17, 2018, at 7:19 PM, joe darcy <joe.darcy at oracle.com> wrote:
> The nested enum java.time.temporal.JulianFields.Field declare a serialVersionUID field. Per the serialization spec, a serialVersionUID field in an enum is ignored.
> "The process by which enum constants are serialized cannot be customized: any class-specific writeObject, readObject, readObjectNoData, writeReplace, and readResolve methods defined by enum types are ignored during serialization and deserialization. Similarly, any serialPersistentFields or serialVersionUID field declarations are also ignored--all enum types have a fixed serialVersionUID of 0L. Documenting serializable fields and data for enum types is unnecessary, since there is no variation in the type of data sent."
> Therefore, this misleading field should be deleted; please review the patch below which does this.
> --- a/src/java.base/share/classes/java/time/temporal/JulianFields.java Tue Jul 17 17:14:03 2018 -0400
> +++ b/src/java.base/share/classes/java/time/temporal/JulianFields.java Tue Jul 17 16:07:22 2018 -0700
> @@ -222,8 +222,6 @@
> MODIFIED_JULIAN_DAY("ModifiedJulianDay", DAYS, FOREVER, 40587L),
> RATA_DIE("RataDie", DAYS, FOREVER, 719163L);
> - private static final long serialVersionUID = -7501623920830201812L;
> private final transient String name;
> private final transient TemporalUnit baseUnit;
> private final transient TemporalUnit rangeUnit;
<http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
Lance.Andersen at oracle.com <mailto:Lance.Andersen at oracle.com>
More information about the core-libs-dev