Program: 161484
Project: 161484
Buggy source:
/** 
 * this fetch method will fetch the data from the TUMOnline Request and will address the listeners onFetch if the fetch succeeded, else the onFetchError will be called
 * @param context  the current context (may provide the current activity)
 * @param listener the listener, which takes the result
 */
public void fetchInteractive(final Context context,final TUMOnlineRequestFetchListener<T> listener){
  if (!loadAccessTokenFromPreferences(context)) {
    listener.onFetchCancelled();
  }
  backgroundTask=new AsyncTask<Void,Void,Optional<T>>(){
    @Override protected Optional<T> doInBackground(    Void... params){
      return fetch();
    }
    @Override protected void onPostExecute(    Optional<T> result){
      if (result.isPresent()) {
        Utils.logv("String_Node_Str" + result + '>');
      }
 else {
        Utils.log("String_Node_Str");
      }
      if (!NetUtils.isConnected(mContext)) {
        if (result.isPresent()) {
          Utils.showToast(mContext,R.string.no_internet_connection);
        }
 else {
          listener.onNoInternetError();
          return;
        }
      }
      if (!result.isPresent()) {
        String error;
        if (lastError.contains(TOKEN_NOT_CONFIRMED)) {
          error=context.getString(R.string.dialog_access_token_invalid);
        }
 else         if (lastError.contains(NO_FUNCTION_RIGHTS)) {
          error=context.getString(R.string.dialog_no_rights_function);
        }
 else         if (lastError.isEmpty()) {
          error=context.getString(R.string.empty_result);
        }
 else {
          error=lastError;
        }
        listener.onFetchError(error);
        return;
      }
      tumManager.releaseLock(TUMOnlineRequest.this.getRequestURL());
      listener.onFetch(result.get());
    }
  }
.execute();
}

Fixed version (ground truth):
/** 
 * this fetch method will fetch the data from the TUMOnline Request and will address the listeners onFetch if the fetch succeeded, else the onFetchError will be called
 * @param context  the current context (may provide the current activity)
 * @param listener the listener, which takes the result
 */
public void fetchInteractive(final Context context,final TUMOnlineRequestFetchListener<T> listener){
  if (!loadAccessTokenFromPreferences(context)) {
    listener.onFetchCancelled();
  }
  backgroundTask=new AsyncTask<Void,Void,Optional<T>>(){
    @Override protected Optional<T> doInBackground(    Void... params){
      return fetch();
    }
    @Override protected void onPostExecute(    Optional<T> result){
      if (result.isPresent()) {
        Utils.logv("String_Node_Str" + result + '>');
      }
 else {
        Utils.log("String_Node_Str");
      }
      if (!NetUtils.isConnected(mContext)) {
        if (result.isPresent()) {
          Utils.showToast(mContext,R.string.no_internet_connection);
        }
 else {
          listener.onNoInternetError();
          return;
        }
      }
      if (!result.isPresent()) {
        if (lastError.contains(NO_ENTRIES)) {
          listener.onNoDataToShow();
          return;
        }
        String error;
        if (lastError.contains(TOKEN_NOT_CONFIRMED)) {
          error=context.getString(R.string.dialog_access_token_invalid);
        }
 else         if (lastError.contains(NO_FUNCTION_RIGHTS)) {
          error=context.getString(R.string.dialog_no_rights_function);
        }
 else         if (lastError.isEmpty()) {
          error=context.getString(R.string.empty_result);
        }
 else {
          error=lastError;
        }
        listener.onFetchError(error);
        return;
      }
      tumManager.releaseLock(TUMOnlineRequest.this.getRequestURL());
      listener.onFetch(result.get());
    }
  }
.execute();
}