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:
adrian.f.cole 2009-09-03 03:57:21 +00:00
parent 94b13626f1
commit 4e05fcf529
1 changed files with 3 additions and 5 deletions

View File

@ -77,9 +77,7 @@ public class ParserModule extends AbstractModule {
public DateTime deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
throws JsonParseException {
String toParse = json.getAsJsonPrimitive().getAsString();
DateTime toReturn = dateService.iso8601DateParse(toParse);
if (toReturn == null) toReturn = new DateTime(toParse);
if (toReturn == null) throw new RuntimeException("could not parse: "+toParse);
DateTime toReturn = dateService.jodaIso8601DateParse(toParse);
return toReturn;
}