Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
minor warnings cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jul 26, 2017
1 parent 4732b48 commit f30f821
Showing 1 changed file with 15 additions and 15 deletions.
Expand Up @@ -22,27 +22,27 @@ public JSONObjectDeserializer()
}

@Override
public JSONObject deserialize(JsonParser jp, DeserializationContext ctxt)
throws IOException, JsonProcessingException
public JSONObject deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException
{
JSONObject ob = new JSONObject();
JsonToken t = jp.getCurrentToken();
JsonToken t = p.getCurrentToken();
if (t == JsonToken.START_OBJECT) {
t = jp.nextToken();
t = p.nextToken();
}
for (; t == JsonToken.FIELD_NAME; t = jp.nextToken()) {
String fieldName = jp.getCurrentName();
t = jp.nextToken();
for (; t == JsonToken.FIELD_NAME; t = p.nextToken()) {
String fieldName = p.getCurrentName();
t = p.nextToken();
try {
switch (t) {
case START_ARRAY:
ob.put(fieldName, JSONArrayDeserializer.instance.deserialize(jp, ctxt));
ob.put(fieldName, JSONArrayDeserializer.instance.deserialize(p, ctxt));
continue;
case START_OBJECT:
ob.put(fieldName, deserialize(jp, ctxt));
ob.put(fieldName, deserialize(p, ctxt));
continue;
case VALUE_STRING:
ob.put(fieldName, jp.getText());
ob.put(fieldName, p.getText());
continue;
case VALUE_NULL:
ob.put(fieldName, JSONObject.NULL);
Expand All @@ -54,21 +54,21 @@ public JSONObject deserialize(JsonParser jp, DeserializationContext ctxt)
ob.put(fieldName, Boolean.FALSE);
continue;
case VALUE_NUMBER_INT:
ob.put(fieldName, jp.getNumberValue());
ob.put(fieldName, p.getNumberValue());
continue;
case VALUE_NUMBER_FLOAT:
ob.put(fieldName, jp.getNumberValue());
ob.put(fieldName, p.getNumberValue());
continue;
case VALUE_EMBEDDED_OBJECT:
ob.put(fieldName, jp.getEmbeddedObject());
ob.put(fieldName, p.getEmbeddedObject());
continue;
default:
}
} catch (JSONException e) {
throw ctxt.mappingException("Failed to construct JSONObject: "+e.getMessage());
}
throw ctxt.mappingException("Urecognized or unsupported JsonToken type: "+t);
return (JSONObject) ctxt.handleUnexpectedToken(JSONObject.class, p);
}
return ob;
}
}
}

0 comments on commit f30f821

Please sign in to comment.