Log Message
Merge from 1.4.x branch: Deprecation of AttributeNameIterator, ConversionException instead of IllegalArgumentException in SqlTimestampConverter and correction of Javadoc in XStreamConverter annotation.
Modified Paths
Diff
Modified: trunk/xstream/src/java/com/thoughtworks/xstream/annotations/XStreamConverter.java (2272 => 2273)
--- trunk/xstream/src/java/com/thoughtworks/xstream/annotations/XStreamConverter.java 2014-03-12 22:49:01 UTC (rev 2272)
+++ trunk/xstream/src/java/com/thoughtworks/xstream/annotations/XStreamConverter.java 2014-03-12 23:02:15 UTC (rev 2273)
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2005 Joe Walnes.
- * Copyright (C) 2006, 2007, 2008, 2009, 2011, 2012, 2013 XStream Committers.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2011, 2012, 2013, 2014 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
@@ -49,7 +49,7 @@
* </p>
* <p>
* Note, the annotation matches a {@link ConverterMatcher}.
- * {@link com.thoughtworks.xstream.converters.ConverterMatcher} as well as
+ * {@link com.thoughtworks.xstream.converters.Converter} as well as
* {@link com.thoughtworks.xstream.converters.SingleValueConverter} extend this interface. The
* {@link com.thoughtworks.xstream.mapper.AnnotationMapper} can only handle these two
* <strong>known</strong> types.
Modified: trunk/xstream/src/java/com/thoughtworks/xstream/converters/extended/SqlTimestampConverter.java (2272 => 2273)
--- trunk/xstream/src/java/com/thoughtworks/xstream/converters/extended/SqlTimestampConverter.java 2014-03-12 22:49:01 UTC (rev 2272)
+++ trunk/xstream/src/java/com/thoughtworks/xstream/converters/extended/SqlTimestampConverter.java 2014-03-12 23:02:15 UTC (rev 2273)
@@ -15,6 +15,7 @@
import java.text.ParseException;
import java.util.TimeZone;
+import com.thoughtworks.xstream.converters.ConversionException;
import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter;
import com.thoughtworks.xstream.core.util.ThreadSafeSimpleDateFormat;
@@ -56,7 +57,7 @@
public Object fromString(final String str) {
final int idx = str.lastIndexOf('.');
if (idx < 0 || str.length() - idx < 2 || str.length() - idx > 10) {
- throw new IllegalArgumentException("Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]");
+ throw new ConversionException("Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]");
}
try {
final Timestamp timestamp = new Timestamp(format.parse(str.substring(0, idx)).getTime());
@@ -66,8 +67,10 @@
}
timestamp.setNanos(Integer.parseInt(buffer.toString()));
return timestamp;
+ } catch (final NumberFormatException e) {
+ throw new ConversionException("Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]", e);
} catch (final ParseException e) {
- throw new IllegalArgumentException("Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]");
+ throw new ConversionException("Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]");
}
}
Modified: trunk/xstream/src/java/com/thoughtworks/xstream/io/AttributeNameIterator.java (2272 => 2273)
--- trunk/xstream/src/java/com/thoughtworks/xstream/io/AttributeNameIterator.java 2014-03-12 22:49:01 UTC (rev 2272)
+++ trunk/xstream/src/java/com/thoughtworks/xstream/io/AttributeNameIterator.java 2014-03-12 23:02:15 UTC (rev 2273)
@@ -18,7 +18,9 @@
* Provide an iterator over the attribute names of the current node of a reader.
*
* @author Joe Walnes
+ * @deprecated As of upcoming, it is an internal helper class only
*/
+@Deprecated
public class AttributeNameIterator implements Iterator<String> {
private int current;
To unsubscribe from this list please visit:
