From b1798d8529b4e4e262ada37a5237f3eb018904be Mon Sep 17 00:00:00 2001 From: Martin Fietz <Martin.Fietz@gmail.com> Date: Fri, 4 Mar 2016 10:06:01 +0100 Subject: Give each thread its own parser --- .../main/java/de/danoeh/antennapod/core/util/DateUtils.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java index 6b0f423df..155ef519b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java @@ -19,14 +19,8 @@ public class DateUtils { private static final String TAG = "DateUtils"; - private static final SimpleDateFormat parser = new SimpleDateFormat("", Locale.US); private static final TimeZone defaultTimezone = TimeZone.getTimeZone("GMT"); - static { - parser.setLenient(false); - parser.setTimeZone(defaultTimezone); - } - public static Date parse(final String input) { if(input == null) { throw new IllegalArgumentException("Date must not be null"); @@ -86,6 +80,10 @@ public class DateUtils { "yyyy-MM-dd" }; + SimpleDateFormat parser = new SimpleDateFormat("", Locale.US); + parser.setLenient(false); + parser.setTimeZone(defaultTimezone); + ParsePosition pos = new ParsePosition(0); for(String pattern : patterns) { parser.applyPattern(pattern); -- cgit debian/1.2.3+git2.25.1-1-2-gaceb0