Skip to content

Instantly share code, notes, and snippets.

@hkhan
Created February 15, 2012 16:24
Show Gist options
  • Save hkhan/1837038 to your computer and use it in GitHub Desktop.
Save hkhan/1837038 to your computer and use it in GitHub Desktop.
try {
JSONObject personData = db.getJSONObject(DATA_TABLE).getJSONObject(userId.getUserId(token)); > this should return null
if (personData == null) {
personData = new JSONObject();
db.getJSONObject(DATA_TABLE).put(userId.getUserId(token), personData);
}
for (Map.Entry<String, String> entry : values.entrySet()) {
personData.put(entry.getKey(), entry.getValue());
}
return ImmediateFuture.newInstance(null);
} catch (JSONException je) {
494: throw new ProtocolException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, je.getMessage(),
je);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment