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

Print this page

        

@@ -3738,12 +3738,12 @@
                     (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 setIntCompact(BigDecimal bd, long val) {
+            unsafe.putLong(bd, intCompactOffset, val);
         }
 
         static void setIntValVolatile(BigDecimal bd, BigInteger val) {
             unsafe.putObjectVolatile(bd, intValOffset, val);
         }

@@ -3763,11 +3763,11 @@
         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));
+        UnsafeHolder.setIntCompact(this, compactValFor(intVal));
     }
 
    /**
     * Serialize this {@code BigDecimal} to the stream in question
     *