Skip to content

Commit

Permalink
Add more obviously missing @nullable annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Mar 7, 2019
1 parent 239cd2f commit cb99817
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion retrofit-mock/src/main/java/retrofit2/mock/BehaviorCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.Nullable;
import javax.annotation.concurrent.GuardedBy;
import okhttp3.Request;
import retrofit2.Call;
Expand All @@ -33,7 +34,7 @@ final class BehaviorCall<T> implements Call<T> {
final ExecutorService backgroundExecutor;
final Call<T> delegate;

private volatile Future<?> task;
private volatile @Nullable Future<?> task;
volatile boolean canceled;
@GuardedBy("this")
private boolean executed;
Expand Down
2 changes: 1 addition & 1 deletion retrofit-mock/src/main/java/retrofit2/mock/Calls.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private static <T extends Throwable> T sneakyThrow2(Throwable t) throws T {

static final class DeferredCall<T> implements Call<T> {
private final Callable<Call<T>> callable;
private Call<T> delegate;
private @Nullable Call<T> delegate;

DeferredCall(Callable<Call<T>> callable) {
this.callable = callable;
Expand Down
5 changes: 3 additions & 2 deletions retrofit-mock/src/main/java/retrofit2/mock/MockRetrofit.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import javax.annotation.Nullable;
import retrofit2.Retrofit;

public final class MockRetrofit {
Expand Down Expand Up @@ -50,8 +51,8 @@ public <T> BehaviorDelegate<T> create(Class<T> service) {

public static final class Builder {
private final Retrofit retrofit;
private NetworkBehavior behavior;
private ExecutorService executor;
private @Nullable NetworkBehavior behavior;
private @Nullable ExecutorService executor;

@SuppressWarnings("ConstantConditions") // Guarding public API nullability.
public Builder(Retrofit retrofit) {
Expand Down

0 comments on commit cb99817

Please sign in to comment.