Program: 192655
Project: 192655
Buggy source:
/** 
 * Stops recognition for the given generic sound model.
 * @param modelId The identifier of the generic sound model for whichthe recognition is to be stopped.
 * @param listener The listener for the recognition events related to the given sound model.
 * @return One of {@link #STATUS_ERROR} or {@link #STATUS_OK}.
 */
int stopGenericRecognition(UUID modelId,IRecognitionStatusCallback listener){
  if (listener == null) {
    return STATUS_ERROR;
  }
synchronized (mLock) {
    ModelData modelData=mGenericModelDataMap.get(modelId);
    if (modelData == null) {
      Slog.w(TAG,"String_Node_Str" + modelId);
      return STATUS_ERROR;
    }
    IRecognitionStatusCallback currentCallback=modelData.getCallback();
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + modelId + "String_Node_Str"+ listener.asBinder());
      Slog.d(TAG,"String_Node_Str" + (currentCallback == null ? "String_Node_Str" : currentCallback.asBinder()));
    }
    if (mModuleProperties == null || mModule == null) {
      Slog.w(TAG,"String_Node_Str");
      return STATUS_ERROR;
    }
    if (currentCallback == null || !modelData.modelStarted()) {
      Slog.w(TAG,"String_Node_Str");
      return STATUS_ERROR;
    }
    if (currentCallback.asBinder() != listener.asBinder()) {
      Slog.w(TAG,"String_Node_Str");
      return STATUS_ERROR;
    }
    int status=stopGenericRecognitionLocked(modelData,false);
    if (status != SoundTrigger.STATUS_OK) {
      return status;
    }
    modelData.clearState();
    modelData.clearCallback();
    if (!computeRecognitionRunning()) {
      internalClearGlobalStateLocked();
    }
    return status;
  }
}

Fixed version (ground truth):
/** 
 * Stops recognition for the given generic sound model.
 * @param modelId The identifier of the generic sound model for whichthe recognition is to be stopped.
 * @param listener The listener for the recognition events related to the given sound model.
 * @return One of {@link #STATUS_ERROR} or {@link #STATUS_OK}.
 */
int stopGenericRecognition(UUID modelId,IRecognitionStatusCallback listener){
  if (listener == null) {
    return STATUS_ERROR;
  }
synchronized (mLock) {
    ModelData modelData=mGenericModelDataMap.get(modelId);
    if (modelData == null) {
      Slog.w(TAG,"String_Node_Str" + modelId);
      return STATUS_ERROR;
    }
    IRecognitionStatusCallback currentCallback=modelData.getCallback();
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + modelId + "String_Node_Str"+ listener.asBinder());
      Slog.d(TAG,"String_Node_Str" + (currentCallback == null ? "String_Node_Str" : currentCallback.asBinder()));
    }
    if (mModuleProperties == null || mModule == null) {
      Slog.w(TAG,"String_Node_Str");
      return STATUS_ERROR;
    }
    if (currentCallback == null || !modelData.isModelStarted()) {
      Slog.w(TAG,"String_Node_Str");
      return STATUS_ERROR;
    }
    if (currentCallback.asBinder() != listener.asBinder()) {
      Slog.w(TAG,"String_Node_Str");
      return STATUS_ERROR;
    }
    int status=stopGenericRecognitionLocked(modelData,false);
    if (status != SoundTrigger.STATUS_OK) {
      return status;
    }
    modelData.clearState();
    modelData.clearCallback();
    if (!computeRecognitionRunning()) {
      internalClearGlobalStateLocked();
    }
    return status;
  }
}