sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger (JIRA)" <>
Subject [jira] [Commented] (SLING-3368) Add toMap & iterable to resp. JSONObject and JSONArray
Date Tue, 04 Feb 2014 10:18:13 GMT


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:
>             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

This message was sent by Atlassian JIRA

View raw message