@@ -306,7 +306,6 @@ public String toString() {
306
306
307
307
// Cached State
308
308
private final Map <String , Object > estimatedData ;
309
- private final Map <String , Boolean > dataAvailability ;
310
309
private final Map <Object , ParseJSONCacheItem > hashedObjects ; // For mutable containers
311
310
312
311
private String localId ;
@@ -385,7 +384,6 @@ public ParseObject(String theClassName) {
385
384
operationSetQueue .add (new ParseOperationSet ());
386
385
estimatedData = new HashMap <>();
387
386
hashedObjects = new IdentityHashMap <>();
388
- dataAvailability = new HashMap <>();
389
387
390
388
State .Init <?> builder = newStateBuilder (theClassName );
391
389
// When called from new, assume hasData for the whole object is true.
@@ -754,7 +752,6 @@ private void setState(State newState, boolean notifyIfObjectIdChanges) {
754
752
}
755
753
756
754
rebuildEstimatedData ();
757
- rebuildDataAvailability ();
758
755
checkpointAllMutableContainers ();
759
756
}
760
757
}
@@ -843,7 +840,6 @@ public Set<String> keySet() {
843
840
synchronized (mutex ) {
844
841
currentOperations ().remove (key );
845
842
rebuildEstimatedData ();
846
- rebuildDataAvailability ();
847
843
checkpointAllMutableContainers ();
848
844
}
849
845
}
@@ -856,7 +852,6 @@ public Set<String> keySet() {
856
852
synchronized (mutex ) {
857
853
currentOperations ().clear ();
858
854
rebuildEstimatedData ();
859
- rebuildDataAvailability ();
860
855
checkpointAllMutableContainers ();
861
856
}
862
857
}
@@ -2959,18 +2954,6 @@ private void rebuildEstimatedData() {
2959
2954
}
2960
2955
}
2961
2956
2962
- /**
2963
- * Regenerates the dataAvailability map from the serverData.
2964
- */
2965
- private void rebuildDataAvailability () {
2966
- synchronized (mutex ) {
2967
- dataAvailability .clear ();
2968
- for (String key : state .keySet ()) {
2969
- dataAvailability .put (key , true );
2970
- }
2971
- }
2972
- }
2973
-
2974
2957
/**
2975
2958
* performOperation() is like {@link #put(String, Object)} but instead of just taking a new value,
2976
2959
* it takes a ParseFieldOperation that modifies the value.
@@ -2990,7 +2973,6 @@ private void rebuildDataAvailability() {
2990
2973
currentOperations ().put (key , newOperation );
2991
2974
2992
2975
checkpointMutableContainer (key , newValue );
2993
- dataAvailability .put (key , Boolean .TRUE );
2994
2976
}
2995
2977
}
2996
2978
@@ -3546,8 +3528,7 @@ public boolean isDataAvailable() {
3546
3528
3547
3529
private boolean isDataAvailable (String key ) {
3548
3530
synchronized (mutex ) {
3549
- return isDataAvailable ()
3550
- || (dataAvailability .containsKey (key ) ? dataAvailability .get (key ) : false );
3531
+ return isDataAvailable () || estimatedData .containsKey (key );
3551
3532
}
3552
3533
}
3553
3534
0 commit comments