File tree 2 files changed +4
-1
lines changed
lang/java/avro/src/main/java/org/apache/avro
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ Trunk (not yet released)
15
15
AVRO-1741: Python3: Fix error when codec is not in the header.
16
16
(Matthew Hayes via blue)
17
17
18
+ AVRO-1869: Java: Fix Decimal conversion from ByteBuffer. (blue)
19
+
18
20
Avro 1.8.1 (14 May 2016)
19
21
20
22
INCOMPATIBLE CHANGES
Original file line number Diff line number Diff line change @@ -80,7 +80,8 @@ public String getLogicalTypeName() {
80
80
public BigDecimal fromBytes (ByteBuffer value , Schema schema , LogicalType type ) {
81
81
int scale = ((LogicalTypes .Decimal ) type ).getScale ();
82
82
// always copy the bytes out because BigInteger has no offset/length ctor
83
- byte [] bytes = value .get (new byte [value .remaining ()]).array ();
83
+ byte [] bytes = new byte [value .remaining ()];
84
+ value .get (bytes );
84
85
return new BigDecimal (new BigInteger (bytes ), scale );
85
86
}
86
87
You can’t perform that action at this time.
0 commit comments