Makefile.am: Added locale files from Classpath.
* Makefile.am: Added locale files from Classpath. * Makefile.in: Rebuilt. * gnu/java/locale/Calendar.java: New file. * gnu/java/locale/Calendar_de.java: New file. * gnu/java/locale/Calendar_en.java: New file. * gnu/java/locale/Calendar_nl.java: New file. * java/lang/ClassNotFoundException.java: Replaced with Classpath file. * java/math/BigDecimal.java (intVal): Renamed from 'num' for serialization compatibility. (scale): Made private. (serialVersionUID): New field. * java/math/BigInteger.java (ival): Made transient. (words): Made transient. (bitCount): New serialization field. (bitLength): Ditto. (firstNonzeroByteNum): Ditto. (lowestSetBit): Ditto. (magnitude): Ditto. (signum): Ditto. (serialVersionUID): New field. (readObject): New method. (writeObject): New method. * java/util/BitSet.java (serialVersionUID): New field. * java/util/Calendar.java: Replaced with Classpath file. * java/util/GregorianCalendar.java (GregorianCalendar): Pass result of getDefault() for TimeZone or Locale instead of passing nulls. * java/util/Locale.java (serialVersionUID): New field. (writeObject): New method. (readObject): New method. * java/util/SimpleTimeZone.java: Replaced with Classpath file. Serialization mods. From-SVN: r37080
This commit is contained in:
parent
c11a03240f
commit
df98a50bb0
15 changed files with 2277 additions and 453 deletions
|
@ -11,6 +11,9 @@ details. */
|
|||
package java.math;
|
||||
import gnu.gcj.math.*;
|
||||
import java.util.Random;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author Warren Levy <warrenl@cygnus.com>
|
||||
|
@ -35,8 +38,17 @@ public class BigInteger extends Number implements Comparable
|
|||
* If words == null, the ival is the value of this BigInteger.
|
||||
* Otherwise, the first ival elements of words make the value
|
||||
* of this BigInteger, stored in little-endian order, 2's-complement form. */
|
||||
private int ival;
|
||||
private int[] words;
|
||||
transient private int ival;
|
||||
transient private int[] words;
|
||||
|
||||
// Serialization fields.
|
||||
private int bitCount = -1;
|
||||
private int bitLength = -1;
|
||||
private int firstNonzeroByteNum = -2;
|
||||
private int lowestSetBit = -2;
|
||||
private byte[] magnitude;
|
||||
private int signum;
|
||||
private static final long serialVersionUID = -8287574255936472291L;
|
||||
|
||||
|
||||
/** We pre-allocate integers in the range minFixNum..maxFixNum. */
|
||||
|
@ -2201,4 +2213,22 @@ public class BigInteger extends Number implements Comparable
|
|||
}
|
||||
return isNegative() ? x_len * 32 - i : i;
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream s)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
s.defaultReadObject();
|
||||
words = byteArrayToIntArray(magnitude, signum < 0 ? -1 : 0);
|
||||
BigInteger result = make(words, words.length);
|
||||
this.ival = result.ival;
|
||||
this.words = result.words;
|
||||
}
|
||||
|
||||
private void writeObject(ObjectOutputStream s)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
signum = signum();
|
||||
magnitude = toByteArray();
|
||||
s.defaultWriteObject();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue