equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
62 private static final RoundingMode DEFAULT_ROUNDINGMODE = RoundingMode.HALF_UP; |
62 private static final RoundingMode DEFAULT_ROUNDINGMODE = RoundingMode.HALF_UP; |
63 // Smallest values for digits (Maximum is Integer.MAX_VALUE) |
63 // Smallest values for digits (Maximum is Integer.MAX_VALUE) |
64 private static final int MIN_DIGITS = 0; |
64 private static final int MIN_DIGITS = 0; |
65 |
65 |
66 // Serialization version |
66 // Serialization version |
|
67 @java.io.Serial |
67 private static final long serialVersionUID = 5579720004786848255L; |
68 private static final long serialVersionUID = 5579720004786848255L; |
68 |
69 |
69 /* ----- Public Properties ----- */ |
70 /* ----- Public Properties ----- */ |
70 /** |
71 /** |
71 * A {@code MathContext} object whose settings have the values |
72 * A {@code MathContext} object whose settings have the values |
307 * Reconstitute the {@code MathContext} instance from a stream (that is, |
308 * Reconstitute the {@code MathContext} instance from a stream (that is, |
308 * deserialize it). |
309 * deserialize it). |
309 * |
310 * |
310 * @param s the stream being read. |
311 * @param s the stream being read. |
311 */ |
312 */ |
|
313 @java.io.Serial |
312 private void readObject(java.io.ObjectInputStream s) |
314 private void readObject(java.io.ObjectInputStream s) |
313 throws java.io.IOException, ClassNotFoundException { |
315 throws java.io.IOException, ClassNotFoundException { |
314 s.defaultReadObject(); // read in all fields |
316 s.defaultReadObject(); // read in all fields |
315 // validate possibly bad fields |
317 // validate possibly bad fields |
316 if (precision < MIN_DIGITS) { |
318 if (precision < MIN_DIGITS) { |