8229997: Apply java.io.Serial annotations in java.base

Reviewed-by: alanb, rriggs
This commit is contained in:
Joe Darcy 2019-08-29 16:31:34 -07:00
parent 6d064a747e
commit 9d764ee48e
315 changed files with 880 additions and 254 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -479,6 +479,7 @@ public abstract class Clock {
* {@link System#currentTimeMillis()}.
*/
static final class SystemClock extends Clock implements Serializable {
@java.io.Serial
private static final long serialVersionUID = 6740630888130243051L;
private static final long OFFSET_SEED =
System.currentTimeMillis()/1000 - 1024; // initial offest
@ -572,6 +573,7 @@ public abstract class Clock {
public String toString() {
return "SystemClock[" + zone + "]";
}
@java.io.Serial
private void readObject(ObjectInputStream is)
throws IOException, ClassNotFoundException {
// ensure that offset is initialized
@ -586,6 +588,7 @@ public abstract class Clock {
* This is typically used for testing.
*/
static final class FixedClock extends Clock implements Serializable {
@java.io.Serial
private static final long serialVersionUID = 7430389292664866958L;
private final Instant instant;
private final ZoneId zone;
@ -636,6 +639,7 @@ public abstract class Clock {
* Implementation of a clock that adds an offset to an underlying clock.
*/
static final class OffsetClock extends Clock implements Serializable {
@java.io.Serial
private static final long serialVersionUID = 2007484719125426256L;
private final Clock baseClock;
private final Duration offset;
@ -686,6 +690,7 @@ public abstract class Clock {
* Implementation of a clock that adds an offset to an underlying clock.
*/
static final class TickClock extends Clock implements Serializable {
@java.io.Serial
private static final long serialVersionUID = 6504659149906368850L;
private final Clock baseClock;
private final long tickNanos;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -77,6 +77,7 @@ public class DateTimeException extends RuntimeException {
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -1632418723876261839L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -140,6 +140,7 @@ public final class Duration
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 3078945930695997490L;
/**
* Constant for nanos per second.
@ -1529,6 +1530,7 @@ public final class Duration
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.DURATION_TYPE, this);
}
@ -1539,6 +1541,7 @@ public final class Duration
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -245,6 +245,7 @@ public final class Instant
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -665713676816604388L;
/**
@ -1342,6 +1343,7 @@ public final class Instant
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.INSTANT_TYPE, this);
}
@ -1352,6 +1354,7 @@ public final class Instant
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -157,6 +157,7 @@ public final class LocalDate
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 2942565459149668126L;
/**
* The number of days in a 400 year cycle.
@ -2200,6 +2201,7 @@ public final class LocalDate
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.LOCAL_DATE_TYPE, this);
}
@ -2210,6 +2212,7 @@ public final class LocalDate
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -153,6 +153,7 @@ public final class LocalDateTime
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 6207766400415563566L;
/**
@ -1985,6 +1986,7 @@ public final class LocalDateTime
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.LOCAL_DATE_TIME_TYPE, this);
}
@ -1995,6 +1997,7 @@ public final class LocalDateTime
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -213,6 +213,7 @@ public final class LocalTime
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 6414437269572265201L;
/**
@ -1674,6 +1675,7 @@ public final class LocalTime
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.LOCAL_TIME_TYPE, this);
}
@ -1684,6 +1686,7 @@ public final class LocalTime
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -130,6 +130,7 @@ public final class MonthDay
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -939150713474957432L;
/**
* Parser.
@ -764,6 +765,7 @@ public final class MonthDay
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.MONTH_DAY_TYPE, this);
}
@ -774,6 +776,7 @@ public final class MonthDay
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -184,6 +184,7 @@ public final class OffsetDateTime
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 2287754244819255394L;
/**
@ -1931,6 +1932,7 @@ public final class OffsetDateTime
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.OFFSET_DATE_TIME_TYPE, this);
}
@ -1941,6 +1943,7 @@ public final class OffsetDateTime
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -138,6 +138,7 @@ public final class OffsetTime
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 7264499704384272492L;
/**
@ -1410,6 +1411,7 @@ public final class OffsetTime
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.OFFSET_TIME_TYPE, this);
}
@ -1420,6 +1422,7 @@ public final class OffsetTime
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -140,6 +140,7 @@ public final class Period
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -3587258372562876L;
/**
* The pattern for parsing.
@ -1052,6 +1053,7 @@ public final class Period
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.PERIOD_TYPE, this);
}
@ -1062,6 +1064,7 @@ public final class Period
* @param s the stream to read
* @throws java.io.InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -91,6 +91,7 @@ final class Ser implements Externalizable {
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -7683839454370182990L;
static final byte DURATION_TYPE = 1;
@ -277,6 +278,7 @@ final class Ser implements Externalizable {
*
* @return the read object, should never be null
*/
@java.io.Serial
private Object readResolve() {
return object;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -147,6 +147,7 @@ public final class Year
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -23038383694477807L;
/**
* Parser.
@ -1097,6 +1098,7 @@ public final class Year
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.YEAR_TYPE, this);
}
@ -1107,6 +1109,7 @@ public final class Year
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -134,6 +134,7 @@ public final class YearMonth
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 4183400860270640070L;
/**
* Parser.
@ -1222,6 +1223,7 @@ public final class YearMonth
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.YEAR_MONTH_TYPE, this);
}
@ -1232,6 +1234,7 @@ public final class YearMonth
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -254,6 +254,7 @@ public abstract class ZoneId implements Serializable {
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 8352817235686L;
//-----------------------------------------------------------------------
@ -624,6 +625,7 @@ public abstract class ZoneId implements Serializable {
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
@ -655,6 +657,7 @@ public abstract class ZoneId implements Serializable {
* @return the instance of {@code Ser}, not null
*/
// this is here for serialization Javadoc
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.ZONE_REGION_TYPE, this);
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -143,6 +143,7 @@ public final class ZoneOffset
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 2357656521762053153L;
/**
@ -763,6 +764,7 @@ public final class ZoneOffset
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.ZONE_OFFSET_TYPE, this);
}
@ -773,6 +775,7 @@ public final class ZoneOffset
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -92,6 +92,7 @@ final class ZoneRegion extends ZoneId implements Serializable {
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 8386373296231747096L;
/**
* The time-zone ID, not null.
@ -189,6 +190,7 @@ final class ZoneRegion extends ZoneId implements Serializable {
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.ZONE_REGION_TYPE, this);
}
@ -199,6 +201,7 @@ final class ZoneRegion extends ZoneId implements Serializable {
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -167,6 +167,7 @@ public final class ZonedDateTime
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -6260982410461394882L;
/**
@ -2241,6 +2242,7 @@ public final class ZonedDateTime
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.ZONE_DATE_TIME_TYPE, this);
}
@ -2251,6 +2253,7 @@ public final class ZonedDateTime
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -729,6 +729,7 @@ public abstract class AbstractChronology implements Chronology {
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
Object writeReplace() {
return new Ser(Ser.CHRONO_TYPE, this);
}
@ -739,6 +740,7 @@ public abstract class AbstractChronology implements Chronology {
* @param s the stream to read
* @throws java.io.InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws ObjectStreamException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -146,6 +146,7 @@ abstract class ChronoLocalDateImpl<D extends ChronoLocalDate>
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 6282433883239719096L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -103,6 +103,7 @@ final class ChronoLocalDateTimeImpl<D extends ChronoLocalDate>
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 4556003607393004514L;
/**
* Hours per day.
@ -409,6 +410,7 @@ final class ChronoLocalDateTimeImpl<D extends ChronoLocalDate>
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.CHRONO_LOCAL_DATE_TIME_TYPE, this);
}
@ -419,6 +421,7 @@ final class ChronoLocalDateTimeImpl<D extends ChronoLocalDate>
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 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
@ -98,6 +98,7 @@ final class ChronoPeriodImpl
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 57387258289L;
/**
@ -366,6 +367,7 @@ final class ChronoPeriodImpl
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
protected Object writeReplace() {
return new Ser(Ser.CHRONO_PERIOD_TYPE, this);
}
@ -376,6 +378,7 @@ final class ChronoPeriodImpl
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws ObjectStreamException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -107,6 +107,7 @@ final class ChronoZonedDateTimeImpl<D extends ChronoLocalDate>
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -5261813987200935591L;
/**
@ -333,6 +334,7 @@ final class ChronoZonedDateTimeImpl<D extends ChronoLocalDate>
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.CHRONO_ZONE_DATE_TIME_TYPE, this);
}
@ -343,6 +345,7 @@ final class ChronoZonedDateTimeImpl<D extends ChronoLocalDate>
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -205,6 +205,7 @@ public final class HijrahChronology extends AbstractChronology implements Serial
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 3127340209035924785L;
/**
* Singleton instance of the Islamic Umm Al-Qura calendar of Saudi Arabia.
@ -1021,6 +1022,7 @@ public final class HijrahChronology extends AbstractChronology implements Serial
* @return the instance of {@code Ser}, not null
*/
@Override
@java.io.Serial
Object writeReplace() {
return super.writeReplace();
}
@ -1031,6 +1033,7 @@ public final class HijrahChronology extends AbstractChronology implements Serial
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -123,6 +123,7 @@ public final class HijrahDate
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -5207853542612002020L;
/**
* The Chronology of this HijrahDate.
@ -657,6 +658,7 @@ public final class HijrahDate
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
@ -675,6 +677,7 @@ public final class HijrahDate
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.HIJRAH_DATE_TYPE, this);
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -133,6 +133,7 @@ public final class IsoChronology extends AbstractChronology implements Serializa
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -1440403870442975015L;
private static final long DAYS_0000_TO_1970 = (146097 * 5L) - (30L * 365L + 7L); // taken from LocalDate
@ -689,6 +690,7 @@ public final class IsoChronology extends AbstractChronology implements Serializa
* @return the instance of {@code Ser}, not null
*/
@Override
@java.io.Serial
Object writeReplace() {
return super.writeReplace();
}
@ -699,6 +701,7 @@ public final class IsoChronology extends AbstractChronology implements Serializa
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -135,6 +135,7 @@ public final class JapaneseChronology extends AbstractChronology implements Seri
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 459996390165777884L;
//-----------------------------------------------------------------------
@ -516,6 +517,7 @@ public final class JapaneseChronology extends AbstractChronology implements Seri
* @return the instance of {@code Ser}, not null
*/
@Override
@java.io.Serial
Object writeReplace() {
return super.writeReplace();
}
@ -526,6 +528,7 @@ public final class JapaneseChronology extends AbstractChronology implements Seri
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -130,6 +130,7 @@ public final class JapaneseDate
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -305327627230580483L;
/**
@ -719,6 +720,7 @@ public final class JapaneseDate
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
@ -736,6 +738,7 @@ public final class JapaneseDate
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.JAPANESE_DATE_TYPE, this);
}

View file

@ -166,6 +166,7 @@ public final class JapaneseEra
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 1466499369062886794L;
// array for the singleton JapaneseEra instances
@ -426,6 +427,7 @@ public final class JapaneseEra
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
@ -442,6 +444,7 @@ public final class JapaneseEra
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.JAPANESE_ERA_TYPE, this);
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -114,6 +114,7 @@ public final class MinguoChronology extends AbstractChronology implements Serial
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 1039765215346859963L;
/**
* The difference in years between ISO and Minguo.
@ -347,6 +348,7 @@ public final class MinguoChronology extends AbstractChronology implements Serial
* @return the instance of {@code Ser}, not null
*/
@Override
@java.io.Serial
Object writeReplace() {
return super.writeReplace();
}
@ -357,6 +359,7 @@ public final class MinguoChronology extends AbstractChronology implements Serial
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -110,6 +110,7 @@ public final class MinguoDate
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 1300372329181994526L;
/**
@ -481,6 +482,7 @@ public final class MinguoDate
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
@ -498,6 +500,7 @@ public final class MinguoDate
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.MINGUO_DATE_TYPE, this);
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -94,6 +94,7 @@ final class Ser implements Externalizable {
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -6103370247208168577L;
static final byte CHRONO_TYPE = 1;
@ -249,6 +250,7 @@ final class Ser implements Externalizable {
*
* @return the read object, should never be null
*/
@java.io.Serial
private Object readResolve() {
return object;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -116,6 +116,7 @@ public final class ThaiBuddhistChronology extends AbstractChronology implements
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 2775954514031616474L;
/**
* Containing the offset to add to the ISO year.
@ -384,6 +385,7 @@ public final class ThaiBuddhistChronology extends AbstractChronology implements
* @return the instance of {@code Ser}, not null
*/
@Override
@java.io.Serial
Object writeReplace() {
return super.writeReplace();
}
@ -394,6 +396,7 @@ public final class ThaiBuddhistChronology extends AbstractChronology implements
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -110,6 +110,7 @@ public final class ThaiBuddhistDate
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -8722293800195731463L;
/**
@ -481,6 +482,7 @@ public final class ThaiBuddhistDate
* @param s the stream to read
* @throws InvalidObjectException always
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
@ -498,6 +500,7 @@ public final class ThaiBuddhistDate
*
* @return the instance of {@code Ser}, not null
*/
@java.io.Serial
private Object writeReplace() {
return new Ser(Ser.THAIBUDDHIST_DATE_TYPE, this);
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -78,6 +78,7 @@ public class DateTimeParseException extends DateTimeException {
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = 4304633501674722597L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 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
@ -77,6 +77,7 @@ public class UnsupportedTemporalTypeException extends DateTimeException {
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -6158898438688206006L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -92,6 +92,7 @@ public final class ValueRange implements Serializable {
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -7317881728594519368L;
/**
@ -352,6 +353,7 @@ public final class ValueRange implements Serializable {
* or the largest minimum is greater than the largest maximum
* @throws ClassNotFoundException if a class cannot be resolved
*/
@java.io.Serial
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException, InvalidObjectException
{

View file

@ -242,6 +242,7 @@ public final class WeekFields implements Serializable {
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -1177360819670808121L;
/**
@ -362,6 +363,7 @@ public final class WeekFields implements Serializable {
* value for firstDayOfWeek or minimalDays.
* @throws ClassNotFoundException if a class cannot be resolved
*/
@java.io.Serial
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException, InvalidObjectException
{
@ -382,6 +384,7 @@ public final class WeekFields implements Serializable {
* @throws InvalidObjectException if the serialized object has invalid
* values for firstDayOfWeek or minimalDays.
*/
@java.io.Serial
private Object readResolve() throws InvalidObjectException {
try {
return WeekFields.of(firstDayOfWeek, minimalDays);