- protected static Date unmarshallDate(JSONObject obj, String key){
- if(obj.get(key) != null) {
- JSONString s = obj.get(key).isString();
- if (s != null)
- try {
- return DateTimeFormat.getFormat(PredefinedFormat.ISO_8601).parse(s.stringValue());
- } catch (IllegalArgumentException e) {
- GWT.log("", e);
- }
+ protected static Date unmarshallDate(JSONObject obj, String key) {
+ final JSONValue jsonValue = obj.get(key);
+ if(jsonValue != null) {
+ JSONString jsonString = jsonValue.isString();
+ if(jsonString != null) {
+ try {
+ return DateTimeFormat.getFormat(PredefinedFormat.ISO_8601).parse(jsonString.stringValue());
+ }
+ catch(IllegalArgumentException e) {
+ GWT.log("", e);
+ }
+ }