[Schmitzm-commits] r1856 - trunk/schmitzm-core/src/main/java/de/schmitzm/lang
scm-commit at wald.intevation.org
scm-commit at wald.intevation.org
Fri Feb 3 17:15:46 CET 2012
Author: alfonx
Date: 2012-02-03 17:15:46 +0100 (Fri, 03 Feb 2012)
New Revision: 1856
Modified:
trunk/schmitzm-core/src/main/java/de/schmitzm/lang/ConcurrentDateFormat.java
Log:
ConcurrentDateFormat kann jetzt Locale ?\195?\188bergeben werden.
Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/lang/ConcurrentDateFormat.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/lang/ConcurrentDateFormat.java 2012-02-03 00:14:46 UTC (rev 1855)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/lang/ConcurrentDateFormat.java 2012-02-03 16:15:46 UTC (rev 1856)
@@ -2,6 +2,7 @@
import java.text.DateFormat;
import java.text.SimpleDateFormat;
+import java.util.Locale;
/**
* Liefert auf einem Thread immer die selbe {@link DateFormat} Instanz. Bei neuen Threads werden neue {@link DateFormat}
@@ -10,10 +11,17 @@
public class ConcurrentDateFormat extends ThreadLocal<DateFormat> {
private final String dateformat;
+ private final Locale locale;
public ConcurrentDateFormat(final String dateformat) {
this.dateformat = dateformat;
+ this.locale = Locale.GERMAN;
}
+
+ public ConcurrentDateFormat(final String dateformat, Locale locale) {
+ this.dateformat = dateformat;
+ this.locale = locale;
+ }
@Override
public DateFormat get() {
@@ -22,7 +30,7 @@
@Override
protected DateFormat initialValue() {
- return new SimpleDateFormat(dateformat);
+ return new SimpleDateFormat(dateformat, locale);
}
@Override
More information about the Schmitzm-commits
mailing list