< prev index next >
src/java.base/share/classes/java/text/NumberFormat.java
Print this page
*** 1011,1020 ****
--- 1011,1021 ----
* In addition, if any of these values is negative, then this method throws
* an <code>InvalidObjectException</code>.
*
* @since 1.2
*/
+ @java.io.Serial
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException
{
stream.defaultReadObject();
if (serialVersionOnStream < 1) {
*** 1039,1048 ****
--- 1040,1050 ----
* (or to <code>Byte.MAX_VALUE</code>, whichever is smaller), for compatibility
* with the JDK 1.1 version of the stream format.
*
* @since 1.2
*/
+ @java.io.Serial
private void writeObject(ObjectOutputStream stream)
throws IOException
{
maxIntegerDigits = (maximumIntegerDigits > Byte.MAX_VALUE) ?
Byte.MAX_VALUE : (byte)maximumIntegerDigits;
*** 1223,1232 ****
--- 1225,1235 ----
*/
private int serialVersionOnStream = currentSerialVersion;
// Removed "implements Cloneable" clause. Needs to update serialization
// ID for backward compatibility.
+ @java.io.Serial
static final long serialVersionUID = -2308460125733713944L;
//
// class for AttributedCharacterIterator attributes
*** 1240,1249 ****
--- 1243,1253 ----
* @since 1.4
*/
public static class Field extends Format.Field {
// Proclaim serial compatibility with 1.4 FCS
+ @java.io.Serial
private static final long serialVersionUID = 7494728892700160890L;
// table of all instances in this class, used by readResolve
private static final Map<String, Field> instanceMap = new HashMap<>(11);
*** 1265,1274 ****
--- 1269,1279 ----
*
* @throws InvalidObjectException if the constant could not be resolved.
* @return resolved NumberFormat.Field constant
*/
@Override
+ @java.io.Serial
protected Object readResolve() throws InvalidObjectException {
if (this.getClass() != NumberFormat.Field.class) {
throw new InvalidObjectException("subclass didn't correctly implement readResolve");
}
< prev index next >