Title: [2341] trunk: ISO8601GregorianCalendarConverter may set invalid time zone for Joda-Time (XSTR-768).
Revision
2341
Author
joehni
Date
2015-02-17 16:57:51 -0600 (Tue, 17 Feb 2015)

Log Message

ISO8601GregorianCalendarConverter may set invalid time zone for Joda-Time (XSTR-768).

Modified Paths

Diff

Modified: trunk/xstream/src/java/com/thoughtworks/xstream/converters/extended/ISO8601GregorianCalendarConverter.java (2340 => 2341)


--- trunk/xstream/src/java/com/thoughtworks/xstream/converters/extended/ISO8601GregorianCalendarConverter.java	2015-02-16 23:12:56 UTC (rev 2340)
+++ trunk/xstream/src/java/com/thoughtworks/xstream/converters/extended/ISO8601GregorianCalendarConverter.java	2015-02-17 22:57:51 UTC (rev 2341)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2005 Joe Walnes.
- * Copyright (C) 2006, 2007, 2011, 2013, 2014 XStream Committers.
+ * Copyright (C) 2006, 2007, 2011, 2013, 2014, 2015 XStream Committers.
  * All rights reserved.
  *
  * The software in this package is published under the terms of the BSD
@@ -100,10 +100,10 @@
                 // try with next formatter
             }
         }
-        final String timeZoneID = TimeZone.getDefault().getID();
+        final DateTimeZone dateTimeZone = DateTimeZone.forTimeZone(TimeZone.getDefault());
         for (final DateTimeFormatter element : formattersNoUTC) {
             try {
-                final DateTimeFormatter formatter = element.withZone(DateTimeZone.forID(timeZoneID));
+                final DateTimeFormatter formatter = element.withZone(dateTimeZone);
                 final DateTime dt = formatter.parseDateTime(str);
                 final Calendar calendar = dt.toGregorianCalendar();
                 calendar.setTimeZone(TimeZone.getDefault());

Modified: trunk/xstream-distribution/src/content/changes.html (2340 => 2341)


--- trunk/xstream-distribution/src/content/changes.html	2015-02-16 23:12:56 UTC (rev 2340)
+++ trunk/xstream-distribution/src/content/changes.html	2015-02-17 22:57:51 UTC (rev 2341)
@@ -73,6 +73,7 @@
     	<li>XSTR-759: Support deserialization of <a href="" datetime format</a>
     	in DateConverter with Java 7 runtime.</li>
     	<li>Fix: DateConverter ignores provided locale.</li>
+    	<li>XSTR-768: ISO8601GregorianCalendarConverter may set invalid time zone for Joda-Time.</li>
     	<li>Fix: WeakCache.entrySet().iterator().next.setValue(value) returns the reference instead of the old value.</li>
     	<li>Fix: SqlTimestampConverter throws IllegalArgumentException instead of ConversionException on fromString().</li>
     	<li>Fix: CGLIBEnhancedConverter does not initialize transient members of parent after deserialization.</li>

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to