From 51c9ac77a3c112b87a2a943fc0eaff427aa9c3a1 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Fri, 15 Jul 2022 23:03:51 +0000 Subject: [PATCH] [github-355] Tidy up some boxed variables. Thanks to XenoAmess. This closes #355 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1902759 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/poi/xslf/usermodel/TestXSLFSheet.java | 2 +- .../apache/poi/ss/formula/functions/NumberValueFunction.java | 4 ++-- .../org/apache/poi/ss/formula/functions/TestIntercept.java | 2 +- .../java/org/apache/poi/ss/formula/functions/TestSlope.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSheet.java b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSheet.java index 5b6bacf58c..c6a149fa38 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSheet.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSheet.java @@ -98,7 +98,7 @@ class TestXSLFSheet { XMLSlideShow[] sourceSlideShows = new XMLSlideShow[] { textureSlideShow, pictureSlideShow }; XMLSlideShow targetSlideShow = textureSlideShow; for (XMLSlideShow sourceSlideShow : sourceSlideShows) { - Boolean sameSlideShow = sourceSlideShow == targetSlideShow; + boolean sameSlideShow = sourceSlideShow == targetSlideShow; String assertMessage = "importing charts " + (sameSlideShow ? "within the same slide show" : "from another slideshow") + ": "; XSLFSlide sourceSlide = sourceSlideShow.getSlides().get(0); XSLFSlide slide = targetSlideShow.createSlide(); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/NumberValueFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/NumberValueFunction.java index b53b970736..eb0c0af009 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/NumberValueFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/NumberValueFunction.java @@ -50,7 +50,7 @@ public final class NumberValueFunction implements FreeRefFunction { String decSep = String.valueOf(decimalFormatSymbols.getDecimalSeparator()); String groupSep = String.valueOf(decimalFormatSymbols.getGroupingSeparator()); - Double result = Double.NaN; + double result = Double.NaN; ValueEval v1 = null; ValueEval v2 = null; ValueEval v3 = null; @@ -105,7 +105,7 @@ public final class NumberValueFunction implements FreeRefFunction { } try { - result = Double.valueOf(text); + result = Double.parseDouble(text); result = result / Math.pow(100, countPercent); //If the Text argument ends in one or more percent signs (%), they are used in the calculation of the result. checkValue(result); } catch (EvaluationException e) { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIntercept.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIntercept.java index ee6f722e39..6bf4ed1a2f 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIntercept.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIntercept.java @@ -59,7 +59,7 @@ final class TestIntercept { @Test void testBasic() { - Double exp = Math.pow(10, 7.5); + double exp = Math.pow(10, 7.5); ValueEval[] yValues = { new NumberEval(3+exp), new NumberEval(4+exp), diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSlope.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSlope.java index 971368714a..b4f69eaf93 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSlope.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSlope.java @@ -54,7 +54,7 @@ final class TestSlope { @Test void testBasic() { - Double exp = Math.pow(10, 7.5); + double exp = Math.pow(10, 7.5); ValueEval[] yValues = { new NumberEval(3+exp), new NumberEval(4+exp), -- 2.39.5