mirror of https://github.com/apache/jclouds.git
took out null checking, as exceptions are now thrown when parsing fails
git-svn-id: http://jclouds.googlecode.com/svn/trunk@1873 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
94b13626f1
commit
4e05fcf529
|
@ -77,9 +77,7 @@ public class ParserModule extends AbstractModule {
|
||||||
public DateTime deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
|
public DateTime deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
|
||||||
throws JsonParseException {
|
throws JsonParseException {
|
||||||
String toParse = json.getAsJsonPrimitive().getAsString();
|
String toParse = json.getAsJsonPrimitive().getAsString();
|
||||||
DateTime toReturn = dateService.iso8601DateParse(toParse);
|
DateTime toReturn = dateService.jodaIso8601DateParse(toParse);
|
||||||
if (toReturn == null) toReturn = new DateTime(toParse);
|
|
||||||
if (toReturn == null) throw new RuntimeException("could not parse: "+toParse);
|
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue