Program: 59471
Project: 59471
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public UploadStatus processRequest(Context context,RequestParams params){
  final String requestId=params.getString("String_Node_Str",null);
  final String uri=params.getString("String_Node_Str",null);
  final String optionsAsString=params.getString("String_Node_Str",null);
  final int maxErrorRetries=params.getInt("String_Node_Str",MediaManager.get().getGlobalUploadPolicy().getMaxErrorRetries());
  final int errorCount=params.getInt("String_Node_Str",0);
  Logger.i(TAG,String.format("String_Node_Str",requestId));
  if (errorCount > maxErrorRetries) {
    Logger.d(TAG,String.format("String_Node_Str",requestId,errorCount,maxErrorRetries));
    return FAILURE;
  }
  callbackDispatcher.dispatchStart(requestId);
  callbackDispatcher.wakeListenerServiceWithRequestStart(context,requestId);
  UploadStatus requestResultStatus;
  final Context appContext=context.getApplicationContext();
  Map resultData=null;
  boolean optionsLoadedSuccessfully=false;
  Map<String,Object> options=null;
  try {
    options=UploadRequest.decodeOptions(optionsAsString);
    optionsLoadedSuccessfully=true;
  }
 catch (  Exception e) {
    Logger.e(TAG,String.format("String_Node_Str",requestId),e);
  }
  ErrorInfo error=null;
  if (optionsLoadedSuccessfully) {
    if (StringUtils.isNotBlank(uri)) {
      Payload payload=PayloadFactory.fromUri(uri);
      if (payload != null) {
        int maxConcurrentRequests=MediaManager.get().getGlobalUploadPolicy().getMaxConcurrentRequests();
        int runningJobsCount=runningJobs.get();
        if (runningJobsCount < maxConcurrentRequests) {
          try {
            runningJobs.incrementAndGet();
            resultData=doProcess(requestId,appContext,options,params,payload);
            requestResultStatus=SUCCESS;
          }
 catch (          FileNotFoundException e) {
            Logger.e(TAG,String.format("String_Node_Str",requestId),e);
            requestResultStatus=FAILURE;
            error=new ErrorInfo(ErrorInfo.FILE_DOES_NOT_EXIST,e.getMessage());
          }
catch (          LocalUriNotFoundException e) {
            Logger.e(TAG,String.format("String_Node_Str",requestId),e);
            requestResultStatus=FAILURE;
            error=new ErrorInfo(ErrorInfo.URI_DOES_NOT_EXIST,e.getMessage());
          }
catch (          ResourceNotFoundException e) {
            Logger.e(TAG,String.format("String_Node_Str",requestId),e);
            error=new ErrorInfo(ErrorInfo.RESOURCE_DOES_NOT_EXIST,e.getMessage());
            requestResultStatus=FAILURE;
          }
catch (          EmptyByteArrayException e) {
            Logger.e(TAG,String.format("String_Node_Str",requestId),e);
            requestResultStatus=FAILURE;
            error=new ErrorInfo(ErrorInfo.BYTE_ARRAY_PAYLOAD_EMPTY,e.getMessage());
          }
catch (          InterruptedIOException e) {
            Logger.e(TAG,String.format("String_Node_Str",requestId),e);
            error=new ErrorInfo(ErrorInfo.REQUEST_CANCELLED,"String_Node_Str");
            requestResultStatus=FAILURE;
          }
catch (          ErrorRetrievingSignatureException e) {
            Logger.e(TAG,String.format("String_Node_Str",requestId),e);
            requestResultStatus=FAILURE;
            error=new ErrorInfo(ErrorInfo.SIGNATURE_FAILURE,e.getMessage());
          }
catch (          IOException e) {
            Logger.e(TAG,String.format("String_Node_Str",requestId),e);
            error=new ErrorInfo(ErrorInfo.NETWORK_ERROR,e.getMessage());
            requestResultStatus=RESCHEDULE;
          }
catch (          Exception e) {
            Logger.e(TAG,String.format("String_Node_Str",requestId),e);
            error=new ErrorInfo(ErrorInfo.UNKNOWN_ERROR,e.getMessage());
            requestResultStatus=FAILURE;
          }
 finally {
            runningJobs.decrementAndGet();
          }
        }
 else {
          Logger.d(TAG,String.format("String_Node_Str",requestId,runningJobsCount,maxConcurrentRequests));
          requestResultStatus=RESCHEDULE;
        }
      }
 else {
        Logger.d(TAG,String.format("String_Node_Str",requestId));
        error=new ErrorInfo(ErrorInfo.PAYLOAD_LOAD_FAILURE,"String_Node_Str");
        requestResultStatus=FAILURE;
      }
    }
 else {
      requestResultStatus=FAILURE;
      error=new ErrorInfo(ErrorInfo.PAYLOAD_EMPTY,"String_Node_Str");
      Logger.d(TAG,String.format("String_Node_Str",requestId));
    }
  }
 else {
    requestResultStatus=FAILURE;
    error=new ErrorInfo(ErrorInfo.OPTIONS_FAILURE,"String_Node_Str");
    Logger.d(TAG,String.format("String_Node_Str",requestId));
  }
  if (requestResultStatus.isFinal()) {
    if (requestResultStatus == SUCCESS) {
      callbackDispatcher.dispatchSuccess(context,requestId,resultData);
    }
 else {
      callbackDispatcher.dispatchError(context,requestId,error);
    }
    callbackDispatcher.wakeListenerServiceWithRequestFinished(context,requestId,requestResultStatus);
  }
 else {
    callbackDispatcher.dispatchReschedule(context,requestId,error);
  }
  Logger.i(TAG,String.format("String_Node_Str",requestId,requestResultStatus));
  return requestResultStatus;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public UploadStatus processRequest(Context context,RequestParams params){
  final String requestId=params.getString("String_Node_Str",null);
  final String uri=params.getString("String_Node_Str",null);
  final String optionsAsString=params.getString("String_Node_Str",null);
  final int maxErrorRetries=params.getInt("String_Node_Str",MediaManager.get().getGlobalUploadPolicy().getMaxErrorRetries());
  final int errorCount=params.getInt("String_Node_Str",0);
  Logger.i(TAG,String.format("String_Node_Str",requestId));
  if (errorCount > maxErrorRetries) {
    Logger.d(TAG,String.format("String_Node_Str",requestId,errorCount,maxErrorRetries));
    return FAILURE;
  }
  callbackDispatcher.dispatchStart(requestId);
  callbackDispatcher.wakeListenerServiceWithRequestStart(context,requestId);
  UploadStatus requestResultStatus;
  final Context appContext=context.getApplicationContext();
  Map resultData=null;
  boolean optionsLoadedSuccessfully=false;
  Map<String,Object> options=null;
  try {
    options=UploadRequest.decodeOptions(optionsAsString);
    optionsLoadedSuccessfully=true;
  }
 catch (  Exception e) {
    Logger.e(TAG,String.format("String_Node_Str",requestId),e);
  }
  ErrorInfo error=null;
  if (optionsLoadedSuccessfully) {
    if (StringUtils.isNotBlank(uri)) {
      Payload payload=PayloadFactory.fromUri(uri);
      if (payload != null) {
        try {
          runningJobs.incrementAndGet();
          resultData=doProcess(requestId,appContext,options,params,payload);
          requestResultStatus=SUCCESS;
        }
 catch (        FileNotFoundException e) {
          Logger.e(TAG,String.format("String_Node_Str",requestId),e);
          requestResultStatus=FAILURE;
          error=new ErrorInfo(ErrorInfo.FILE_DOES_NOT_EXIST,e.getMessage());
        }
catch (        LocalUriNotFoundException e) {
          Logger.e(TAG,String.format("String_Node_Str",requestId),e);
          requestResultStatus=FAILURE;
          error=new ErrorInfo(ErrorInfo.URI_DOES_NOT_EXIST,e.getMessage());
        }
catch (        ResourceNotFoundException e) {
          Logger.e(TAG,String.format("String_Node_Str",requestId),e);
          error=new ErrorInfo(ErrorInfo.RESOURCE_DOES_NOT_EXIST,e.getMessage());
          requestResultStatus=FAILURE;
        }
catch (        EmptyByteArrayException e) {
          Logger.e(TAG,String.format("String_Node_Str",requestId),e);
          requestResultStatus=FAILURE;
          error=new ErrorInfo(ErrorInfo.BYTE_ARRAY_PAYLOAD_EMPTY,e.getMessage());
        }
catch (        InterruptedIOException e) {
          Logger.e(TAG,String.format("String_Node_Str",requestId),e);
          error=new ErrorInfo(ErrorInfo.REQUEST_CANCELLED,"String_Node_Str");
          requestResultStatus=FAILURE;
        }
catch (        ErrorRetrievingSignatureException e) {
          Logger.e(TAG,String.format("String_Node_Str",requestId),e);
          requestResultStatus=FAILURE;
          error=new ErrorInfo(ErrorInfo.SIGNATURE_FAILURE,e.getMessage());
        }
catch (        IOException e) {
          Logger.e(TAG,String.format("String_Node_Str",requestId),e);
          error=new ErrorInfo(ErrorInfo.NETWORK_ERROR,e.getMessage());
          requestResultStatus=RESCHEDULE;
        }
catch (        Exception e) {
          Logger.e(TAG,String.format("String_Node_Str",requestId),e);
          error=new ErrorInfo(ErrorInfo.UNKNOWN_ERROR,e.getMessage());
          requestResultStatus=FAILURE;
        }
 finally {
          runningJobs.decrementAndGet();
        }
      }
 else {
        Logger.d(TAG,String.format("String_Node_Str",requestId));
        error=new ErrorInfo(ErrorInfo.PAYLOAD_LOAD_FAILURE,"String_Node_Str");
        requestResultStatus=FAILURE;
      }
    }
 else {
      requestResultStatus=FAILURE;
      error=new ErrorInfo(ErrorInfo.PAYLOAD_EMPTY,"String_Node_Str");
      Logger.d(TAG,String.format("String_Node_Str",requestId));
    }
  }
 else {
    requestResultStatus=FAILURE;
    error=new ErrorInfo(ErrorInfo.OPTIONS_FAILURE,"String_Node_Str");
    Logger.d(TAG,String.format("String_Node_Str",requestId));
  }
  if (requestResultStatus.isFinal()) {
    if (requestResultStatus == SUCCESS) {
      callbackDispatcher.dispatchSuccess(context,requestId,resultData);
    }
 else {
      callbackDispatcher.dispatchError(context,requestId,error);
    }
    callbackDispatcher.wakeListenerServiceWithRequestFinished(context,requestId,requestResultStatus);
  }
 else {
    callbackDispatcher.dispatchReschedule(context,requestId,error);
  }
  Logger.i(TAG,String.format("String_Node_Str",requestId,requestResultStatus));
  return requestResultStatus;
}