auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void bootProtocolChanged ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBootProtocol ( NetworkBootProtocol.None ) ; mockExistingIfaces ( nic ) ; nic.setBootProtocol ( NetworkBootProtocol.Dhcp ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }

Target:
public void bootProtocolChanged ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBootProtocol ( NetworkBootProtocol.NONE ) ; mockExistingIfaces ( nic ) ; nic.setBootProtocol ( NetworkBootProtocol.DHCP ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }
Source:
public static org.ovirt.engine.api.model.StorageDomainStatus map ( org.ovirt.engine.api.model.StorageDomainStatus status , org.ovirt.engine.api.model.StorageDomainStatus template ) { switch ( status ) { case Unattached : return org.ovirt.engine.api.model.StorageDomainStatus.UNATTACHED ; case Active : return org.ovirt.engine.api.model.StorageDomainStatus.ACTIVE ; case InActive : return org.ovirt.engine.api.model.StorageDomainStatus.INACTIVE ; case Locked : return org.ovirt.engine.api.model.StorageDomainStatus.LOCKED ; case MovingToMaintenance : return org.ovirt.engine.api.model.StorageDomainStatus.MOVINGTOMAINTENANCE ; case Maintenance : return org.ovirt.engine.api.model.StorageDomainStatus.MAINTENANCE ; case Unknown : return org.ovirt.engine.api.model.StorageDomainStatus.UNKNOWN ; case Uninitialized : return null ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.StorageDomainStatus map ( org.ovirt.engine.api.model.StorageDomainStatus status , org.ovirt.engine.api.model.StorageDomainStatus template ) { switch ( status ) { case Unattached : return org.ovirt.engine.api.model.StorageDomainStatus.UNATTACHED ; case Active : return org.ovirt.engine.api.model.StorageDomainStatus.ACTIVE ; case Inactive : return org.ovirt.engine.api.model.StorageDomainStatus.INACTIVE ; case Locked : return org.ovirt.engine.api.model.StorageDomainStatus.LOCKED ; case PreparingForMaintenance : return org.ovirt.engine.api.model.StorageDomainStatus.PREPARING_FOR_MAINTENANCE ; case Detaching : return org.ovirt.engine.api.model.StorageDomainStatus.DETACHING ; case Maintenance : return org.ovirt.engine.api.model.StorageDomainStatus.MAINTENANCE ; case Unknown : return org.ovirt.engine.api.model.StorageDomainStatus.UNKNOWN ; case Uninitialized : return null ; default : return null ; } }
Source:
private boolean checkDerivedVmFromTemplateExists ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { java.util.List < java.lang.String > vmNames = getNamesOfDerivedVmsFromTemplate ( diskImage ) ; if ( ! ( vmNames.isEmpty ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.VMT_CANNOT_REMOVE_DETECTED_DERIVED_VM ) ; addCanDoActionMessageVariable ( "vmsList" , org.apache.commons.lang.StringUtils.join ( vmNames , "," ) ) ; return false ; } return true ; }

Target:
private boolean checkDerivedVmFromTemplateExists ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { java.util.List < java.lang.String > vmNames = getNamesOfDerivedVmsFromTemplate ( diskImage ) ; if ( ! ( vmNames.isEmpty ( ) ) ) { addCanDoActionMessage ( EngineMessage.VMT_CANNOT_REMOVE_DETECTED_DERIVED_VM ) ; addCanDoActionMessageVariable ( "vmsList" , org.apache.commons.lang.StringUtils.join ( vmNames , "," ) ) ; return false ; } return true ; }
Source:
public void testCannotDisableVirtioScsi ( ) { prepareVmToPassCanDoAction ( ) ; command.getParameters ( ) . setVirtioScsiEnabled ( false ) ; org.ovirt.engine.core.common.businessentities.storage.Disk disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; disk.setPlugged ( true ) ; mockDiskDaoGetAllForVm ( java.util.Collections.singletonList ( disk ) , true ) ; mockVmValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS ) ; }

Target:
public void testCannotDisableVirtioScsi ( ) { prepareVmToPassCanDoAction ( ) ; command.getParameters ( ) . setVirtioScsiEnabled ( false ) ; org.ovirt.engine.core.common.businessentities.storage.Disk disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; disk.setPlugged ( true ) ; mockDiskDaoGetAllForVm ( java.util.Collections.singletonList ( disk ) , true ) ; mockVmValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS ) ; }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , java.lang.String value , com.google.gwt.safehtml.shared.SafeHtml tooltipContent , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < java.lang.String > valueUpdater ) { if ( ( tooltipContent == null ) || ( tooltipContent.asString ( ) . isEmpty ( ) ) ) { tooltipContent = renderTooltip ( context , parent , value ) ; } super . onBrowserEvent ( context , parent , value , tooltipContent , event , valueUpdater ) ; }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , java.lang.String value , java.lang.String tooltipContent , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < java.lang.String > valueUpdater ) { if ( ( tooltipContent == null ) || ( tooltipContent.isEmpty ( ) ) ) { java.lang.String renderedTooltip = renderTooltip ( context , parent , value ) ; tooltipContent = renderedTooltip ; } super . onBrowserEvent ( context , parent , value , tooltipContent , event , valueUpdater ) ; }
Source:
protected void executeVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.getParameters ( ) . setEntityId ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getId ( ) ) ; if ( ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . gethibernation_vol_handle ( ) ) ) ) ) { setSuspendedVm ( true ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( stopSuspendedVm ( ) ) ; } else { super . executeVmCommand ( ) ; } removeStatelessVmUnmanagedDevices ( ) ; }

Target:
protected void executeVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.getParameters ( ) . setEntityId ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getId ( ) ) ; if ( ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getHibernationVolHandle ( ) ) ) ) ) { setSuspendedVm ( true ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( stopSuspendedVm ( ) ) ; } else { super . executeVmCommand ( ) ; } removeStatelessVmUnmanagedDevices ( ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase removeVmImages ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RemoveAllVmImages , buildRemoveAllVmImagesParameters ( images ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( getExecutionContext ( ) ) ) ; if ( vdcRetValue.getSucceeded ( ) ) { getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return vdcRetValue ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase removeVmImages ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.RemoveAllVmImages , buildRemoveAllVmImagesParameters ( images ) ) ; if ( vdcRetValue.getSucceeded ( ) ) { getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return vdcRetValue ; }
Source:
public boolean isIsoVersionCompatible ( org.ovirt.engine.core.compat.RpmVersion ovirtOsVersion , java.lang.String isoFile ) { boolean retValue = true ; if ( ovirtOsVersion != null ) { try { org.ovirt.engine.core.compat.RpmVersion isoVersion = new org.ovirt.engine.core.compat.RpmVersion ( isoFile , org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.OvirtIsoPrefix ) , true ) ; if ( ! ( org.ovirt.engine.core.bll.VdsHandler.isIsoVersionCompatibleForUpgrade ( ovirtOsVersion , isoVersion ) ) ) { retValue = false ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.InstallVdsCommand.log.warnFormat ( "Failed to parse ISO file version {0} with error {1}" , isoFile , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } } return retValue ; }

Target:
private void handleError ( java.lang.Exception e , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.bll.InstallVdsCommand.log.errorFormat ( "Host installation failed for host {0}, {1}." , org.ovirt.engine.core.bll.InstallVdsCommand.getVds ( ) . getId ( ) , org.ovirt.engine.core.bll.InstallVdsCommand.getVds ( ) . getName ( ) , e ) ; setVdsStatus ( status ) ; org.ovirt.engine.core.bll.InstallVdsCommand.setSucceeded ( false ) ; _failureMessage = e.getMessage ( ) ; }
Source:
public void testListLimitResultsBadFormat ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectationsWithMax ( true ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllTags , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , null ) ; collection.setUriInfo ( uriInfo ) ; getCollection ( ) ; fail ( "Expected WebFaultException" ) ; }

Target:
public void testListLimitResultsBadFormat ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectationsWithMax ( true ) ; setUpEntityQueryExpectations ( QueryType.GetAllTags , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , null ) ; collection.setUriInfo ( uriInfo ) ; getCollection ( ) ; fail ( "Expected WebFaultException" ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult macAvailable ( ) { java.lang.Boolean allowDupMacs = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.AllowDuplicateMacAddresses ) ; org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; if ( allowDupMacs || ( ! ( vmInterfaceManager.existsPluggedInterfaceWithSameMac ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_MAC_ADDRESS_IN_USE ) ; } }

Target:
protected org.ovirt.engine.core.bll.ValidationResult macAvailable ( ) { java.lang.Boolean allowDupMacs = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.AllowDuplicateMacAddresses ) ; org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getMacPool ( ) ) ; if ( allowDupMacs || ( ! ( vmInterfaceManager.existsPluggedInterfaceWithSameMac ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_MAC_ADDRESS_IN_USE ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.utils.VdsCommandsHelper.runVdsCommandWithFailover ( VDSCommandType.AllocateVolume , new org.ovirt.engine.core.common.vdscommands.AllocateVolumeVDSCommandParameters ( org.ovirt.engine.core.bll.storage.disk.image.AllocateImageGroupVolumeCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.AllocateImageGroupVolumeCommand.getParameters ( ) . getJobId ( ) , org.ovirt.engine.core.bll.storage.disk.image.AllocateImageGroupVolumeCommand.getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.bll.storage.disk.image.AllocateImageGroupVolumeCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.storage.disk.image.AllocateImageGroupVolumeCommand.getParameters ( ) . getSize ( ) ) , org.ovirt.engine.core.bll.storage.disk.image.AllocateImageGroupVolumeCommand.getParameters ( ) . getStoragePoolId ( ) , this ) ; org.ovirt.engine.core.bll.storage.disk.image.AllocateImageGroupVolumeCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { vdsCommandsHelper.runVdsCommandWithFailover ( VDSCommandType.AllocateVolume , new org.ovirt.engine.core.common.vdscommands.AllocateVolumeVDSCommandParameters ( org.ovirt.engine.core.bll.storage.disk.image.AllocateImageGroupVolumeCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.AllocateImageGroupVolumeCommand.getParameters ( ) . getJobId ( ) , org.ovirt.engine.core.bll.storage.disk.image.AllocateImageGroupVolumeCommand.getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.bll.storage.disk.image.AllocateImageGroupVolumeCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.storage.disk.image.AllocateImageGroupVolumeCommand.getParameters ( ) . getSize ( ) ) , org.ovirt.engine.core.bll.storage.disk.image.AllocateImageGroupVolumeCommand.getParameters ( ) . getStoragePoolId ( ) , this ) ; org.ovirt.engine.core.bll.storage.disk.image.AllocateImageGroupVolumeCommand.setSucceeded ( true ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.storage.DisksAllocationModel model ) { driver.edit ( model ) ; initListerners ( model ) ; updateColumnsAvailability ( model ) ; updateListHeader ( model ) ; }

Target:
void updateColumnsAvailability ( org.ovirt.engine.ui.uicommonweb.models.storage.DisksAllocationModel model ) { setShowVolumeType ( model.getIsVolumeTypeAvailable ( ) ) ; setShowVolumeFormat ( model.getIsVolumeFormatAvailable ( ) ) ; setShowQuota ( ( ( model.getQuotaEnforcementType ( ) ) != ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) ) ; setShowSource ( model.isSourceAvailable ( ) ) ; setShowTarget ( model.isTargetAvailable ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage getDisk ( org.ovirt.engine.core.compat.Guid diskId ) { return runInternalQuery ( VdcQueryType.GetDiskByDiskId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( diskId ) ) . getReturnValue ( ) ; }

Target:
private org.ovirt.engine.core.common.action.AddDiskParameters buildAddDiskParameters ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.AddDiskParameters parameters = new org.ovirt.engine.core.common.action.AddDiskParameters ( org.ovirt.engine.core.compat.Guid.Empty , disk ) ; parameters.setStorageDomainId ( getStorageDomainId ( ) ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.HibernateVmCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.HibernateVmCommand.getParameters ( ) ) ; parameters.setShouldBeLogged ( false ) ; return parameters ; }
Source:
public void testResize ( ) { org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = createDiskImage ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( oldDisk ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( parameters.getDiskInfo ( ) ) ) . setSize ( ( ( oldDisk.getSize ( ) ) * 2 ) ) ; initializeCommand ( parameters ) ; org.junit.Assert.assertTrue ( command.validateCanResizeDisk ( ) ) ; }

Target:
public void testResize ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage oldDisk = createDiskImage ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( oldDisk ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( parameters.getDiskInfo ( ) ) ) . setSize ( ( ( oldDisk.getSize ( ) ) * 2 ) ) ; initializeCommand ( parameters ) ; org.junit.Assert.assertTrue ( command.validateCanResizeDisk ( ) ) ; }
Source:
private void removeLabelFromAddedRemovedSets ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel , java.lang.String label , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { org.ovirt.engine.core.common.businessentities.network.NicLabel labelOnNic = new org.ovirt.engine.core.common.businessentities.network.NicLabel ( iface.getId ( ) , iface.getName ( ) , label ) ; if ( dataFromHostSetupNetworksModel.addedLabels.contains ( labelOnNic ) ) { dataFromHostSetupNetworksModel.addedLabels.remove ( labelOnNic ) ; } else { dataFromHostSetupNetworksModel.removedLabels.add ( labelOnNic ) ; } }

Target:
private static void addLabel ( java.lang.String dstIfaceName , org.ovirt.engine.core.compat.Guid dstIfaceId , java.lang.String label , org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel ) { dataFromHostSetupNetworksModel.addLabelToParameters ( new org.ovirt.engine.core.common.businessentities.network.NicLabel ( dstIfaceId , dstIfaceName , label ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult networkNotUsedByRunningVm ( ) { java.lang.String networkName = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkName ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getVdsGroupDAO ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getStoragePool ( ) . getId ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vms = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getVmStaticDAO ( ) . getAllByGroupAndNetworkName ( cluster.getId ( ) , networkName ) ; if ( ( vms.size ( ) ) > 0 ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_INTERFACE_IN_USE_BY_VM ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult networkNotUsedByRunningVm ( ) { java.lang.String networkName = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkName ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterAttachment : getClusterAttachments ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vms = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getVmStaticDAO ( ) . getAllByGroupAndNetworkName ( clusterAttachment.getClusterId ( ) , networkName ) ; if ( ( vms.size ( ) ) > 0 ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_INTERFACE_IN_USE_BY_VM ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private boolean equals ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > item1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > item2 ) { if ( ( item1 == null ) && ( item2 == null ) ) { return true ; } return item1 != null ? item1.equals ( item2 ) : item2.equals ( item1 ) ; }

Target:
private boolean equals ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > item1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > item2 ) { return java.util.Objects.equals ( item1 , item2 ) ; }
Source:
public boolean fetch ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue getList = getResourceManager ( ) . runVdsCommand ( VDSCommandType.List , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( vdsManager.getCopyVds ( ) ) ) ; if ( getList.getSucceeded ( ) ) { vdsmVms = ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > ) ( getList.getReturnValue ( ) ) ) ; onFetchVms ( ) ; return true ; } else { onError ( ) ; return false ; } }

Target:
public boolean fetch ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue pollReturnValue = poll ( ) ; if ( pollReturnValue.getSucceeded ( ) ) { vdsmVms = ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > ) ( pollReturnValue.getReturnValue ( ) ) ) ; onFetchVms ( ) ; return true ; } else { onError ( ) ; return false ; } }
Source:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getAttachedTagsToUserGroup ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.setAttachedTagsConverter ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTagsByUserGroupId , new org.ovirt.engine.core.common.queries.GetTagsByUserGroupIdParameters ( id.toString ( ) ) , aQuery ) ; }
Source:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public static java.lang.String getUserDetailsJson ( javax.servlet.ServletContext ctx , java.lang.String token ) throws java.io.IOException , java.security.GeneralSecurityException , java.sql.SQLException { return org.ovirt.engine.core.sso.utils.SSOUtils.getJson ( org.ovirt.engine.core.sso.utils.SSOUtils.getUserDetails ( ctx , token ) ) ; }

Target:
public static void validateRequestScope ( javax.servlet.http.HttpServletRequest req , java.lang.String token , java.lang.String scope ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( scope ) ) { org.ovirt.engine.core.sso.utils.SSOSession ssoSession = org.ovirt.engine.core.sso.utils.SSOUtils.getSsoSessionFromRequest ( req , token ) ; if ( ( ssoSession != null ) && ( ( ssoSession.getScope ( ) ) != null ) ) { org.ovirt.engine.core.sso.utils.SSOUtils.validateScope ( ssoSession.getScopeAsList ( ) , scope ) ; } } }
Source:
public static void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
protected boolean checkQuotaValidationCommon ( org.ovirt.engine.core.common.businessentities.Quota quota , java.util.List < java.lang.String > messages ) { if ( quota == null ) { messages.add ( VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID.toString ( ) ) ; return false ; } if ( ( ( ! ( checkQuotaNameExisting ( quota , messages ) ) ) || ( ! ( org.ovirt.engine.core.bll.QuotaCRUDCommand.validateQuotaStorageLimitation ( quota , messages ) ) ) ) || ( ! ( org.ovirt.engine.core.bll.QuotaCRUDCommand.validateQuotaVdsGroupLimitation ( quota , messages ) ) ) ) { return false ; } return true ; }

Target:
protected boolean checkQuotaValidationCommon ( org.ovirt.engine.core.common.businessentities.Quota quota , java.util.List < java.lang.String > messages ) { if ( quota == null ) { messages.add ( EngineMessage.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID.toString ( ) ) ; return false ; } if ( ( ( ! ( checkQuotaNameExisting ( quota , messages ) ) ) || ( ! ( org.ovirt.engine.core.bll.QuotaCRUDCommand.validateQuotaStorageLimitation ( quota , messages ) ) ) ) || ( ! ( org.ovirt.engine.core.bll.QuotaCRUDCommand.validateQuotaVdsGroupLimitation ( quota , messages ) ) ) ) { return false ; } return true ; }
Source:
public javax.ws.rs.core.Response remove ( ) { org.ovirt.engine.core.common.businessentities.Label label = org.ovirt.engine.api.restapi.resource.BackendAffinityLabelHelper.getLabel ( this , labelId ) ; if ( ! ( label.getHosts ( ) . contains ( guid ) ) ) { throw new javax.ws.rs.WebApplicationException ( Response.Status.NOT_FOUND ) ; } org.ovirt.engine.core.common.businessentities.VDS entity = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; entity.setId ( guid ) ; org.ovirt.engine.core.common.businessentities.Label updatedLabel = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( label ) . removeEntity ( entity ) . build ( ) ; return performAction ( VdcActionType.UpdateLabel , new org.ovirt.engine.core.common.action.LabelActionParameters ( updatedLabel ) ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { org.ovirt.engine.core.common.businessentities.Label label = org.ovirt.engine.api.restapi.resource.BackendAffinityLabelHelper.getLabel ( this , labelId ) ; if ( ! ( label.getHosts ( ) . contains ( guid ) ) ) { throw new javax.ws.rs.WebApplicationException ( Response.Status.NOT_FOUND ) ; } org.ovirt.engine.core.common.businessentities.VDS entity = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; entity.setId ( guid ) ; org.ovirt.engine.core.common.businessentities.Label updatedLabel = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( label ) . removeEntity ( entity ) . build ( ) ; return performAction ( ActionType.UpdateLabel , new org.ovirt.engine.core.common.action.LabelActionParameters ( updatedLabel ) ) ; }
Source:
public void testCheckGlusterQuorumWithVolumeDown ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getGlusterVolumes ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID , GlusterStatus.DOWN ) ) . when ( volumeDao ) . getByClusterId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; org.junit.Assert.assertTrue ( "Quorum check is failing with volumes in down status" , hostValidator.checkGlusterQuorum ( cluster , hostIds ) . isEmpty ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.Cluster getCluster ( boolean supportGlusterService ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; cluster.setGlusterService ( supportGlusterService ) ; return cluster ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( sshPublicKey ) == null ? 0 : sshPublicKey.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( sshPublicKey ) == null ? 0 : sshPublicKey.hashCode ( ) ) ; result = ( prime * result ) + ( ( loginName ) == null ? 0 : loginName.hashCode ( ) ) ; return result ; }
Source:
public org.ovirt.engine.ui.common.widget.ImageWithDecorator getValue ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { org.ovirt.engine.core.common.businessentities.VM vm = item.getVM ( ) ; com.google.gwt.resources.client.ImageResource changesImage = null ; if ( ( vm != null ) && ( vm.isNextRunConfigurationExists ( ) ) ) { changesImage = org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.resources.vmDelta ( ) ; } return new org.ovirt.engine.ui.common.widget.ImageWithDecorator ( getMainImage ( item ) , changesImage , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_LEFT , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_TOP , vm.getStatus ( ) . toString ( ) ) ; }

Target:
public org.ovirt.engine.ui.common.widget.ImageWithDecorator getValue ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { org.ovirt.engine.core.common.businessentities.VM vm = item.getVM ( ) ; com.google.gwt.resources.client.ImageResource changesImage = null ; final java.lang.String vmStatus ; if ( vm != null ) { if ( vm.isNextRunConfigurationExists ( ) ) { changesImage = org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.resources.vmDelta ( ) ; } vmStatus = vm.getStatus ( ) . toString ( ) ; } else { vmStatus = "" ; } return new org.ovirt.engine.ui.common.widget.ImageWithDecorator ( getMainImage ( item ) , changesImage , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_LEFT , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_TOP , vmStatus ) ; }
Source:
private boolean canRemoveTemplateDisk ( ) { if ( ( org.ovirt.engine.core.bll.storage.disk.RemoveDiskCommand.getVmTemplate ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.Locked ) ) { return failCanDoAction ( EngineMessage.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImage ( ) ; if ( ( diskImage.getStorageIds ( ) . size ( ) ) == 1 ) { return failCanDoAction ( EngineMessage.VM_TEMPLATE_IMAGE_LAST_DOMAIN ) ; } if ( ( ! ( checkDerivedVmFromTemplateExists ( diskImage ) ) ) || ( ! ( checkDerivedDisksFromDiskNotExist ( diskImage ) ) ) ) { return false ; } return true ; }

Target:
private boolean canRemoveTemplateDisk ( ) { if ( ( org.ovirt.engine.core.bll.storage.disk.RemoveDiskCommand.getVmTemplate ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.Locked ) ) { return failValidation ( EngineMessage.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImage ( ) ; if ( ( diskImage.getStorageIds ( ) . size ( ) ) == 1 ) { return failValidation ( EngineMessage.VM_TEMPLATE_IMAGE_LAST_DOMAIN ) ; } if ( ( ! ( checkDerivedVmFromTemplateExists ( diskImage ) ) ) || ( ! ( checkDerivedDisksFromDiskNotExist ( diskImage ) ) ) ) { return false ; } return true ; }
Source:
public void testQuotaStorageByQuotaGuidWithGeneralDefaultNoDefault ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorageList = dao.getQuotaStorageByQuotaGuidWithGeneralDefault ( FixturesTool.QUOTA_SPECIFIC ) ; org.junit.Assert.assertNotNull ( quotaStorageList ) ; org.junit.Assert.assertEquals ( "wrong number of quotas returned" , 1 , quotaStorageList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.QuotaStorage group : quotaStorageList ) { org.junit.Assert.assertNotNull ( "Storage ID should not be null in specific mode" , group.getStorageId ( ) ) ; org.junit.Assert.assertNotNull ( "Storage name should not be null in specific mode" , group.getStorageName ( ) ) ; } }

Target:
public void testQuotaStorageByQuotaGuidWithGeneralDefaultWithDefault ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorageList = dao.getQuotaStorageByQuotaGuidWithGeneralDefault ( FixturesTool.DEFAULT_QUOTA_GENERAL ) ; org.junit.jupiter.api.Assertions.assertNotNull ( quotaStorageList ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , quotaStorageList.size ( ) , "wrong number of quotas returned" ) ; for ( org.ovirt.engine.core.common.businessentities.QuotaStorage group : quotaStorageList ) { org.junit.jupiter.api.Assertions.assertEquals ( Guid.Empty , group.getStorageId ( ) , "Storage ID should not be null in general mode" ) ; org.junit.jupiter.api.Assertions.assertNull ( group.getStorageName ( ) , "Storage name should not be null in general mode" ) ; } }
Source:
public void testGet ( ) { setUpGetStorageDomainExpectations ( StorageDomainType.ImportExport ) ; setUpGetEntityExpectations ( StorageDomainType.ImportExport , org.ovirt.engine.api.restapi.resource.BackendExportDomainDiskResourceTest.STORAGE_DOMAIN_ID ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; org.junit.Assert.assertNotNull ( disk ) ; org.junit.Assert.assertEquals ( disk.getId ( ) , org.ovirt.engine.api.restapi.resource.BackendExportDomainDiskResourceTest.DISK_ID.toString ( ) ) ; }

Target:
public void testGet ( ) { setUpGetStorageDomainExpectations ( StorageDomainType.ImportExport ) ; setUpGetEntityExpectations ( StorageDomainType.ImportExport , org.ovirt.engine.api.restapi.resource.BackendExportDomainDiskResourceTest.STORAGE_DOMAIN_ID ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; org.junit.jupiter.api.Assertions.assertNotNull ( disk ) ; org.junit.jupiter.api.Assertions.assertEquals ( disk.getId ( ) , org.ovirt.engine.api.restapi.resource.BackendExportDomainDiskResourceTest.DISK_ID.toString ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepPause ( java.lang.String masterVolumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepPause" ) . withParameter ( "volumeName" , masterVolumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionPause ( java.lang.String masterVolumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionPause" ) . withParameter ( "volumeName" , masterVolumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
protected void validateParameters ( org.ovirt.engine.api.model.VnicProfile vnicProfile ) { validateParameters ( vnicProfile , "name" , "network.id" ) ; java.lang.String networkId = vnicProfile.getNetwork ( ) . getId ( ) ; getEntity ( org.ovirt.engine.core.common.businessentities.network.Network.class , VdcQueryType.GetNetworkById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( networkId ) ) , ( "Network: id=" + networkId ) ) ; }

Target:
protected void validateParameters ( org.ovirt.engine.api.model.VnicProfile vnicProfile ) { validateParameters ( vnicProfile , "name" , "network.id" ) ; java.lang.String networkId = vnicProfile.getNetwork ( ) . getId ( ) ; getEntity ( org.ovirt.engine.core.common.businessentities.network.Network.class , QueryType.GetNetworkById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( networkId ) ) , ( "Network: id=" + networkId ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionSubjects = new java.util.ArrayList < > ( ) ; permissionSubjects.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getDiskImage ( ) . getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.ATTACH_DISK ) ) ; permissionSubjects.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getParameters ( ) . getDestinationDomainId ( ) , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; return permissionSubjects ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionSubjects = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImage ( ) ; if ( diskImage != null ) { permissionSubjects.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( diskImage.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.ATTACH_DISK ) ) ; } permissionSubjects.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getParameters ( ) . getDestinationDomainId ( ) , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; return permissionSubjects ; }
Source:
private void deleteVolumeFromCinder ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk lastCinderVolume ) { try { org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getCinderBroker ( ) . deleteVolumeByClassificationType ( lastCinderVolume ) ; } catch ( java.lang.Exception e ) { if ( ! ( org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getParameters ( ) . isFaultTolerant ( ) ) ) { throw e ; } else { org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.log.error ( "Failed to remove volume from Cinder provider. continue to delete the disk." ) ; } } }

Target:
private java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > getFutureRemoveCinderDiskVolume ( int removedChildCommandParametersIndex ) { return org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( VdcActionType.RemoveCinderDiskVolume , org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getParameters ( ) . getChildCommandsParameters ( ) . get ( removedChildCommandParametersIndex ) , org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.cloneContextAndDetachFromParent ( ) , new org.ovirt.engine.core.common.businessentities.SubjectEntity ( org.ovirt.engine.core.common.VdcObjectType.Storage , getDisk ( ) . getStorageIds ( ) . get ( 0 ) ) ) ; }
Source:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandStatus ( getCommandId ( ) , getTaskType ( ) , commandStatus ) ; } }

Target:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandStatus ( getCommandId ( ) , getTaskType ( ) , commandStatus ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }
Source:
private void addGraphicsDevice ( ) { for ( org.ovirt.engine.core.common.businessentities.GraphicsType type : org.ovirt.engine.core.common.businessentities.GraphicsType.values ( ) ) { org.ovirt.engine.core.common.businessentities.GraphicsDevice graphicsDevice = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getGraphicsDevice ( type ) ; if ( graphicsDevice == null ) { continue ; } graphicsDevice.setVmId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.AddVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.AddGraphicsDevice , new org.ovirt.engine.core.bll.GraphicsParameters ( graphicsDevice ) ) ; } }

Target:
private void addGraphicsDevice ( ) { for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice graphicsDevice : org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getGraphicsDevices ( ) . values ( ) ) { if ( graphicsDevice == null ) { continue ; } graphicsDevice.setVmId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.AddVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.AddGraphicsDevice , new org.ovirt.engine.core.bll.GraphicsParameters ( graphicsDevice ) ) ; } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult a ) { stopProgress ( a.getState ( ) ) ; cancel ( ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult a ) { stopProgress ( a.getState ( ) ) ; cancel ( ) ; } } , this ) ; }
Source:
private static void mockStoragePool ( org.ovirt.engine.core.bll.ImportVmTemplateCommand command ) { final org.ovirt.engine.core.dao.StoragePoolDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; final org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setId ( command.getParameters ( ) . getStoragePoolId ( ) ) ; org.mockito.Mockito.when ( dao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( pool ) ; org.mockito.Mockito.doReturn ( dao ) . when ( command ) . getStoragePoolDAO ( ) ; }

Target:
private static void mockStoragePool ( org.ovirt.engine.core.bll.ImportVmTemplateCommand command ) { final org.ovirt.engine.core.dao.StoragePoolDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; final org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setId ( command.getParameters ( ) . getStoragePoolId ( ) ) ; org.mockito.Mockito.when ( dao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( pool ) ; org.mockito.Mockito.doReturn ( dao ) . when ( command ) . getStoragePoolDao ( ) ; }
Source:
public void testDirectDescetor ( ) { org.ovirt.engine.core.common.businessentities.Tags tag1 = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.Tags tag2 = createTag ( "tag2" , "desc2" ) ; tagsDirector.addTag ( tag1 ) ; tagsDirector.addTag ( tag2 ) ; tagsDirector.MoveTag ( tag2.gettag_id ( ) , tag1.gettag_id ( ) ) ; org.junit.Assert.assertTrue ( tagsDirector.isTagDescestorOfTag ( tag1.gettag_id ( ) , tag2.gettag_id ( ) ) ) ; }

Target:
public void testDirectDescetor ( ) { org.ovirt.engine.core.common.businessentities.Tags tag1 = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.Tags tag2 = createTag ( "tag2" , "desc2" ) ; tagsDirector.addTag ( tag1 ) ; tagsDirector.addTag ( tag2 ) ; tagsDirector.moveTag ( tag2.gettag_id ( ) , tag1.gettag_id ( ) ) ; org.junit.Assert.assertTrue ( tagsDirector.isTagDescestorOfTag ( tag1.gettag_id ( ) , tag2.gettag_id ( ) ) ) ; }