Program: 106111
Project: 106111
Buggy source:
protected Answer copyVolumeBetweenPools(DataObject srcData,DataObject destData){
  String value=configDao.getValue(Config.CopyVolumeWait.key());
  int _copyvolumewait=NumbersUtil.parseInt(value,Integer.parseInt(Config.CopyVolumeWait.getDefaultValue()));
  Scope destScope=getZoneScope(destData.getDataStore().getScope());
  DataStore cacheStore=cacheMgr.getCacheStorage(destScope);
  if (cacheStore == null) {
    ImageStoreEntity imageStore=(ImageStoreEntity)dataStoreMgr.getImageStore(destScope.getScopeId());
    if (!imageStore.getProtocol().equalsIgnoreCase("String_Node_Str") && !imageStore.getProtocol().equalsIgnoreCase("String_Node_Str")) {
      s_logger.debug("String_Node_Str");
      return null;
    }
    DataObject objOnImageStore=imageStore.create(srcData);
    objOnImageStore.processEvent(Event.CreateOnlyRequested);
    Answer answer=copyObject(srcData,objOnImageStore);
    if (answer == null || !answer.getResult()) {
      if (answer != null) {
        s_logger.debug("String_Node_Str" + answer.getDetails());
      }
      objOnImageStore.processEvent(Event.OperationFailed);
      imageStore.delete(objOnImageStore);
      return answer;
    }
    objOnImageStore.processEvent(Event.OperationSuccessed,answer);
    objOnImageStore.processEvent(Event.CopyingRequested);
    CopyCommand cmd=new CopyCommand(objOnImageStore.getTO(),destData.getTO(),_copyvolumewait,_mgmtServer.getExecuteInSequence());
    EndPoint ep=selector.select(objOnImageStore,destData);
    if (ep == null) {
      String errMsg="String_Node_Str";
      s_logger.error(errMsg);
      answer=new Answer(cmd,false,errMsg);
    }
 else {
      answer=ep.sendMessage(cmd);
    }
    if (answer == null || !answer.getResult()) {
      if (answer != null) {
        s_logger.debug("String_Node_Str" + answer.getDetails());
      }
      objOnImageStore.processEvent(Event.OperationFailed);
      imageStore.delete(objOnImageStore);
      return answer;
    }
    objOnImageStore.processEvent(Event.OperationSuccessed);
    imageStore.delete(objOnImageStore);
    return answer;
  }
 else {
    DataObject cacheData=cacheMgr.createCacheObject(srcData,destScope);
    CopyCommand cmd=new CopyCommand(cacheData.getTO(),destData.getTO(),_copyvolumewait,_mgmtServer.getExecuteInSequence());
    EndPoint ep=selector.select(cacheData,destData);
    Answer answer=null;
    if (ep == null) {
      String errMsg="String_Node_Str";
      s_logger.error(errMsg);
      answer=new Answer(cmd,false,errMsg);
    }
 else {
      answer=ep.sendMessage(cmd);
    }
    if (cacheData != null) {
      cacheMgr.deleteCacheObject(cacheData);
    }
    return answer;
  }
}

Fixed version (ground truth):
protected Answer copyVolumeBetweenPools(DataObject srcData,DataObject destData){
  String value=configDao.getValue(Config.CopyVolumeWait.key());
  int _copyvolumewait=NumbersUtil.parseInt(value,Integer.parseInt(Config.CopyVolumeWait.getDefaultValue()));
  Scope destScope=getZoneScope(destData.getDataStore().getScope());
  DataStore cacheStore=cacheMgr.getCacheStorage(destScope);
  if (cacheStore == null) {
    ImageStoreEntity imageStore=(ImageStoreEntity)dataStoreMgr.getImageStore(destScope.getScopeId());
    if (!imageStore.getProtocol().equalsIgnoreCase("String_Node_Str") && !imageStore.getProtocol().equalsIgnoreCase("String_Node_Str")) {
      s_logger.debug("String_Node_Str");
      return null;
    }
    DataObject objOnImageStore=imageStore.create(srcData);
    objOnImageStore.processEvent(Event.CreateOnlyRequested);
    Answer answer=copyObject(srcData,objOnImageStore);
    if (answer == null || !answer.getResult()) {
      if (answer != null) {
        s_logger.debug("String_Node_Str" + answer.getDetails());
      }
      objOnImageStore.processEvent(Event.OperationFailed);
      imageStore.delete(objOnImageStore);
      return answer;
    }
    objOnImageStore.processEvent(Event.OperationSuccessed,answer);
    objOnImageStore.processEvent(Event.CopyingRequested);
    CopyCommand cmd=new CopyCommand(objOnImageStore.getTO(),destData.getTO(),_copyvolumewait,VirtualMachineManager.ExecuteInSequence.value());
    EndPoint ep=selector.select(objOnImageStore,destData);
    if (ep == null) {
      String errMsg="String_Node_Str";
      s_logger.error(errMsg);
      answer=new Answer(cmd,false,errMsg);
    }
 else {
      answer=ep.sendMessage(cmd);
    }
    if (answer == null || !answer.getResult()) {
      if (answer != null) {
        s_logger.debug("String_Node_Str" + answer.getDetails());
      }
      objOnImageStore.processEvent(Event.OperationFailed);
      imageStore.delete(objOnImageStore);
      return answer;
    }
    objOnImageStore.processEvent(Event.OperationSuccessed);
    imageStore.delete(objOnImageStore);
    return answer;
  }
 else {
    DataObject cacheData=cacheMgr.createCacheObject(srcData,destScope);
    CopyCommand cmd=new CopyCommand(cacheData.getTO(),destData.getTO(),_copyvolumewait,VirtualMachineManager.ExecuteInSequence.value());
    EndPoint ep=selector.select(cacheData,destData);
    Answer answer=null;
    if (ep == null) {
      String errMsg="String_Node_Str";
      s_logger.error(errMsg);
      answer=new Answer(cmd,false,errMsg);
    }
 else {
      answer=ep.sendMessage(cmd);
    }
    if (cacheData != null) {
      cacheMgr.deleteCacheObject(cacheData);
    }
    return answer;
  }
}