Skip to content

Commit

Permalink
Fix bolts duplicate classes (#1033)
Browse files Browse the repository at this point in the history
* fix bolts duplicate classes

renaming bolts-tasks module to fix naming conflict with legacy bolts library

* renamed bolts package
  • Loading branch information
mtrezza authored Jun 17, 2020
1 parent 59d1e3b commit 2af4d98
Show file tree
Hide file tree
Showing 116 changed files with 219 additions and 221 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

import java.io.PrintStream;
import java.io.PrintWriter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

import android.annotation.SuppressLint;
import android.os.Build;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

import java.util.Locale;
import java.util.concurrent.Executor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.CancellationException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

import java.io.Closeable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

import java.io.Closeable;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

/**
* Provides a class that can be used for capturing variables in an anonymous class implementation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

/**
* A function to be called after a task completes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

/**
* This is a wrapper class for emphasizing that task failed due to bad {@code Executor}, rather than
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

import java.util.ArrayList;
import java.util.Collection;
Expand Down Expand Up @@ -111,7 +111,7 @@ private Task(boolean cancelled) {
}

/**
* @deprecated Please use {@link bolts.TaskCompletionSource()} instead.
* @deprecated Please use {@link com.parse.boltsinternal.TaskCompletionSource ()} instead.
*/
public static <TResult> Task<TResult>.TaskCompletionSource create() {
Task<TResult> task = new Task<>();
Expand Down Expand Up @@ -208,7 +208,7 @@ public static <TResult> Task<TResult> forResult(TResult value) {
if (value instanceof Boolean) {
return (Task<TResult>) ((Boolean) value ? TASK_TRUE : TASK_FALSE);
}
bolts.TaskCompletionSource<TResult> tcs = new bolts.TaskCompletionSource<>();
com.parse.boltsinternal.TaskCompletionSource<TResult> tcs = new com.parse.boltsinternal.TaskCompletionSource<>();
tcs.setResult(value);
return tcs.getTask();
}
Expand All @@ -217,7 +217,7 @@ public static <TResult> Task<TResult> forResult(TResult value) {
* Creates a faulted task with the given error.
*/
public static <TResult> Task<TResult> forError(Exception error) {
bolts.TaskCompletionSource<TResult> tcs = new bolts.TaskCompletionSource<>();
com.parse.boltsinternal.TaskCompletionSource<TResult> tcs = new com.parse.boltsinternal.TaskCompletionSource<>();
tcs.setError(error);
return tcs.getTask();
}
Expand Down Expand Up @@ -262,7 +262,7 @@ static Task<Void> delay(long delay, ScheduledExecutorService executor, final Can
return Task.forResult(null);
}

final bolts.TaskCompletionSource<Void> tcs = new bolts.TaskCompletionSource<>();
final com.parse.boltsinternal.TaskCompletionSource<Void> tcs = new com.parse.boltsinternal.TaskCompletionSource<>();
final ScheduledFuture<?> scheduled = executor.schedule(new Runnable() {
@Override
public void run() {
Expand Down Expand Up @@ -343,7 +343,7 @@ public static <TResult> Task<TResult> call(final Callable<TResult> callable, Exe
*/
public static <TResult> Task<TResult> call(final Callable<TResult> callable, Executor executor,
final CancellationToken ct) {
final bolts.TaskCompletionSource<TResult> tcs = new bolts.TaskCompletionSource<>();
final com.parse.boltsinternal.TaskCompletionSource<TResult> tcs = new com.parse.boltsinternal.TaskCompletionSource<>();
try {
executor.execute(new Runnable() {
@Override
Expand Down Expand Up @@ -402,7 +402,7 @@ public static <TResult> Task<Task<TResult>> whenAnyResult(Collection<? extends T
return Task.forResult(null);
}

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

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

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

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

final bolts.TaskCompletionSource<Void> allFinished = new bolts.TaskCompletionSource<>();
final com.parse.boltsinternal.TaskCompletionSource<Void> allFinished = new com.parse.boltsinternal.TaskCompletionSource<>();
final ArrayList<Exception> causes = new ArrayList<>();
final Object errorLock = new Object();
final AtomicInteger count = new AtomicInteger(tasks.size());
Expand Down Expand Up @@ -642,7 +642,7 @@ public <TContinuationResult> Task<TContinuationResult> continueWith(
final Continuation<TResult, TContinuationResult> continuation, final Executor executor,
final CancellationToken ct) {
boolean completed;
final bolts.TaskCompletionSource<TContinuationResult> tcs = new bolts.TaskCompletionSource<>();
final com.parse.boltsinternal.TaskCompletionSource<TContinuationResult> tcs = new com.parse.boltsinternal.TaskCompletionSource<>();
synchronized (lock) {
completed = this.isCompleted();
if (!completed) {
Expand Down Expand Up @@ -696,7 +696,7 @@ public <TContinuationResult> Task<TContinuationResult> continueWithTask(
final Continuation<TResult, Task<TContinuationResult>> continuation, final Executor executor,
final CancellationToken ct) {
boolean completed;
final bolts.TaskCompletionSource<TContinuationResult> tcs = new bolts.TaskCompletionSource<>();
final com.parse.boltsinternal.TaskCompletionSource<TContinuationResult> tcs = new com.parse.boltsinternal.TaskCompletionSource<>();
synchronized (lock) {
completed = this.isCompleted();
if (!completed) {
Expand Down Expand Up @@ -850,7 +850,7 @@ public <TContinuationResult> Task<TContinuationResult> onSuccessTask(
* scheduled on a different thread).
*/
private static <TContinuationResult, TResult> void completeImmediately(
final bolts.TaskCompletionSource<TContinuationResult> tcs,
final com.parse.boltsinternal.TaskCompletionSource<TContinuationResult> tcs,
final Continuation<TResult, TContinuationResult> continuation, final Task<TResult> task,
Executor executor, final CancellationToken ct) {
try {
Expand Down Expand Up @@ -890,7 +890,7 @@ public void run() {
* scheduled on a different thread).
*/
private static <TContinuationResult, TResult> void completeAfterTask(
final bolts.TaskCompletionSource<TContinuationResult> tcs,
final com.parse.boltsinternal.TaskCompletionSource<TContinuationResult> tcs,
final Continuation<TResult, Task<TContinuationResult>> continuation,
final Task<TResult> task, final Executor executor,
final CancellationToken ct) {
Expand Down Expand Up @@ -1006,9 +1006,9 @@ private void runContinuations() {
}

/**
* @deprecated Please use {@link bolts.TaskCompletionSource} instead.
* @deprecated Please use {@link com.parse.boltsinternal.TaskCompletionSource} instead.
*/
public class TaskCompletionSource extends bolts.TaskCompletionSource<TResult> {
public class TaskCompletionSource extends com.parse.boltsinternal.TaskCompletionSource<TResult> {

/* package */ TaskCompletionSource() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

/**
* Allows safe orchestration of a task's completion, preventing the consumer from prematurely
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

/**
* This class is used to retain a faulted task until either its error is observed or it is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

/**
* Used to signify that a Task's error went unobserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

import org.junit.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package bolts;
package com.parse.boltsinternal;

import org.junit.Rule;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import java.util.Set;
import java.util.SimpleTimeZone;

import bolts.Task;
import com.parse.boltsinternal.Task;

class FacebookController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import java.util.Collections;
import java.util.Map;

import bolts.Continuation;
import bolts.Task;
import com.parse.boltsinternal.Continuation;
import com.parse.boltsinternal.Task;

/**
* Provides a set of utilities for using Parse with Facebook.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import java.util.Set;
import java.util.TimeZone;

import bolts.Task;
import com.parse.boltsinternal.Task;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import java.util.LinkedList;
import java.util.Map;

import bolts.Task;
import com.parse.boltsinternal.Task;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
Expand Down
2 changes: 1 addition & 1 deletion gcm/src/main/java/com/parse/gcm/ParseGCMJobService.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import java.util.concurrent.Callable;

import bolts.Task;
import com.parse.boltsinternal.Task;

/**
* Handles saving the GCM token to the Parse Installation
Expand Down
4 changes: 2 additions & 2 deletions google/src/main/java/com/parse/google/ParseGoogleUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.parse.google
import android.app.Activity
import android.content.Context
import android.content.Intent
import bolts.Continuation
import bolts.Task
import com.parse.boltsinternal.Continuation
import com.parse.boltsinternal.Task
import com.google.android.gms.auth.api.signin.GoogleSignIn
import com.google.android.gms.auth.api.signin.GoogleSignInAccount
import com.google.android.gms.auth.api.signin.GoogleSignInClient
Expand Down
2 changes: 1 addition & 1 deletion parse/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies {
api "androidx.annotation:annotation:1.1.0"
api "androidx.core:core:1.2.0"
api "com.squareup.okhttp3:okhttp:$okhttpVersion"
api project(":bolts-tasks")
api project(':bolts-tasks')

testImplementation "org.robolectric:robolectric:3.8"
testImplementation "org.skyscreamer:jsonassert:1.5.0"
Expand Down
4 changes: 2 additions & 2 deletions parse/src/main/java/com/parse/AbstractQueryController.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

import java.util.List;

import bolts.Continuation;
import bolts.Task;
import com.parse.boltsinternal.Continuation;
import com.parse.boltsinternal.Task;

/**
* {@code AbstractParseQueryController} is an abstract implementation of
Expand Down
4 changes: 2 additions & 2 deletions parse/src/main/java/com/parse/CacheQueryController.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import java.util.List;
import java.util.concurrent.Callable;

import bolts.Continuation;
import bolts.Task;
import com.parse.boltsinternal.Continuation;
import com.parse.boltsinternal.Task;

class CacheQueryController extends AbstractQueryController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
*/
package com.parse;

import bolts.Continuation;
import bolts.Task;
import com.parse.boltsinternal.Continuation;
import com.parse.boltsinternal.Task;

class CachedCurrentInstallationController
implements ParseCurrentInstallationController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import java.util.Arrays;
import java.util.Map;

import bolts.Continuation;
import bolts.Task;
import com.parse.boltsinternal.Continuation;
import com.parse.boltsinternal.Task;

class CachedCurrentUserController implements ParseCurrentUserController {

Expand Down
4 changes: 2 additions & 2 deletions parse/src/main/java/com/parse/EventuallyPin.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import java.util.List;
import java.util.UUID;

import bolts.Continuation;
import bolts.Task;
import com.parse.boltsinternal.Continuation;
import com.parse.boltsinternal.Task;

/**
* Properties
Expand Down
2 changes: 1 addition & 1 deletion parse/src/main/java/com/parse/FileObjectStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.io.IOException;
import java.util.concurrent.Callable;

import bolts.Task;
import com.parse.boltsinternal.Task;

class FileObjectStore<T extends ParseObject> implements ParseObjectStore<T> {

Expand Down
Loading

0 comments on commit 2af4d98

Please sign in to comment.