I think it is a problem(aka. bug) with the API you are using.
Collection (the json.org implementation from which this API is derived does not have JSONArray implement Collection). And
JSONObject has an overloaded
put() method which takes a Collection and wraps it in a
JSONArray (thus causing the problem). I think you need to force the other
JSONObject.put() method to be used:
You should file a bug with the vendor, pretty sure their
JSONObject.put(String,Collection) method is broken.