[
https://issues.apache.org/jira/browse/SLING-3368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13890541#comment-13890541
]
Felix Meschberger commented on SLING-3368:
------------------------------------------
I don't like the toMap method because it exposes the internal map which is
generally protected by the accessor methods to make sure updates are reasonable.
As for the addition to ArrayList: This also exposes internal storage, yet it is
not as problematic because except for the Iterator's remove method, there is
not much harm done.
Still I am not convinced we should implement these deviations from the original
JSON code we got from org.json (we currently basically only have one change
which is the use of a LinkedHashMap instead of HashMap in the JSONObject)
> Add toMap & iterable to resp. JSONObject and JSONArray
> ------------------------------------------------------
>
> Key: SLING-3368
> URL: https://issues.apache.org/jira/browse/SLING-3368
> Project: Sling
> Issue Type: Improvement
> Components: Commons
> Reporter: Nicolas Peltier
> Priority: Minor
> Attachments:
> [json]_add_other_ways_to_use_JSONArray_and_JSONObject.patch
>
>
> Map JSONObject.toMap and JSONArray implementing Iterable allows better usage
> of those classes.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)