Skip to content

Commit

Permalink
Remove synthetic accessor method generation by incresing visibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Dec 22, 2015
1 parent c7090c9 commit fb4c5c8
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private CallAdapter<Observable<?>> getCallAdapter(Type returnType) {
static final class CallOnSubscribe<T> implements Observable.OnSubscribe<Response<T>> {
private final Call<T> originalCall;

private CallOnSubscribe(Call<T> originalCall) {
CallOnSubscribe(Call<T> originalCall) {
this.originalCall = originalCall;
}

Expand Down
10 changes: 5 additions & 5 deletions retrofit-mock/src/main/java/retrofit2/mock/BehaviorCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
import static java.util.concurrent.TimeUnit.MILLISECONDS;

final class BehaviorCall<T> implements Call<T> {
private final NetworkBehavior behavior;
private final ExecutorService backgroundExecutor;
private final Call<T> delegate;
final NetworkBehavior behavior;
final ExecutorService backgroundExecutor;
final Call<T> delegate;

private volatile Future<?> task;
private volatile boolean canceled;
volatile boolean canceled;
private volatile boolean executed;

BehaviorCall(NetworkBehavior behavior, ExecutorService backgroundExecutor, Call<T> delegate) {
Expand All @@ -52,7 +52,7 @@ final class BehaviorCall<T> implements Call<T> {
executed = true;
}
task = backgroundExecutor.submit(new Runnable() {
private boolean delaySleep() {
boolean delaySleep() {
long sleepMs = behavior.calculateDelay(MILLISECONDS);
if (sleepMs > 0) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @see MockRetrofit#create(Class)
*/
public final class BehaviorDelegate<T> {
private final Retrofit retrofit;
final Retrofit retrofit;
private final NetworkBehavior behavior;
private final ExecutorService executor;
private final Class<T> service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.util.concurrent.Executor;

final class ExecutorCallAdapterFactory implements CallAdapter.Factory {
private final Executor callbackExecutor;
final Executor callbackExecutor;

ExecutorCallAdapterFactory(Executor callbackExecutor) {
this.callbackExecutor = callbackExecutor;
Expand All @@ -45,8 +45,8 @@ public CallAdapter<Call<?>> get(Type returnType, Annotation[] annotations, Retro
}

static final class ExecutorCallbackCall<T> implements Call<T> {
private final Executor callbackExecutor;
private final Call<T> delegate;
final Executor callbackExecutor;
final Call<T> delegate;

ExecutorCallbackCall(Executor callbackExecutor, Call<T> delegate) {
this.callbackExecutor = callbackExecutor;
Expand Down
4 changes: 2 additions & 2 deletions retrofit/src/main/java/retrofit2/OkHttpCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private com.squareup.okhttp.Call createRawCall() throws IOException {
return client.newCall(request.get());
}

private Response<T> parseResponse(com.squareup.okhttp.Response rawResponse) throws IOException {
Response<T> parseResponse(com.squareup.okhttp.Response rawResponse) throws IOException {
ResponseBody rawBody = rawResponse.body();

// Remove the body's source (the only stateful object) so we can pass the response along.
Expand Down Expand Up @@ -194,7 +194,7 @@ static final class NoContentResponseBody extends ResponseBody {

static final class ExceptionCatchingRequestBody extends ResponseBody {
private final ResponseBody delegate;
private IOException thrownException;
IOException thrownException;

ExceptionCatchingRequestBody(ResponseBody delegate) {
this.delegate = delegate;
Expand Down
6 changes: 3 additions & 3 deletions retrofit/src/main/java/retrofit2/Retrofit.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ public final class Retrofit {
private final Executor callbackExecutor;
private final boolean validateEagerly;

private Retrofit(Call.Factory callFactory, BaseUrl baseUrl,
List<Converter.Factory> converterFactories, List<CallAdapter.Factory> adapterFactories,
Executor callbackExecutor, boolean validateEagerly) {
Retrofit(Call.Factory callFactory, BaseUrl baseUrl, List<Converter.Factory> converterFactories,
List<CallAdapter.Factory> adapterFactories, Executor callbackExecutor,
boolean validateEagerly) {
this.callFactory = callFactory;
this.baseUrl = baseUrl;
this.converterFactories = converterFactories;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.lang.reflect.Type;

class ToStringConverterFactory extends Converter.Factory {
private static final MediaType MEDIA_TYPE = MediaType.parse("text/plain");
static final MediaType MEDIA_TYPE = MediaType.parse("text/plain");

@Override
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations,
Expand Down

0 comments on commit fb4c5c8

Please sign in to comment.