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

Print this page

        

*** 3738,3749 **** (BigDecimal.class.getDeclaredField("intVal")); } catch (Exception ex) { throw new ExceptionInInitializerError(ex); } } ! static void setIntCompactVolatile(BigDecimal bd, long val) { ! unsafe.putLongVolatile(bd, intCompactOffset, val); } static void setIntValVolatile(BigDecimal bd, BigInteger val) { unsafe.putObjectVolatile(bd, intValOffset, val); } --- 3738,3749 ---- (BigDecimal.class.getDeclaredField("intVal")); } catch (Exception ex) { throw new ExceptionInInitializerError(ex); } } ! static void setIntCompact(BigDecimal bd, long val) { ! unsafe.putLong(bd, intCompactOffset, val); } static void setIntValVolatile(BigDecimal bd, BigInteger val) { unsafe.putObjectVolatile(bd, intValOffset, val); }
*** 3763,3773 **** if (intVal == null) { String message = "BigDecimal: null intVal in stream"; throw new java.io.StreamCorruptedException(message); // [all values of scale are now allowed] } ! UnsafeHolder.setIntCompactVolatile(this, compactValFor(intVal)); } /** * Serialize this {@code BigDecimal} to the stream in question * --- 3763,3773 ---- if (intVal == null) { String message = "BigDecimal: null intVal in stream"; throw new java.io.StreamCorruptedException(message); // [all values of scale are now allowed] } ! UnsafeHolder.setIntCompact(this, compactValFor(intVal)); } /** * Serialize this {@code BigDecimal} to the stream in question *