Skip to content

Commit e3f68fe

Browse files
committed
Merge pull request #303 from ParsePlatform/grantland.cached
Remove caching of auto-converted values
2 parents 00e0d08 + 34c5def commit e3f68fe

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

Parse/src/main/java/com/parse/ParseObject.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3139,18 +3139,13 @@ public Number getNumber(String key) {
31393139
* The key to access the value for.
31403140
* @return {@code null} if there is no such key or if it is not a {@link JSONArray}.
31413141
*/
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.
31463142
public JSONArray getJSONArray(String key) {
31473143
synchronized (mutex) {
31483144
checkGetAccess(key);
31493145
Object value = estimatedData.get(key);
31503146

31513147
if (value instanceof List) {
31523148
value = PointerOrLocalIdEncoder.get().encode(value);
3153-
put(key, value);
31543149
}
31553150

31563151
if (!(value instanceof JSONArray)) {
@@ -3168,15 +3163,13 @@ public JSONArray getJSONArray(String key) {
31683163
* @return {@code null} if there is no such key or if the value can't be converted to a
31693164
* {@link List}.
31703165
*/
3171-
//TODO (grantland): Do not auto-convert JSONArray and List (v2)
31723166
public <T> List<T> getList(String key) {
31733167
synchronized (mutex) {
31743168
Object value = estimatedData.get(key);
31753169

31763170
if (value instanceof JSONArray) {
31773171
ParseDecoder decoder = ParseDecoder.get();
31783172
value = decoder.convertJSONArrayToList((JSONArray) value);
3179-
put(key, value);
31803173
}
31813174

31823175
if (!(value instanceof List)) {
@@ -3196,15 +3189,13 @@ public <T> List<T> getList(String key) {
31963189
* @return {@code null} if there is no such key or if the value can't be converted to a
31973190
* {@link Map}.
31983191
*/
3199-
//TODO (grantland): Do not auto-convert JSONObject and Map (v2)
32003192
public <V> Map<String, V> getMap(String key) {
32013193
synchronized (mutex) {
32023194
Object value = estimatedData.get(key);
32033195

32043196
if (value instanceof JSONObject) {
32053197
ParseDecoder decoder = ParseDecoder.get();
32063198
value = decoder.convertJSONObjectToMap((JSONObject) value);
3207-
put(key, value);
32083199
}
32093200

32103201
if (!(value instanceof Map)) {
@@ -3223,18 +3214,13 @@ public <V> Map<String, V> getMap(String key) {
32233214
* The key to access the value for.
32243215
* @return {@code null} if there is no such key or if it is not a {@link JSONObject}.
32253216
*/
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.
32303217
public JSONObject getJSONObject(String key) {
32313218
synchronized (mutex) {
32323219
checkGetAccess(key);
32333220
Object value = estimatedData.get(key);
32343221

32353222
if (value instanceof Map) {
32363223
value = PointerOrLocalIdEncoder.get().encode(value);
3237-
put(key, value);
32383224
}
32393225

32403226
if (!(value instanceof JSONObject)) {

0 commit comments

Comments
 (0)