package com.stablekernel.standardlib;

import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;

import java.io.IOException;

import retrofit.RetrofitError;

public abstract class AuthRetryInterceptor implements Interceptor {

    private static final String TAG = "AuthRetryInterceptor";
    private final Object lockObject = new Object();

    @Override
    public Response intercept(Chain chain) throws IOException {
        String token = getAccessToken();
        Request.Builder builder = chain.request().newBuilder();

        Response response;
        try {
            response = chain.proceed(builder.build());
        } catch (IOException e) {
            throw RetrofitError.networkError(e.getLocalizedMessage(), e);
        } catch (Throwable e) {
            throw RetrofitError.unexpectedError(e.getLocalizedMessage(), e);
        }

        if (response.code() == 401) {
            synchronized (lockObject) {
                String currentToken = getAccessToken();
                if (currentToken != null && currentToken.equals(token)) {
                    return performRefresh(chain, builder);
                }
            }
        }
        return response;
    }

    private Response performRefresh(Chain chain, Request.Builder builder) throws IOException {
        try {
            IOException exception = refreshAccessToken();
            Response response = chain.proceed(builder.build());
            if (response.code() < 200 || response.code() >= 300) {
                throw exception;
            }
            return response;
        } catch (IOException e) {
            performRefreshFailure(e);
            throw e;
        }
    }

    public abstract String getAccessToken();

    public abstract IOException refreshAccessToken();

    public abstract void performRefreshFailure(IOException e);
}

@@ -1725,29 +1725,32 @@
     %7D%0A%0A    p
-ublic
+rotected
  abstract St
@@ -1770,37 +1770,40 @@
 sToken();%0A%0A    p
-ublic
+rotected
  abstract IOExce
@@ -1836,21 +1836,24 @@
 ;%0A%0A    p
-ublic
+rotected
  abstrac

Clarify the usage of these method by making them protected.