ASF Bugzilla – Attachment 36809 Details for
Bug 63805
RFE: Leverage language features introduced in Java 8, remove use of deprecated methods
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
BigDecimal: use enum args instead of integers (deprecated in Java 9)
don't_use_BigDecimal_methods_deprecated_in_Java_9.patch (text/plain), 2.94 KB, created by
Axel Howind
on 2019-10-07 12:50:38 UTC
(
hide
)
Description:
BigDecimal: use enum args instead of integers (deprecated in Java 9)
Filename:
MIME Type:
Creator:
Axel Howind
Created:
2019-10-07 12:50:38 UTC
Size:
2.94 KB
patch
obsolete
>Index: src/java/org/apache/poi/util/IntList.java >IDEA additional info: >Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ><+>UTF-8 >=================================================================== >--- src/java/org/apache/poi/util/IntList.java (revision 1454f9513743a0ab10f8dc494b484934cdd776cf) >+++ src/java/org/apache/poi/util/IntList.java (revision 6cf9e28fa7acdd2fd106769b649223fdfa3fc97e) >@@ -17,8 +17,6 @@ > > package org.apache.poi.util; > >-import java.util.Arrays; >- > /** > * A List of int's; as full an implementation of the java.util.List > * interface as possible, with an eye toward minimal creation of >Index: src/scratchpad/src/org/apache/poi/hemf/record/emfplus/HemfPlusDraw.java >IDEA additional info: >Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ><+>UTF-8 >=================================================================== >--- src/scratchpad/src/org/apache/poi/hemf/record/emfplus/HemfPlusDraw.java (revision 1454f9513743a0ab10f8dc494b484934cdd776cf) >+++ src/scratchpad/src/org/apache/poi/hemf/record/emfplus/HemfPlusDraw.java (revision 6cf9e28fa7acdd2fd106769b649223fdfa3fc97e) >@@ -28,6 +28,7 @@ > 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 @@ > > > 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) { >Index: src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java >IDEA additional info: >Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ><+>UTF-8 >=================================================================== >--- src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java (revision 1454f9513743a0ab10f8dc494b484934cdd776cf) >+++ src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java (revision 6cf9e28fa7acdd2fd106769b649223fdfa3fc97e) >@@ -21,6 +21,7 @@ > > 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 @@ > 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 @@ > } > 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(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 63805
: 36809 |
36810
|
36811
|
36812
|
36813