Buggy code:
public class LoginActivity extends BaseActivity { static final String QUERY_CODE = "code" ; static final int REQUEST_OAUTH = 1 ; @ Inject JobManager jobManager ; @ Inject Bus bus ; @ InjectView ( id . buttonContainer ) View buttonContainer ; @ InjectView ( id . error_message ) TextView errorMessage ; @ InjectView ( id . login ) Button login ; @ InjectView ( id . progressContainer ) View progressContainer ; private boolean fetchingToken ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { } @ Subscribe public void onFetchingTokenEvent ( LoginActivity . FetchingTokenEvent event ) { } @ Subscribe public void onTokenFetched ( LoginActivity . TokenFetchedEvent event ) { } @ Subscribe public void onFetchingTokenFailedEvent ( LoginActivity . FetchingTokenFailedEvent event ) { } private static class Result { boolean success ; String token ; int errorMessage ; private Result ( String token ) { } public Result ( int errorMessage ) { } } public static class TokenTask extends AsyncTask < String , Void , LoginActivity . Result > { @ Inject AuthorizationService authorizationService ; @ Inject UsersService usersService ; @ Inject UserToken userToken ; @ Inject Bus bus ; final Context context ; public TokenTask ( Context context ) { } @ Produce public LoginActivity . FetchingTokenEvent produceFetchingTokenEvent ( ) { } @ Override protected LoginActivity . Result doInBackground ( String ... params ) { String code = params [ 0 ] ; try { final AccessToken token = authorizationService . getToken ( new net . simonvt . cathode . api . entity . TokenRequest ( code , BuildConfig . TRAKT_CLIENT_ID , BuildConfig . TRAKT_SECRET , BuildConfig . TRAKT_REDIRECT_URL , GrantType . AUTHORIZATION_CODE ) ) ; final String accessToken = token . getAccessToken ( ) ; final SharedPreferences settings = PreferenceManager . getDefaultSharedPreferences ( context ) ; settings . edit ( ) . putString ( TRAKT_TOKEN , accessToken ) . apply ( ) ; userToken . setToken ( accessToken ) ; final UserSettings userSettings = usersService . getUserSettings ( ) ; Settings . clearProfile ( context ) ; Settings . updateProfile ( context , userSettings ) ; return new LoginActivity . Result ( accessToken ) ; } catch ( RetrofitError e ) { switch ( e . getKind ( ) ) { case NETWORK : <START_BUG> return new LoginActivity . Result ( string . error_network ) ; <END_BUG> case HTTP : Response response = e . getResponse ( ) ; if ( response != null ) { int status = response . getStatus ( ) ; if ( ( status >= 500 ) && ( status < 600 ) ) { return new LoginActivity . Result ( string . login_error_5xx ) ; } } case CONVERSION : case UNEXPECTED : } Timber . e ( e , "Unable<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>token" ) ; return new LoginActivity . Result ( string . login_error_unknown ) ; } } @ Override protected void onPostExecute ( LoginActivity . Result result ) { } } public static class FetchingTokenEvent { private boolean fetchingToken ; public FetchingTokenEvent ( boolean fetchingToken ) { } public boolean isFetchingToken ( ) { } } public static class TokenFetchedEvent { private String token ; public TokenFetchedEvent ( String token ) { } public String getToken ( ) { } } public static class FetchingTokenFailedEvent { private int error ; public FetchingTokenFailedEvent ( int error ) { } public int getError ( ) { } } }

Fix:
return new LoginActivity . Result ( string . login_error_network ) ;