src/java.base/share/classes/java/math/BigDecimal.java

Print this page
rev 12972 : 8140606: Update library code to use internal Unsafe
Reviewed-by: duke

*** 3724,3739 **** val[1] = val[1].setScale(val[0].scale, ROUND_UNNECESSARY); } } private static class UnsafeHolder { ! private static final sun.misc.Unsafe unsafe; private static final long intCompactOffset; private static final long intValOffset; static { try { ! unsafe = sun.misc.Unsafe.getUnsafe(); intCompactOffset = unsafe.objectFieldOffset (BigDecimal.class.getDeclaredField("intCompact")); intValOffset = unsafe.objectFieldOffset (BigDecimal.class.getDeclaredField("intVal")); } catch (Exception ex) { --- 3724,3739 ---- val[1] = val[1].setScale(val[0].scale, ROUND_UNNECESSARY); } } private static class UnsafeHolder { ! private static final jdk.internal.misc.Unsafe unsafe; private static final long intCompactOffset; private static final long intValOffset; static { try { ! unsafe = jdk.internal.misc.Unsafe.getUnsafe(); intCompactOffset = unsafe.objectFieldOffset (BigDecimal.class.getDeclaredField("intCompact")); intValOffset = unsafe.objectFieldOffset (BigDecimal.class.getDeclaredField("intVal")); } catch (Exception ex) {