From: Andreas Beeker Date: Wed, 16 Mar 2016 23:36:17 +0000 (+0000) Subject: findbugs fix X-Git-Tag: REL_3_15_BETA2~426 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ee4b65394f6b7832dc0496ec08768753824303aa;p=poi.git findbugs fix git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1735348 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/ss/format/CellNumberFormatter.java b/src/java/org/apache/poi/ss/format/CellNumberFormatter.java index 8d3b31da2b..2097e6c909 100644 --- a/src/java/org/apache/poi/ss/format/CellNumberFormatter.java +++ b/src/java/org/apache/poi/ss/format/CellNumberFormatter.java @@ -639,8 +639,8 @@ public class CellNumberFormatter extends CellFormatter { return; } else { // New we check to see if we should remove the integer part - boolean numNoZero = !numeratorSpecials.contains('0'); - boolean intNoZero = !integerSpecials.contains('0'); + boolean numNoZero = !hasChar('0', numeratorSpecials); + boolean intNoZero = !hasChar('0', integerSpecials); boolean intOnlyHash = integerSpecials.isEmpty() || (integerSpecials.size() == 1 && integerSpecials.contains('#')); boolean removeBecauseZero = fractional == 0 && (intOnlyHash || numNoZero);