Andreas Kohn created SHINDIG-1960:
-------------------------------------

             Summary: JsonDbOpensocialService#createMessage() improperly 
accesses the message collection
                 Key: SHINDIG-1960
                 URL: https://issues.apache.org/jira/browse/SHINDIG-1960
             Project: Shindig
          Issue Type: Bug
          Components: Java
    Affects Versions: 2.5.0-update1
            Reporter: Andreas Kohn


(Spin-off from SHINDIG-1951 containing only the fixes to #createMessage(), 
without the API change)

Calling #createMessage() leads to errors like this:
{noformat}
org.apache.shindig.protocol.ProtocolException: JSONObject["jane.doe"] is not a 
JSONArray.
        at org.json.JSONObject.getJSONArray(JSONObject.java:502)
        at 
org.apache.shindig.social.sample.spi.JsonDbOpensocialService.createMessage(JsonDbOpensocialService.java:621)
{noformat}

{code}
Message msg = new MessageImpl();
msg.setBody("Hello");
msg.setRecipients(Collections.singletonList(JANE_DOE.getUserId()));
db.createMessage(JOHN_DOE, APP_ID, "privateMessage", msg, token).get();
{code}




--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to