< prev index next >
src/java.base/share/classes/java/text/DateFormat.java
Print this page
@@ -296,10 +296,11 @@
* Used in FieldPosition of date/time formatting.
*/
public static final int TIMEZONE_FIELD = 17;
// Proclaim serial compatibility with 1.1 FCS
+ @java.io.Serial
private static final long serialVersionUID = 7218322306649953788L;
/**
* Formats the given {@code Object} into a date-time string. The formatted
* string is appended to the given {@code StringBuffer}.
@@ -864,10 +865,11 @@
* @see java.util.Calendar
*/
public static class Field extends Format.Field {
// Proclaim serial compatibility with 1.4 FCS
+ @java.io.Serial
private static final long serialVersionUID = 7441350119349544720L;
// table of all instances in this class, used by readResolve
private static final Map<String, Field> instanceMap = new HashMap<>(18);
// Maps from Calendar constant (such as Calendar.ERA) to Field
@@ -941,10 +943,11 @@
* @throws InvalidObjectException if the constant could not be
* resolved.
* @return resolved DateFormat.Field constant
*/
@Override
+ @java.io.Serial
protected Object readResolve() throws InvalidObjectException {
if (this.getClass() != DateFormat.Field.class) {
throw new InvalidObjectException("subclass didn't correctly implement readResolve");
}
< prev index next >