4
4
* This source code is licensed under the MIT license found in the
5
5
* LICENSE file in the root directory of this source tree.
6
6
*/
7
- package bolts ;
7
+ package com . parse . boltsinternal ;
8
8
9
9
import java .util .ArrayList ;
10
10
import java .util .Collection ;
@@ -111,7 +111,7 @@ private Task(boolean cancelled) {
111
111
}
112
112
113
113
/**
114
- * @deprecated Please use {@link bolts. TaskCompletionSource()} instead.
114
+ * @deprecated Please use {@link com.parse.boltsinternal. TaskCompletionSource ()} instead.
115
115
*/
116
116
public static <TResult > Task <TResult >.TaskCompletionSource create () {
117
117
Task <TResult > task = new Task <>();
@@ -208,7 +208,7 @@ public static <TResult> Task<TResult> forResult(TResult value) {
208
208
if (value instanceof Boolean ) {
209
209
return (Task <TResult >) ((Boolean ) value ? TASK_TRUE : TASK_FALSE );
210
210
}
211
- bolts . TaskCompletionSource <TResult > tcs = new bolts .TaskCompletionSource <>();
211
+ com . parse . boltsinternal . TaskCompletionSource <TResult > tcs = new com . parse . boltsinternal .TaskCompletionSource <>();
212
212
tcs .setResult (value );
213
213
return tcs .getTask ();
214
214
}
@@ -217,7 +217,7 @@ public static <TResult> Task<TResult> forResult(TResult value) {
217
217
* Creates a faulted task with the given error.
218
218
*/
219
219
public static <TResult > Task <TResult > forError (Exception error ) {
220
- bolts . TaskCompletionSource <TResult > tcs = new bolts .TaskCompletionSource <>();
220
+ com . parse . boltsinternal . TaskCompletionSource <TResult > tcs = new com . parse . boltsinternal .TaskCompletionSource <>();
221
221
tcs .setError (error );
222
222
return tcs .getTask ();
223
223
}
@@ -262,7 +262,7 @@ static Task<Void> delay(long delay, ScheduledExecutorService executor, final Can
262
262
return Task .forResult (null );
263
263
}
264
264
265
- final bolts . TaskCompletionSource <Void > tcs = new bolts .TaskCompletionSource <>();
265
+ final com . parse . boltsinternal . TaskCompletionSource <Void > tcs = new com . parse . boltsinternal .TaskCompletionSource <>();
266
266
final ScheduledFuture <?> scheduled = executor .schedule (new Runnable () {
267
267
@ Override
268
268
public void run () {
@@ -343,7 +343,7 @@ public static <TResult> Task<TResult> call(final Callable<TResult> callable, Exe
343
343
*/
344
344
public static <TResult > Task <TResult > call (final Callable <TResult > callable , Executor executor ,
345
345
final CancellationToken ct ) {
346
- final bolts . TaskCompletionSource <TResult > tcs = new bolts .TaskCompletionSource <>();
346
+ final com . parse . boltsinternal . TaskCompletionSource <TResult > tcs = new com . parse . boltsinternal .TaskCompletionSource <>();
347
347
try {
348
348
executor .execute (new Runnable () {
349
349
@ Override
@@ -402,7 +402,7 @@ public static <TResult> Task<Task<TResult>> whenAnyResult(Collection<? extends T
402
402
return Task .forResult (null );
403
403
}
404
404
405
- final bolts . TaskCompletionSource <Task <TResult >> firstCompleted = new bolts .TaskCompletionSource <>();
405
+ final com . parse . boltsinternal . TaskCompletionSource <Task <TResult >> firstCompleted = new com . parse . boltsinternal .TaskCompletionSource <>();
406
406
final AtomicBoolean isAnyTaskComplete = new AtomicBoolean (false );
407
407
408
408
for (Task <TResult > task : tasks ) {
@@ -438,7 +438,7 @@ public static Task<Task<?>> whenAny(Collection<? extends Task<?>> tasks) {
438
438
return Task .forResult (null );
439
439
}
440
440
441
- final bolts . TaskCompletionSource <Task <?>> firstCompleted = new bolts .TaskCompletionSource <>();
441
+ final com . parse . boltsinternal . TaskCompletionSource <Task <?>> firstCompleted = new com . parse . boltsinternal .TaskCompletionSource <>();
442
442
final AtomicBoolean isAnyTaskComplete = new AtomicBoolean (false );
443
443
444
444
for (Task <?> task : tasks ) {
@@ -524,7 +524,7 @@ public static Task<Void> whenAll(Collection<? extends Task<?>> tasks) {
524
524
return Task .forResult (null );
525
525
}
526
526
527
- final bolts . TaskCompletionSource <Void > allFinished = new bolts .TaskCompletionSource <>();
527
+ final com . parse . boltsinternal . TaskCompletionSource <Void > allFinished = new com . parse . boltsinternal .TaskCompletionSource <>();
528
528
final ArrayList <Exception > causes = new ArrayList <>();
529
529
final Object errorLock = new Object ();
530
530
final AtomicInteger count = new AtomicInteger (tasks .size ());
@@ -642,7 +642,7 @@ public <TContinuationResult> Task<TContinuationResult> continueWith(
642
642
final Continuation <TResult , TContinuationResult > continuation , final Executor executor ,
643
643
final CancellationToken ct ) {
644
644
boolean completed ;
645
- final bolts . TaskCompletionSource <TContinuationResult > tcs = new bolts .TaskCompletionSource <>();
645
+ final com . parse . boltsinternal . TaskCompletionSource <TContinuationResult > tcs = new com . parse . boltsinternal .TaskCompletionSource <>();
646
646
synchronized (lock ) {
647
647
completed = this .isCompleted ();
648
648
if (!completed ) {
@@ -696,7 +696,7 @@ public <TContinuationResult> Task<TContinuationResult> continueWithTask(
696
696
final Continuation <TResult , Task <TContinuationResult >> continuation , final Executor executor ,
697
697
final CancellationToken ct ) {
698
698
boolean completed ;
699
- final bolts . TaskCompletionSource <TContinuationResult > tcs = new bolts .TaskCompletionSource <>();
699
+ final com . parse . boltsinternal . TaskCompletionSource <TContinuationResult > tcs = new com . parse . boltsinternal .TaskCompletionSource <>();
700
700
synchronized (lock ) {
701
701
completed = this .isCompleted ();
702
702
if (!completed ) {
@@ -850,7 +850,7 @@ public <TContinuationResult> Task<TContinuationResult> onSuccessTask(
850
850
* scheduled on a different thread).
851
851
*/
852
852
private static <TContinuationResult , TResult > void completeImmediately (
853
- final bolts .TaskCompletionSource <TContinuationResult > tcs ,
853
+ final com . parse . boltsinternal .TaskCompletionSource <TContinuationResult > tcs ,
854
854
final Continuation <TResult , TContinuationResult > continuation , final Task <TResult > task ,
855
855
Executor executor , final CancellationToken ct ) {
856
856
try {
@@ -890,7 +890,7 @@ public void run() {
890
890
* scheduled on a different thread).
891
891
*/
892
892
private static <TContinuationResult , TResult > void completeAfterTask (
893
- final bolts .TaskCompletionSource <TContinuationResult > tcs ,
893
+ final com . parse . boltsinternal .TaskCompletionSource <TContinuationResult > tcs ,
894
894
final Continuation <TResult , Task <TContinuationResult >> continuation ,
895
895
final Task <TResult > task , final Executor executor ,
896
896
final CancellationToken ct ) {
@@ -1006,9 +1006,9 @@ private void runContinuations() {
1006
1006
}
1007
1007
1008
1008
/**
1009
- * @deprecated Please use {@link bolts .TaskCompletionSource} instead.
1009
+ * @deprecated Please use {@link com.parse.boltsinternal .TaskCompletionSource} instead.
1010
1010
*/
1011
- public class TaskCompletionSource extends bolts .TaskCompletionSource <TResult > {
1011
+ public class TaskCompletionSource extends com . parse . boltsinternal .TaskCompletionSource <TResult > {
1012
1012
1013
1013
/* package */ TaskCompletionSource () {
1014
1014
}
0 commit comments