diff --git a/src/scratchpad/src/org/apache/poi/hemf/record/emfplus/HemfPlusDraw.java b/src/scratchpad/src/org/apache/poi/hemf/record/emfplus/HemfPlusDraw.java index e254d91816..f1647bdf6a 100644 --- a/src/scratchpad/src/org/apache/poi/hemf/record/emfplus/HemfPlusDraw.java +++ b/src/scratchpad/src/org/apache/poi/hemf/record/emfplus/HemfPlusDraw.java @@ -28,6 +28,7 @@ import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.io.IOException; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashMap; @@ -789,7 +790,7 @@ public class HemfPlusDraw { static double round10(double d) { - return new BigDecimal(d).setScale(10, BigDecimal.ROUND_HALF_UP).doubleValue(); + return new BigDecimal(d).setScale(10, RoundingMode.HALF_UP).doubleValue(); } static int readRectS(LittleEndianInputStream leis, Rectangle2D bounds) { diff --git a/src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java b/src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java index c310f4a78d..6ae092a4f5 100644 --- a/src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java +++ b/src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java @@ -21,6 +21,7 @@ import static org.junit.Assert.assertEquals; import java.math.BigDecimal; import java.math.BigInteger; +import java.math.RoundingMode; import org.apache.poi.util.HexDump; import org.junit.Test; @@ -152,7 +153,7 @@ public final class TestExpandedDouble { BigDecimal bd = new BigDecimal(hd.getSignificand()).divide(new BigDecimal(BigInteger.ONE.shiftLeft(gg))); int excessPrecision = bd.precision() - 23; if (excessPrecision > 0) { - bd = bd.setScale(bd.scale() - excessPrecision, BigDecimal.ROUND_HALF_UP); + bd = bd.setScale(bd.scale() - excessPrecision, RoundingMode.HALF_UP); } return bd.unscaledValue().toString(); } @@ -189,7 +190,7 @@ public final class TestExpandedDouble { } int excessPrecision = bd.precision() - nDec; if (excessPrecision > 0) { - bd = bd.setScale(bd.scale() - excessPrecision, BigDecimal.ROUND_HALF_UP); + bd = bd.setScale(bd.scale() - excessPrecision, RoundingMode.HALF_UP); } return bd.unscaledValue(); }