The fix for 6622432: RFE: Performance improvements to java.math.BigDecimal in 6u14 adds two new static fields that are only needed for deserialization. Better to initialize them lazily when needed.
private static final sun.misc.Unsafe unsafe = sun.misc.Unsafe.getUnsafe();
private static final long signumOffset;
private static final long magOffset;
static {
try {
signumOffset = unsafe.objectFieldOffset
(BigInteger.class.getDeclaredField("signum"));
magOffset = unsafe.objectFieldOffset
(BigInteger.class.getDeclaredField("mag"));
} catch (Exception ex) {
throw new Error(ex);
}
}
zeros is another static field used by the toString() method and it can also be lazily initialized.