Skip to content

Commit 2af4d98

Browse files
authored
Fix bolts duplicate classes (#1033)
* fix bolts duplicate classes renaming bolts-tasks module to fix naming conflict with legacy bolts library * renamed bolts package
1 parent 59d1e3b commit 2af4d98

File tree

116 files changed

+219
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+219
-221
lines changed

bolts-tasks/src/main/java/bolts/AggregateException.java renamed to bolts-tasks/src/main/java/com/parse/boltsinternal/AggregateException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
package bolts;
7+
package com.parse.boltsinternal;
88

99
import java.io.PrintStream;
1010
import java.io.PrintWriter;

bolts-tasks/src/main/java/bolts/AndroidExecutors.java renamed to bolts-tasks/src/main/java/com/parse/boltsinternal/AndroidExecutors.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
package bolts;
7+
package com.parse.boltsinternal;
88

99
import android.annotation.SuppressLint;
1010
import android.os.Build;

bolts-tasks/src/main/java/bolts/BoltsExecutors.java renamed to bolts-tasks/src/main/java/com/parse/boltsinternal/BoltsExecutors.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
package bolts;
7+
package com.parse.boltsinternal;
88

99
import java.util.Locale;
1010
import java.util.concurrent.Executor;

bolts-tasks/src/main/java/bolts/CancellationToken.java renamed to bolts-tasks/src/main/java/com/parse/boltsinternal/CancellationToken.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
package bolts;
7+
package com.parse.boltsinternal;
88

9-
import java.util.ArrayList;
10-
import java.util.List;
119
import java.util.Locale;
1210
import java.util.concurrent.CancellationException;
1311

bolts-tasks/src/main/java/bolts/CancellationTokenRegistration.java renamed to bolts-tasks/src/main/java/com/parse/boltsinternal/CancellationTokenRegistration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
package bolts;
7+
package com.parse.boltsinternal;
88

99
import java.io.Closeable;
1010

bolts-tasks/src/main/java/bolts/CancellationTokenSource.java renamed to bolts-tasks/src/main/java/com/parse/boltsinternal/CancellationTokenSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
package bolts;
7+
package com.parse.boltsinternal;
88

99
import java.io.Closeable;
1010
import java.util.ArrayList;

bolts-tasks/src/main/java/bolts/Capture.java renamed to bolts-tasks/src/main/java/com/parse/boltsinternal/Capture.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
package bolts;
7+
package com.parse.boltsinternal;
88

99
/**
1010
* Provides a class that can be used for capturing variables in an anonymous class implementation.

bolts-tasks/src/main/java/bolts/Continuation.java renamed to bolts-tasks/src/main/java/com/parse/boltsinternal/Continuation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
package bolts;
7+
package com.parse.boltsinternal;
88

99
/**
1010
* A function to be called after a task completes.

bolts-tasks/src/main/java/bolts/ExecutorException.java renamed to bolts-tasks/src/main/java/com/parse/boltsinternal/ExecutorException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
package bolts;
7+
package com.parse.boltsinternal;
88

99
/**
1010
* This is a wrapper class for emphasizing that task failed due to bad {@code Executor}, rather than

bolts-tasks/src/main/java/bolts/Task.java renamed to bolts-tasks/src/main/java/com/parse/boltsinternal/Task.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
package bolts;
7+
package com.parse.boltsinternal;
88

99
import java.util.ArrayList;
1010
import java.util.Collection;
@@ -111,7 +111,7 @@ private Task(boolean cancelled) {
111111
}
112112

113113
/**
114-
* @deprecated Please use {@link bolts.TaskCompletionSource()} instead.
114+
* @deprecated Please use {@link com.parse.boltsinternal.TaskCompletionSource ()} instead.
115115
*/
116116
public static <TResult> Task<TResult>.TaskCompletionSource create() {
117117
Task<TResult> task = new Task<>();
@@ -208,7 +208,7 @@ public static <TResult> Task<TResult> forResult(TResult value) {
208208
if (value instanceof Boolean) {
209209
return (Task<TResult>) ((Boolean) value ? TASK_TRUE : TASK_FALSE);
210210
}
211-
bolts.TaskCompletionSource<TResult> tcs = new bolts.TaskCompletionSource<>();
211+
com.parse.boltsinternal.TaskCompletionSource<TResult> tcs = new com.parse.boltsinternal.TaskCompletionSource<>();
212212
tcs.setResult(value);
213213
return tcs.getTask();
214214
}
@@ -217,7 +217,7 @@ public static <TResult> Task<TResult> forResult(TResult value) {
217217
* Creates a faulted task with the given error.
218218
*/
219219
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<>();
221221
tcs.setError(error);
222222
return tcs.getTask();
223223
}
@@ -262,7 +262,7 @@ static Task<Void> delay(long delay, ScheduledExecutorService executor, final Can
262262
return Task.forResult(null);
263263
}
264264

265-
final bolts.TaskCompletionSource<Void> tcs = new bolts.TaskCompletionSource<>();
265+
final com.parse.boltsinternal.TaskCompletionSource<Void> tcs = new com.parse.boltsinternal.TaskCompletionSource<>();
266266
final ScheduledFuture<?> scheduled = executor.schedule(new Runnable() {
267267
@Override
268268
public void run() {
@@ -343,7 +343,7 @@ public static <TResult> Task<TResult> call(final Callable<TResult> callable, Exe
343343
*/
344344
public static <TResult> Task<TResult> call(final Callable<TResult> callable, Executor executor,
345345
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<>();
347347
try {
348348
executor.execute(new Runnable() {
349349
@Override
@@ -402,7 +402,7 @@ public static <TResult> Task<Task<TResult>> whenAnyResult(Collection<? extends T
402402
return Task.forResult(null);
403403
}
404404

405-
final bolts.TaskCompletionSource<Task<TResult>> firstCompleted = new bolts.TaskCompletionSource<>();
405+
final com.parse.boltsinternal.TaskCompletionSource<Task<TResult>> firstCompleted = new com.parse.boltsinternal.TaskCompletionSource<>();
406406
final AtomicBoolean isAnyTaskComplete = new AtomicBoolean(false);
407407

408408
for (Task<TResult> task : tasks) {
@@ -438,7 +438,7 @@ public static Task<Task<?>> whenAny(Collection<? extends Task<?>> tasks) {
438438
return Task.forResult(null);
439439
}
440440

441-
final bolts.TaskCompletionSource<Task<?>> firstCompleted = new bolts.TaskCompletionSource<>();
441+
final com.parse.boltsinternal.TaskCompletionSource<Task<?>> firstCompleted = new com.parse.boltsinternal.TaskCompletionSource<>();
442442
final AtomicBoolean isAnyTaskComplete = new AtomicBoolean(false);
443443

444444
for (Task<?> task : tasks) {
@@ -524,7 +524,7 @@ public static Task<Void> whenAll(Collection<? extends Task<?>> tasks) {
524524
return Task.forResult(null);
525525
}
526526

527-
final bolts.TaskCompletionSource<Void> allFinished = new bolts.TaskCompletionSource<>();
527+
final com.parse.boltsinternal.TaskCompletionSource<Void> allFinished = new com.parse.boltsinternal.TaskCompletionSource<>();
528528
final ArrayList<Exception> causes = new ArrayList<>();
529529
final Object errorLock = new Object();
530530
final AtomicInteger count = new AtomicInteger(tasks.size());
@@ -642,7 +642,7 @@ public <TContinuationResult> Task<TContinuationResult> continueWith(
642642
final Continuation<TResult, TContinuationResult> continuation, final Executor executor,
643643
final CancellationToken ct) {
644644
boolean completed;
645-
final bolts.TaskCompletionSource<TContinuationResult> tcs = new bolts.TaskCompletionSource<>();
645+
final com.parse.boltsinternal.TaskCompletionSource<TContinuationResult> tcs = new com.parse.boltsinternal.TaskCompletionSource<>();
646646
synchronized (lock) {
647647
completed = this.isCompleted();
648648
if (!completed) {
@@ -696,7 +696,7 @@ public <TContinuationResult> Task<TContinuationResult> continueWithTask(
696696
final Continuation<TResult, Task<TContinuationResult>> continuation, final Executor executor,
697697
final CancellationToken ct) {
698698
boolean completed;
699-
final bolts.TaskCompletionSource<TContinuationResult> tcs = new bolts.TaskCompletionSource<>();
699+
final com.parse.boltsinternal.TaskCompletionSource<TContinuationResult> tcs = new com.parse.boltsinternal.TaskCompletionSource<>();
700700
synchronized (lock) {
701701
completed = this.isCompleted();
702702
if (!completed) {
@@ -850,7 +850,7 @@ public <TContinuationResult> Task<TContinuationResult> onSuccessTask(
850850
* scheduled on a different thread).
851851
*/
852852
private static <TContinuationResult, TResult> void completeImmediately(
853-
final bolts.TaskCompletionSource<TContinuationResult> tcs,
853+
final com.parse.boltsinternal.TaskCompletionSource<TContinuationResult> tcs,
854854
final Continuation<TResult, TContinuationResult> continuation, final Task<TResult> task,
855855
Executor executor, final CancellationToken ct) {
856856
try {
@@ -890,7 +890,7 @@ public void run() {
890890
* scheduled on a different thread).
891891
*/
892892
private static <TContinuationResult, TResult> void completeAfterTask(
893-
final bolts.TaskCompletionSource<TContinuationResult> tcs,
893+
final com.parse.boltsinternal.TaskCompletionSource<TContinuationResult> tcs,
894894
final Continuation<TResult, Task<TContinuationResult>> continuation,
895895
final Task<TResult> task, final Executor executor,
896896
final CancellationToken ct) {
@@ -1006,9 +1006,9 @@ private void runContinuations() {
10061006
}
10071007

10081008
/**
1009-
* @deprecated Please use {@link bolts.TaskCompletionSource} instead.
1009+
* @deprecated Please use {@link com.parse.boltsinternal.TaskCompletionSource} instead.
10101010
*/
1011-
public class TaskCompletionSource extends bolts.TaskCompletionSource<TResult> {
1011+
public class TaskCompletionSource extends com.parse.boltsinternal.TaskCompletionSource<TResult> {
10121012

10131013
/* package */ TaskCompletionSource() {
10141014
}

0 commit comments

Comments
 (0)