equal
deleted
inserted
replaced
1011 * In addition, if any of these values is negative, then this method throws |
1011 * In addition, if any of these values is negative, then this method throws |
1012 * an <code>InvalidObjectException</code>. |
1012 * an <code>InvalidObjectException</code>. |
1013 * |
1013 * |
1014 * @since 1.2 |
1014 * @since 1.2 |
1015 */ |
1015 */ |
|
1016 @java.io.Serial |
1016 private void readObject(ObjectInputStream stream) |
1017 private void readObject(ObjectInputStream stream) |
1017 throws IOException, ClassNotFoundException |
1018 throws IOException, ClassNotFoundException |
1018 { |
1019 { |
1019 stream.defaultReadObject(); |
1020 stream.defaultReadObject(); |
1020 if (serialVersionOnStream < 1) { |
1021 if (serialVersionOnStream < 1) { |
1039 * (or to <code>Byte.MAX_VALUE</code>, whichever is smaller), for compatibility |
1040 * (or to <code>Byte.MAX_VALUE</code>, whichever is smaller), for compatibility |
1040 * with the JDK 1.1 version of the stream format. |
1041 * with the JDK 1.1 version of the stream format. |
1041 * |
1042 * |
1042 * @since 1.2 |
1043 * @since 1.2 |
1043 */ |
1044 */ |
|
1045 @java.io.Serial |
1044 private void writeObject(ObjectOutputStream stream) |
1046 private void writeObject(ObjectOutputStream stream) |
1045 throws IOException |
1047 throws IOException |
1046 { |
1048 { |
1047 maxIntegerDigits = (maximumIntegerDigits > Byte.MAX_VALUE) ? |
1049 maxIntegerDigits = (maximumIntegerDigits > Byte.MAX_VALUE) ? |
1048 Byte.MAX_VALUE : (byte)maximumIntegerDigits; |
1050 Byte.MAX_VALUE : (byte)maximumIntegerDigits; |
1223 */ |
1225 */ |
1224 private int serialVersionOnStream = currentSerialVersion; |
1226 private int serialVersionOnStream = currentSerialVersion; |
1225 |
1227 |
1226 // Removed "implements Cloneable" clause. Needs to update serialization |
1228 // Removed "implements Cloneable" clause. Needs to update serialization |
1227 // ID for backward compatibility. |
1229 // ID for backward compatibility. |
|
1230 @java.io.Serial |
1228 static final long serialVersionUID = -2308460125733713944L; |
1231 static final long serialVersionUID = -2308460125733713944L; |
1229 |
1232 |
1230 |
1233 |
1231 // |
1234 // |
1232 // class for AttributedCharacterIterator attributes |
1235 // class for AttributedCharacterIterator attributes |
1240 * @since 1.4 |
1243 * @since 1.4 |
1241 */ |
1244 */ |
1242 public static class Field extends Format.Field { |
1245 public static class Field extends Format.Field { |
1243 |
1246 |
1244 // Proclaim serial compatibility with 1.4 FCS |
1247 // Proclaim serial compatibility with 1.4 FCS |
|
1248 @java.io.Serial |
1245 private static final long serialVersionUID = 7494728892700160890L; |
1249 private static final long serialVersionUID = 7494728892700160890L; |
1246 |
1250 |
1247 // table of all instances in this class, used by readResolve |
1251 // table of all instances in this class, used by readResolve |
1248 private static final Map<String, Field> instanceMap = new HashMap<>(11); |
1252 private static final Map<String, Field> instanceMap = new HashMap<>(11); |
1249 |
1253 |
1265 * |
1269 * |
1266 * @throws InvalidObjectException if the constant could not be resolved. |
1270 * @throws InvalidObjectException if the constant could not be resolved. |
1267 * @return resolved NumberFormat.Field constant |
1271 * @return resolved NumberFormat.Field constant |
1268 */ |
1272 */ |
1269 @Override |
1273 @Override |
|
1274 @java.io.Serial |
1270 protected Object readResolve() throws InvalidObjectException { |
1275 protected Object readResolve() throws InvalidObjectException { |
1271 if (this.getClass() != NumberFormat.Field.class) { |
1276 if (this.getClass() != NumberFormat.Field.class) { |
1272 throw new InvalidObjectException("subclass didn't correctly implement readResolve"); |
1277 throw new InvalidObjectException("subclass didn't correctly implement readResolve"); |
1273 } |
1278 } |
1274 |
1279 |