Skip to content

Commit 8ad9726

Browse files
committed
Fix comment in BigDecimal serialization
References #617 (cherry picked from commit 4f90abd)
1 parent 2671fff commit 8ad9726

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/rabbitmq/client/impl/ValueWriter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ else if(value instanceof BigDecimal) {
151151
"The scale was: " + decimal.scale());
152152
writeOctet(decimal.scale());
153153
BigInteger unscaled = decimal.unscaledValue();
154-
// We use 31 instead of 32 because bitLength ignores the sign bit,
154+
// We use 31 instead of 32 (Integer.SIZE) because bitLength ignores the sign bit,
155155
// so e.g. new BigDecimal(Integer.MAX_VALUE) comes out to 31 bits.
156-
if(unscaled.bitLength() > 31) /*Integer.SIZE in Java 1.5*/
156+
if(unscaled.bitLength() > 31)
157157
throw new IllegalArgumentException
158158
("BigDecimal too large to be encoded");
159159
writeLong(decimal.unscaledValue().intValue());

0 commit comments

Comments
 (0)