@@ -3139,18 +3139,13 @@ public Number getNumber(String key) {
3139
3139
* The key to access the value for.
3140
3140
* @return {@code null} if there is no such key or if it is not a {@link JSONArray}.
3141
3141
*/
3142
- //TODO (grantland): Do not auto-convert JSONArray and List (v2)
3143
- // Calling this on an untouched fetched object will mark the object as dirty due to mutable
3144
- // containers and auto List <-> JSONArray conversion, since arrays are converted to List
3145
- // by default.
3146
3142
public JSONArray getJSONArray (String key ) {
3147
3143
synchronized (mutex ) {
3148
3144
checkGetAccess (key );
3149
3145
Object value = estimatedData .get (key );
3150
3146
3151
3147
if (value instanceof List ) {
3152
3148
value = PointerOrLocalIdEncoder .get ().encode (value );
3153
- put (key , value );
3154
3149
}
3155
3150
3156
3151
if (!(value instanceof JSONArray )) {
@@ -3168,15 +3163,13 @@ public JSONArray getJSONArray(String key) {
3168
3163
* @return {@code null} if there is no such key or if the value can't be converted to a
3169
3164
* {@link List}.
3170
3165
*/
3171
- //TODO (grantland): Do not auto-convert JSONArray and List (v2)
3172
3166
public <T > List <T > getList (String key ) {
3173
3167
synchronized (mutex ) {
3174
3168
Object value = estimatedData .get (key );
3175
3169
3176
3170
if (value instanceof JSONArray ) {
3177
3171
ParseDecoder decoder = ParseDecoder .get ();
3178
3172
value = decoder .convertJSONArrayToList ((JSONArray ) value );
3179
- put (key , value );
3180
3173
}
3181
3174
3182
3175
if (!(value instanceof List )) {
@@ -3196,15 +3189,13 @@ public <T> List<T> getList(String key) {
3196
3189
* @return {@code null} if there is no such key or if the value can't be converted to a
3197
3190
* {@link Map}.
3198
3191
*/
3199
- //TODO (grantland): Do not auto-convert JSONObject and Map (v2)
3200
3192
public <V > Map <String , V > getMap (String key ) {
3201
3193
synchronized (mutex ) {
3202
3194
Object value = estimatedData .get (key );
3203
3195
3204
3196
if (value instanceof JSONObject ) {
3205
3197
ParseDecoder decoder = ParseDecoder .get ();
3206
3198
value = decoder .convertJSONObjectToMap ((JSONObject ) value );
3207
- put (key , value );
3208
3199
}
3209
3200
3210
3201
if (!(value instanceof Map )) {
@@ -3223,18 +3214,13 @@ public <V> Map<String, V> getMap(String key) {
3223
3214
* The key to access the value for.
3224
3215
* @return {@code null} if there is no such key or if it is not a {@link JSONObject}.
3225
3216
*/
3226
- //TODO (grantland): Do not auto-convert JSONObject and Map (v2)
3227
- // Calling this on an untouched fetched object will mark the object as dirty due to mutable
3228
- // containers and auto Map <-> JSONObject conversion, since maps are converted to Map
3229
- // by default.
3230
3217
public JSONObject getJSONObject (String key ) {
3231
3218
synchronized (mutex ) {
3232
3219
checkGetAccess (key );
3233
3220
Object value = estimatedData .get (key );
3234
3221
3235
3222
if (value instanceof Map ) {
3236
3223
value = PointerOrLocalIdEncoder .get ().encode (value );
3237
- put (key , value );
3238
3224
}
3239
3225
3240
3226
if (!(value instanceof JSONObject )) {
0 commit comments