Skip to content

Commit

Permalink
fixed files form Lang #50
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent ff78051 commit 6699261
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions projects/Lang/50/org/apache/commons/lang/time/FastDateFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,16 +282,14 @@ public static synchronized FastDateFormat getDateInstance(int style, TimeZone ti
key = new Pair(key, timeZone);
}

if (locale != null) {
key = new Pair(key, locale);
if (locale == null) {
locale = Locale.getDefault();
}

key = new Pair(key, locale);

FastDateFormat format = (FastDateFormat) cDateInstanceCache.get(key);
if (format == null) {
if (locale == null) {
locale = Locale.getDefault();
}
try {
SimpleDateFormat formatter = (SimpleDateFormat) DateFormat.getDateInstance(style, locale);
String pattern = formatter.toPattern();
Expand Down Expand Up @@ -462,15 +460,13 @@ public static synchronized FastDateFormat getDateTimeInstance(int dateStyle, int
if (timeZone != null) {
key = new Pair(key, timeZone);
}
if (locale != null) {
key = new Pair(key, locale);
if (locale == null) {
locale = Locale.getDefault();
}
key = new Pair(key, locale);

FastDateFormat format = (FastDateFormat) cDateTimeInstanceCache.get(key);
if (format == null) {
if (locale == null) {
locale = Locale.getDefault();
}
try {
SimpleDateFormat formatter = (SimpleDateFormat) DateFormat.getDateTimeInstance(dateStyle, timeStyle,
locale);
Expand Down

0 comments on commit 6699261

Please sign in to comment.