You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Chris Chabot <ch...@xs4all.nl> on 2008/02/28 13:05:53 UTC

Question about JsonRPCRequest

While going over the code in JsonRPCRequest.java, i found this bit,  
now it might be my Java reading abilities failing me, but I'm under  
the distinct impression that all this code does is add an empty  
"prefs" json object to the response, and the actual userperfs (which  
are put in up) are never used or included .... meaning their not in  
the json response at all.

Should i duplicate this behavior (because their being excluded is  
intentional), is it a bug, or am i missing something obvious?

JsonRPCRequest.java line 84:

         JSONObject prefs = new JSONObject();

         // User pref specs
         for (GadgetSpec.UserPref pref : outGadget.getUserPrefs()) {
           JSONObject up = new JSONObject()
               .put("displayName", pref.getDisplayName())
               .put("type", pref.getDataType().toString().toLowerCase())
               .put("default", pref.getDefaultValue())
               .put("enumValues", pref.getEnumValues());
         }
         gadgetJson.put("userPrefs", prefs);


Re: Question about JsonRPCRequest

Posted by Kevin Brown <et...@google.com>.
This was fixed in rev 628973. You're probably porting against a much older
revision.

On Thu, Feb 28, 2008 at 4:05 AM, Chris Chabot <ch...@xs4all.nl> wrote:

> While going over the code in JsonRPCRequest.java, i found this bit,
> now it might be my Java reading abilities failing me, but I'm under
> the distinct impression that all this code does is add an empty
> "prefs" json object to the response, and the actual userperfs (which
> are put in up) are never used or included .... meaning their not in
> the json response at all.
>
> Should i duplicate this behavior (because their being excluded is
> intentional), is it a bug, or am i missing something obvious?
>
> JsonRPCRequest.java line 84:
>
>         JSONObject prefs = new JSONObject();
>
>         // User pref specs
>         for (GadgetSpec.UserPref pref : outGadget.getUserPrefs()) {
>           JSONObject up = new JSONObject()
>               .put("displayName", pref.getDisplayName())
>               .put("type", pref.getDataType().toString().toLowerCase())
>               .put("default", pref.getDefaultValue())
>               .put("enumValues", pref.getEnumValues());
>         }
>         gadgetJson.put("userPrefs", prefs);
>
>


-- 
~Kevin

If you received this email by mistake, please delete it, cancel your mail
account, destroy your hard drive, silence any witnesses, and burn down the
building that you're in.