Q: is codenameOne JSONObject.toString creating malformed JSON with quotes around arrays? I'm using CodenameOne's JSONObject class and when I convert to a string, it appears to be adding quotes where they are not required.
Please have a look and let me know if I am using the class correctly.
I create the JSON Object from a HashMap containing ArrayLists and then convert it to string to send:
ArrayList categories;
ArrayList modules;
// add some String values to the Array Lists
HashMap<String,Object> activityData = new HashMap<String,Object>;
activityData.put("categories",categories);
activityData.put("modules",modules);
JSONObject json = new JSONObject(activityData);
//more unrelated code and then...
String jsonString = json.toString();

the problem is that the ArrayList objects in the hashmap are treated as a quoted string so that parsing it on the other end returns Categories and Modules as Strings, not Arrays.
{"categories":"[punches, blocks, kicks]","modules":"[white_to_yellow, yellow_to_orange]"}

so for example, instead of categories being interpreted as an array with 3 elements "punches", "blocks", "kicks", it is decoded from JSON as a single string:
categories = "[punches, blocks, kicks]"

so am I using the class incorrectly, or is this a bug?

A: Which JSONObject class are you using?  The one from the CN1JSON library?
There was a fix for a similar issue in Nov 2015.  Are you using an old version of the lib?
