Program: 105350
Project: 105350
Buggy source:
private boolean validateVolume(Account caller,long ownerId,Long zoneId,String volumeName,String url,String format,Long diskOfferingId) throws ResourceAllocationException {
  Account volumeOwner=_accountMgr.getActiveAccountById(ownerId);
  _accountMgr.checkAccess(caller,null,true,volumeOwner);
  _resourceLimitMgr.checkResourceLimit(volumeOwner,ResourceType.volume);
  DataCenterVO zone=_dcDao.findById(zoneId);
  if (zone == null) {
    throw new InvalidParameterValueException("String_Node_Str" + zoneId);
  }
  if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(caller.getId())) {
    throw new PermissionDeniedException("String_Node_Str" + zoneId);
  }
  if (url != null) {
    if (url.toLowerCase().contains("String_Node_Str")) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    UriUtils.validateUrl(format,url);
    _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId),ResourceType.secondary_storage,UriUtils.getRemoteSize(url));
  }
 else {
    _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId),ResourceType.secondary_storage);
  }
  ImageFormat imgfmt=ImageFormat.valueOf(format.toUpperCase());
  if (imgfmt == null) {
    throw new IllegalArgumentException("String_Node_Str" + format + "String_Node_Str"+ EnumUtils.listValues(ImageFormat.values()));
  }
  if (diskOfferingId != null) {
    DiskOfferingVO diskOffering=_diskOfferingDao.findById(diskOfferingId);
    if ((diskOffering == null) || diskOffering.getRemoved() != null || !DiskOfferingVO.Type.Disk.equals(diskOffering.getType())) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    if (!diskOffering.isCustomized()) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    if (diskOffering.getDomainId() == null) {
    }
 else {
      _configMgr.checkDiskOfferingAccess(volumeOwner,diskOffering);
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean validateVolume(Account caller,long ownerId,Long zoneId,String volumeName,String url,String format,Long diskOfferingId) throws ResourceAllocationException {
  Account volumeOwner=_accountMgr.getActiveAccountById(ownerId);
  _accountMgr.checkAccess(caller,null,true,volumeOwner);
  _resourceLimitMgr.checkResourceLimit(volumeOwner,ResourceType.volume);
  DataCenterVO zone=_dcDao.findById(zoneId);
  if (zone == null) {
    throw new InvalidParameterValueException("String_Node_Str" + zoneId);
  }
  if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(caller.getId())) {
    throw new PermissionDeniedException("String_Node_Str" + zoneId);
  }
  if (url != null) {
    if (url.toLowerCase().contains("String_Node_Str")) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    UriUtils.validateUrl(format,url);
    _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId),ResourceType.secondary_storage,UriUtils.getRemoteSize(url));
  }
 else {
    _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId),ResourceType.secondary_storage);
  }
  try {
    ImageFormat.valueOf(format.toUpperCase());
  }
 catch (  IllegalArgumentException e) {
    s_logger.debug("String_Node_Str" + e.getMessage());
    throw new IllegalArgumentException("String_Node_Str" + format + "String_Node_Str"+ EnumUtils.listValues(ImageFormat.values()));
  }
  if (diskOfferingId != null) {
    DiskOfferingVO diskOffering=_diskOfferingDao.findById(diskOfferingId);
    if ((diskOffering == null) || diskOffering.getRemoved() != null || !DiskOfferingVO.Type.Disk.equals(diskOffering.getType())) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    if (!diskOffering.isCustomized()) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    if (diskOffering.getDomainId() == null) {
    }
 else {
      _configMgr.checkDiskOfferingAccess(volumeOwner,diskOffering);
    }
  }
  return false;
}