aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2017-11-21 21:11:07 +0000
committerPJ Fanning <fanningpj@apache.org>2017-11-21 21:11:07 +0000
commitd0ddfa94025250db8d51a974450ad83990df2f7e (patch)
tree626e044fc2ec149b7cd9aef497d9fcdbb17834f4 /src
parent731d089005b97f3bb6c4ca3bb719295a16278313 (diff)
downloadpoi-d0ddfa94025250db8d51a974450ad83990df2f7e.tar.gz
poi-d0ddfa94025250db8d51a974450ad83990df2f7e.zip
remove more uses of Character.toUpperCase
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815988 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/poi/ss/format/CellDateFormatter.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/java/org/apache/poi/ss/format/CellDateFormatter.java b/src/java/org/apache/poi/ss/format/CellDateFormatter.java
index 848a9e372c..375e1fbae3 100644
--- a/src/java/org/apache/poi/ss/format/CellDateFormatter.java
+++ b/src/java/org/apache/poi/ss/format/CellDateFormatter.java
@@ -181,7 +181,6 @@ public class CellDateFormatter extends CellFormatter {
boolean doneAm = false;
boolean doneMillis = false;
- it.first();
for (char ch = it.first();
ch != CharacterIterator.DONE;
ch = it.next()) {
@@ -189,12 +188,9 @@ public class CellDateFormatter extends CellFormatter {
if (!doneMillis) {
Date dateObj = (Date) value;
int pos = toAppendTo.length();
- Formatter formatter = new Formatter(toAppendTo, Locale.ROOT);
- try {
+ try (Formatter formatter = new Formatter(toAppendTo, Locale.ROOT)) {
long msecs = dateObj.getTime() % 1000;
formatter.format(locale, sFmt, msecs / 1000.0);
- } finally {
- formatter.close();
}
toAppendTo.delete(pos, pos + 2);
doneMillis = true;
@@ -203,11 +199,11 @@ public class CellDateFormatter extends CellFormatter {
if (!doneAm) {
if (showAmPm) {
if (amPmUpper) {
- toAppendTo.append(Character.toUpperCase(ch));
+ toAppendTo.append(Character.toString(ch).toUpperCase(LocaleUtil.getUserLocale()));
if (showM)
toAppendTo.append('M');
} else {
- toAppendTo.append(Character.toLowerCase(ch));
+ toAppendTo.append(Character.toString(ch).toLowerCase(LocaleUtil.getUserLocale()));
if (showM)
toAppendTo.append('m');
}