2424
2525import bolts .Continuation ;
2626import bolts .Task ;
27+ import bolts .TaskCompletionSource ;
2728
2829/**
2930 * Manages all *Eventually calls when the local datastore is enabled.
4041 /**
4142 * TCS that is held until a {@link ParseOperationSet} is completed.
4243 */
43- private HashMap <String , Task <JSONObject >. TaskCompletionSource > pendingOperationSetUUIDTasks =
44+ private HashMap <String , TaskCompletionSource <JSONObject >> pendingOperationSetUUIDTasks =
4445 new HashMap <>();
4546
4647 /**
6768 *
6869 * If an error is set, it means that we are trying to clear out the taskQueues.
6970 */
70- private Task <Void >. TaskCompletionSource connectionTaskCompletionSource = Task . create ();
71+ private TaskCompletionSource <Void > connectionTaskCompletionSource = new TaskCompletionSource <> ();
7172 private final Object connectionLock = new Object ();
7273 private final ParseHttpClient httpClient ;
7374
@@ -129,7 +130,7 @@ public int pendingCount() {
129130 }
130131
131132 public Task <Integer > pendingCountAsync () {
132- final Task <Integer >. TaskCompletionSource tcs = Task . create ();
133+ final TaskCompletionSource <Integer > tcs = new TaskCompletionSource <> ();
133134
134135 taskQueue .enqueue (new Continuation <Void , Task <Void >>() {
135136 @ Override
@@ -218,7 +219,7 @@ private Task<Void> waitForConnectionAsync() {
218219 public Task <JSONObject > enqueueEventuallyAsync (final ParseRESTCommand command ,
219220 final ParseObject object ) {
220221 Parse .requirePermission (Manifest .permission .ACCESS_NETWORK_STATE );
221- final Task <JSONObject >. TaskCompletionSource tcs = Task . create ();
222+ final TaskCompletionSource <JSONObject > tcs = new TaskCompletionSource <> ();
222223
223224 taskQueue .enqueue (new Continuation <Void , Task <Void >>() {
224225 @ Override
@@ -231,7 +232,7 @@ public Task<Void> then(Task<Void> toAwait) throws Exception {
231232 }
232233
233234 private Task <Void > enqueueEventuallyAsync (final ParseRESTCommand command ,
234- final ParseObject object , Task <Void > toAwait , final Task <JSONObject >. TaskCompletionSource tcs ) {
235+ final ParseObject object , Task <Void > toAwait , final TaskCompletionSource <JSONObject > tcs ) {
235236 return toAwait .continueWithTask (new Continuation <Void , Task <Void >>() {
236237 @ Override
237238 public Task <Void > then (Task <Void > toAwait ) throws Exception {
@@ -373,7 +374,7 @@ public Task<Void> then(Task<JSONObject> task) throws Exception {
373374 notifyTestHelper (TestHelper .COMMAND_SUCCESSFUL );
374375 }
375376
376- Task <JSONObject >. TaskCompletionSource tcs =
377+ TaskCompletionSource <JSONObject > tcs =
377378 pendingOperationSetUUIDTasks .remove (eventuallyPin .getUUID ());
378379 if (tcs != null ) {
379380 if (error != null ) {
@@ -397,7 +398,7 @@ public Task<Void> then(Task<JSONObject> task) throws Exception {
397398 /**
398399 * Map of eventually operation UUID to TCS that is resolved when the operation is complete.
399400 */
400- private HashMap <String , Task <JSONObject >. TaskCompletionSource > pendingEventuallyTasks =
401+ private HashMap <String , TaskCompletionSource <JSONObject >> pendingEventuallyTasks =
401402 new HashMap <>();
402403
403404 /**
@@ -429,7 +430,7 @@ public Task<Void> then(Task<JSONObject> task) throws Exception {
429430 }
430431
431432 final String uuid ; // The key we use to join the taskQueues
432- final Task <JSONObject >. TaskCompletionSource tcs ;
433+ final TaskCompletionSource <JSONObject > tcs ;
433434
434435 synchronized (taskQueueSyncLock ) {
435436 if (operationSet != null && eventuallyPin == null ) {
0 commit comments