From: Javen O'Neal Date: Fri, 4 Dec 2015 10:51:03 +0000 (+0000) Subject: make fields static X-Git-Tag: REL_3_14_BETA1~16 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3309d1f82027768a442a54c2f1442e8a678fd5bc;p=poi.git make fields static git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1717929 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/ss/usermodel/ExcelStyleDateFormatter.java b/src/java/org/apache/poi/ss/usermodel/ExcelStyleDateFormatter.java index c075b55b24..2ea273f951 100644 --- a/src/java/org/apache/poi/ss/usermodel/ExcelStyleDateFormatter.java +++ b/src/java/org/apache/poi/ss/usermodel/ExcelStyleDateFormatter.java @@ -43,13 +43,13 @@ public class ExcelStyleDateFormatter extends SimpleDateFormat { public static final char L_BRACKET_SYMBOL = '\ue016'; public static final char LL_BRACKET_SYMBOL = '\ue017'; - private final DecimalFormat format1digit; - private final DecimalFormat format2digits; + private static final DecimalFormat format1digit; + private static final DecimalFormat format2digits; - private final DecimalFormat format3digit; - private final DecimalFormat format4digits; + private static final DecimalFormat format3digit; + private static final DecimalFormat format4digits; - { + static { DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(Locale.ROOT); format1digit = new DecimalFormat("0", dfs); format2digits = new DecimalFormat("00", dfs); @@ -59,6 +59,9 @@ public class ExcelStyleDateFormatter extends SimpleDateFormat { DataFormatter.setExcelStyleRoundingMode(format2digits, RoundingMode.DOWN); DataFormatter.setExcelStyleRoundingMode(format3digit); DataFormatter.setExcelStyleRoundingMode(format4digits); + } + + { setTimeZone(LocaleUtil.getUserTimeZone()); }