This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 361a7ec  avoid deprecated method
361a7ec is described below

commit 361a7ecbee4d21c785898e11b0906d66146d05f6
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Dec 23 14:57:31 2021 +1000

    avoid deprecated method
---
 .../java/org/codehaus/groovy/runtime/typehandling/BigDecimalMath.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/codehaus/groovy/runtime/typehandling/BigDecimalMath.java 
b/src/main/java/org/codehaus/groovy/runtime/typehandling/BigDecimalMath.java
index e23550e..dd14405 100644
--- a/src/main/java/org/codehaus/groovy/runtime/typehandling/BigDecimalMath.java
+++ b/src/main/java/org/codehaus/groovy/runtime/typehandling/BigDecimalMath.java
@@ -22,6 +22,7 @@ import org.apache.groovy.util.SystemUtil;
 
 import java.math.BigDecimal;
 import java.math.MathContext;
+import java.math.RoundingMode;
 
 /**
  * BigDecimal NumberMath operations
@@ -71,7 +72,7 @@ public final class BigDecimalMath extends NumberMath {
             int precision = Math.max(bigLeft.precision(), 
bigRight.precision()) + DIVISION_EXTRA_PRECISION;
             BigDecimal result = bigLeft.divide(bigRight, new 
MathContext(precision));
             int scale = Math.max(Math.max(bigLeft.scale(), bigRight.scale()), 
DIVISION_MIN_SCALE);
-            if (result.scale() > scale) result = result.setScale(scale, 
BigDecimal.ROUND_HALF_UP);
+            if (result.scale() > scale) result = result.setScale(scale, 
RoundingMode.HALF_UP);
             return result;
         }
     }

Reply via email to