Program: 105128
Project: 105128
Buggy source:
@Override @ActionEvent(eventType=EventTypes.EVENT_SNAPSHOT_CREATE,eventDescription="String_Node_Str",create=true) public Snapshot allocSnapshot(Long volumeId,Long policyId,String snapshotName) throws ResourceAllocationException {
  Account caller=CallContext.current().getCallingAccount();
  VolumeInfo volume=volFactory.getVolume(volumeId);
  if (volume == null) {
    throw new InvalidParameterValueException("String_Node_Str" + volumeId + "String_Node_Str");
  }
  DataCenter zone=_dcDao.findById(volume.getDataCenterId());
  if (zone == null) {
    throw new InvalidParameterValueException("String_Node_Str" + volume.getDataCenterId());
  }
  if (volume.getInstanceId() != null) {
    if (_vmSnapshotDao.findByVm(volume.getInstanceId()).size() > 0) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
  }
  if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(caller.getId())) {
    throw new PermissionDeniedException("String_Node_Str" + zone.getName());
  }
  if (volume.getState() != Volume.State.Ready) {
    throw new InvalidParameterValueException("String_Node_Str" + volumeId + "String_Node_Str"+ Volume.State.Ready+ "String_Node_Str"+ volume.getState()+ "String_Node_Str");
  }
  if (ImageFormat.DIR.equals(volume.getFormat())) {
    throw new InvalidParameterValueException("String_Node_Str" + volumeId);
  }
  if (volume.getTemplateId() != null) {
    VMTemplateVO template=_templateDao.findById(volume.getTemplateId());
    if (template != null && template.getTemplateType() == Storage.TemplateType.SYSTEM) {
      throw new InvalidParameterValueException("String_Node_Str" + volumeId + "String_Node_Str");
    }
  }
  StoragePool storagePool=(StoragePool)volume.getDataStore();
  if (storagePool == null) {
    throw new InvalidParameterValueException("String_Node_Str" + volumeId + "String_Node_Str");
  }
  return snapshotMgr.allocSnapshot(volumeId,policyId,snapshotName);
}

Fixed version (ground truth):
@Override @ActionEvent(eventType=EventTypes.EVENT_SNAPSHOT_CREATE,eventDescription="String_Node_Str",create=true) public Snapshot allocSnapshot(Long volumeId,Long policyId,String snapshotName) throws ResourceAllocationException {
  Account caller=CallContext.current().getCallingAccount();
  VolumeInfo volume=volFactory.getVolume(volumeId);
  if (volume == null) {
    throw new InvalidParameterValueException("String_Node_Str" + volumeId + "String_Node_Str");
  }
  DataCenter zone=_dcDao.findById(volume.getDataCenterId());
  if (zone == null) {
    throw new InvalidParameterValueException("String_Node_Str" + volume.getDataCenterId());
  }
  if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(caller.getId())) {
    throw new PermissionDeniedException("String_Node_Str" + zone.getName());
  }
  if (volume.getState() != Volume.State.Ready) {
    throw new InvalidParameterValueException("String_Node_Str" + volumeId + "String_Node_Str"+ Volume.State.Ready+ "String_Node_Str"+ volume.getState()+ "String_Node_Str");
  }
  if (ImageFormat.DIR.equals(volume.getFormat())) {
    throw new InvalidParameterValueException("String_Node_Str" + volumeId);
  }
  if (volume.getTemplateId() != null) {
    VMTemplateVO template=_templateDao.findById(volume.getTemplateId());
    if (template != null && template.getTemplateType() == Storage.TemplateType.SYSTEM) {
      throw new InvalidParameterValueException("String_Node_Str" + volumeId + "String_Node_Str");
    }
  }
  StoragePool storagePool=(StoragePool)volume.getDataStore();
  if (storagePool == null) {
    throw new InvalidParameterValueException("String_Node_Str" + volumeId + "String_Node_Str");
  }
  return snapshotMgr.allocSnapshot(volumeId,policyId,snapshotName);
}