jdk/src/java.base/share/classes/java/math/BigDecimal.java
changeset 29220 b07abc731618
parent 28869 9725237b107d
child 30797 9cf3d0361db4
equal deleted inserted replaced
29219:33fb011789eb 29220:b07abc731618
  3738                     (BigDecimal.class.getDeclaredField("intVal"));
  3738                     (BigDecimal.class.getDeclaredField("intVal"));
  3739             } catch (Exception ex) {
  3739             } catch (Exception ex) {
  3740                 throw new ExceptionInInitializerError(ex);
  3740                 throw new ExceptionInInitializerError(ex);
  3741             }
  3741             }
  3742         }
  3742         }
  3743         static void setIntCompactVolatile(BigDecimal bd, long val) {
  3743         static void setIntCompact(BigDecimal bd, long val) {
  3744             unsafe.putLongVolatile(bd, intCompactOffset, val);
  3744             unsafe.putLong(bd, intCompactOffset, val);
  3745         }
  3745         }
  3746 
  3746 
  3747         static void setIntValVolatile(BigDecimal bd, BigInteger val) {
  3747         static void setIntValVolatile(BigDecimal bd, BigInteger val) {
  3748             unsafe.putObjectVolatile(bd, intValOffset, val);
  3748             unsafe.putObjectVolatile(bd, intValOffset, val);
  3749         }
  3749         }
  3763         if (intVal == null) {
  3763         if (intVal == null) {
  3764             String message = "BigDecimal: null intVal in stream";
  3764             String message = "BigDecimal: null intVal in stream";
  3765             throw new java.io.StreamCorruptedException(message);
  3765             throw new java.io.StreamCorruptedException(message);
  3766         // [all values of scale are now allowed]
  3766         // [all values of scale are now allowed]
  3767         }
  3767         }
  3768         UnsafeHolder.setIntCompactVolatile(this, compactValFor(intVal));
  3768         UnsafeHolder.setIntCompact(this, compactValFor(intVal));
  3769     }
  3769     }
  3770 
  3770 
  3771    /**
  3771    /**
  3772     * Serialize this {@code BigDecimal} to the stream in question
  3772     * Serialize this {@code BigDecimal} to the stream in question
  3773     *
  3773     *