KAFKA-9642: Change "BigDecimal(double)" constructor to "BigDecimal.valueOf(double)" (#8212)

Co-authored-by: Soontaek Lim <soontaek.lim@ultratendency.com>

Reviewers: Guozhang Wang <wangguoz@gmail.com>
This commit is contained in:
SoontaekLim 2020-04-09 19:22:23 +02:00 committed by GitHub
parent 371ad143a6
commit 179be72e30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -421,7 +421,7 @@ public class Values {
if (value instanceof Number) {
// Not already a decimal, so treat it as a double ...
double converted = ((Number) value).doubleValue();
return new BigDecimal(converted);
return BigDecimal.valueOf(converted);
}
if (value instanceof String) {
return new BigDecimal(value.toString()).doubleValue();