sling-dev mailing list archives

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

    [ 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)

Mime
View raw message