From af3f0427b57a73973f699fab871e645983f6f994 Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Sat, 15 Aug 2015 12:09:26 +0000 Subject: [PATCH] FindBugs - BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1696040 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/ss/formula/functions/Complex.java | 2 +- src/java/org/apache/poi/ss/formula/functions/Rept.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/poi/ss/formula/functions/Complex.java b/src/java/org/apache/poi/ss/formula/functions/Complex.java index 1e0bd5bfd..4674b8baf 100644 --- a/src/java/org/apache/poi/ss/formula/functions/Complex.java +++ b/src/java/org/apache/poi/ss/formula/functions/Complex.java @@ -104,7 +104,7 @@ public class Complex extends Var2or3ArgFunction implements FreeRefFunction { StringBuffer strb = new StringBuffer(""); if (realNum != 0) { if (isDoubleAnInt(realNum)) { - strb.append(new Double(realNum).intValue()); + strb.append((int)realNum); } else { strb.append(realNum); } diff --git a/src/java/org/apache/poi/ss/formula/functions/Rept.java b/src/java/org/apache/poi/ss/formula/functions/Rept.java index 0dbb189cd..0c8a5f876 100644 --- a/src/java/org/apache/poi/ss/formula/functions/Rept.java +++ b/src/java/org/apache/poi/ss/formula/functions/Rept.java @@ -59,7 +59,7 @@ public class Rept extends Fixed2ArgFunction { return ErrorEval.VALUE_INVALID; } - int numberOfTimeInt = new Double(numberOfTime).intValue(); + int numberOfTimeInt = (int)numberOfTime; StringBuffer strb = new StringBuffer(strText1.length() * numberOfTimeInt); for(int i = 0; i < numberOfTimeInt; i++) { strb.append(strText1);