Conversation
|
Thanks, investigating. |
|
Does not break the unit tests. A bit difficult to isolate the functional change due to all of the style updates. In XML.toString(), Array values found in a JSONObject are converted into JSONArray instances: New functionality: New behavior:
Unrelated note: Seems like a good enhancement, but needs more study of how the behavior is changed. |
|
I agree with you about line 410. I think that would be outside the scope of this PR though, unless you want me to include it. |
|
What problem does this code solve? Changes to the API? Changes to how the code behaves? Produces this XML from raw JSON or internal JSONArrays (correct): Currently produces this XML from internal arrays (incorrect): The code fix will bring the Array value in sync with raw JSON and JSONArray. Does it break the unit tests? Will this require a new release? Should the documentation be updated? |
There is some code in the XML converter that tries to wrap arrays into a JSONArray, but does so inconsistently. This causes some disconnect between the handling of a native Java Array and the JSONArray object when conversion to XML occurs.
This PR also updates the loops over the JSONArrays to use the new iterable for loops introduced in Java5 as well as updates some comment formatting to be more consistent with other files in the project.