auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void readOsSection ( org.ovirt.engine.core.utils.ovf.xml.XmlNode section ) { _vmTemplate.setId ( new org.ovirt.engine.core.compat.Guid ( section.attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.utils.ovf.xml.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { int osId = osRepository.getOsIdByUniqueName ( node.innerText ) ; _vmTemplate.setOsId ( osId ) ; _vmTemplate.setClusterArch ( osRepository.getArchitectureFromOS ( osId ) ) ; } else { _vmTemplate.setClusterArch ( ArchitectureType.undefined ) ; } }

Target:
protected void readOsSection ( org.ovirt.engine.core.utils.ovf.xml.XmlNode section ) { _vmTemplate.setId ( new org.ovirt.engine.core.compat.Guid ( section.attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.utils.ovf.xml.XmlNode node = selectSingleNode ( section , "Description" ) ; if ( node != null ) { int osId = osRepository.getOsIdByUniqueName ( node.innerText ) ; _vmTemplate.setOsId ( osId ) ; _vmTemplate.setClusterArch ( osRepository.getArchitectureFromOS ( osId ) ) ; } else { _vmTemplate.setClusterArch ( ArchitectureType.undefined ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( sender == ( getPlugged ( ) ) ) { org.ovirt.engine.core.compat.PropertyChangedEventArgs propArgs = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) ; if ( propArgs.PropertyName.equals ( "Entity" ) ) { onPlugChange ( ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( sender == ( getPlugged ( ) ) ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs propArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( propArgs.PropertyName.equals ( "Entity" ) ) { onPlugChange ( ) ; } } }
Source:
private void Preview ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = ( ( org.ovirt.engine.core.common.businessentities.Snapshot ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.TryBackToAllSnapshotsOfVm , new org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters ( vm.getId ( ) , snapshot.getId ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { } } , null ) ; } }

Target:
private void Commit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getInPreview ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RestoreAllSnapshots , new org.ovirt.engine.core.common.action.RestoreAllSnapshotsParameters ( vm.getId ( ) , snapshot.getId ( ) ) , null , null ) ; } }
Source:
private void updateCanSpecify ( ) { boolean isChangable = ( bootProtocolsAvailable ) && ( getIsStaticAddress ( ) ) ; getAddress ( ) . setChangeProhibitionReason ( ( isChangable && ( ! ( staticIpChangeAllowed ) ) ? org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . staticIpAddressSameAsHostname ( ) : null ) ) ; getAddress ( ) . setIsChangeable ( ( isChangable && ( staticIpChangeAllowed ) ) ) ; getSubnet ( ) . setIsChangeable ( isChangable ) ; getGateway ( ) . setIsChangeable ( isChangable ) ; }

Target:
private void updateCanSpecify ( ) { boolean isChangable = ( bootProtocolsAvailable ) && ( getIsStaticAddress ( ) ) ; getIpv4Address ( ) . setChangeProhibitionReason ( ( isChangable && ( ! ( staticIpChangeAllowed ) ) ? org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . staticIpAddressSameAsHostname ( ) : null ) ) ; getIpv4Address ( ) . setIsChangeable ( ( isChangable && ( staticIpChangeAllowed ) ) ) ; getIpv4Subnet ( ) . setIsChangeable ( isChangable ) ; getIpv4Gateway ( ) . setIsChangeable ( isChangable ) ; }
Source:
private void commitLabelChanges ( org.ovirt.engine.ui.uicommonweb.models.hosts.NicLabelModel labelModel , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > potentialNetworks ) { labelModel.commit ( iface ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ifaceModel = nicMap.get ( iface.getName ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.clearNetworks ( ifaceModel , allNics ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.attachNetworks ( ifaceModel , new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( potentialNetworks ) , allNics ) ; }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand uiCommand ) { if ( ! ( labelPopup.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; java.lang.String label = labelPopup.getLabel ( ) . getEntity ( ) ; dcLabels.add ( label ) ; NetworkOperation.LABEL.getCommand ( new org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkLabelModel ( label , this ) , networkCommand.getOp2 ( ) , allNics ) . execute ( ) ; redraw ( ) ; }
Source:
private void addAddPermissionsButton ( final org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addActionButton ( new org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition < org.ovirt.engine.core.common.businessentities.Permission > ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getEventBus ( ) , constants.addPermission ( ) ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getModel ( ) . getAddCommand ( ) ; } } ) ; }

Target:
private void addAddPermissionsButton ( ) { org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addActionButton ( new org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition < org.ovirt.engine.core.common.businessentities.Permission > ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getEventBus ( ) , org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants.addPermission ( ) ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getModel ( ) . getAddCommand ( ) ; } } ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isSameStorageType ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { org.ovirt.engine.core.common.businessentities.StorageType connectionStorageType = connection.getstorage_type ( ) ; org.ovirt.engine.core.common.businessentities.StorageType storageDomainType = storageDomain.getStorageType ( ) ; if ( ! ( connectionStorageType.equals ( storageDomainType ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_NOT_SAME_STORAGE_TYPE ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isSameStorageType ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { org.ovirt.engine.core.common.businessentities.storage.StorageType connectionStorageType = connection.getstorage_type ( ) ; org.ovirt.engine.core.common.businessentities.storage.StorageType storageDomainType = storageDomain.getStorageType ( ) ; if ( ! ( connectionStorageType.equals ( storageDomainType ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_NOT_SAME_STORAGE_TYPE ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { switch ( org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getAction ( ) ) { case START : status = org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getBroker ( ) . glusterVolumeReplaceBrickStart ( org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getExistingBrickDir ( ) , org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getNewBrickDir ( ) ) ; break ; } org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { switch ( org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getAction ( ) ) { case START : status = org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getBroker ( ) . glusterVolumeReplaceBrickStart ( org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getExistingBrickDir ( ) , org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getNewBrickDir ( ) ) ; break ; } org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { clearVms ( ) ; exportDomain.setEntity ( null ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dataCenters.getSelectedItem ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenter.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , createGetStorageDomainsByStoragePoolIdCallback ( dataCenter ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { clearVms ( ) ; exportDomain.setEntity ( null ) ; loadProviders ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dataCenters.getSelectedItem ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenter.getId ( ) ) , new org.ovirt.engine.ui.uicommonweb.models.vms.AsyncQuery ( createGetStorageDomainsByStoragePoolIdCallback ( ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.SetDataCenter ( model , list ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.setDataCenter ( model , list ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmNumaNode createVmNumaNode ( int index , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > vdsNumaNodes ) { org.ovirt.engine.core.common.businessentities.VmNumaNode numaNode = org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( index ) ; final java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.Integer > > > numaPinning = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNumaNode vdsNumaNode : vdsNumaNodes ) { numaPinning.add ( org.ovirt.engine.core.bll.utils.NumaTestUtils.toWeirdPair ( vdsNumaNode ) ) ; } numaNode.setVdsNumaNodeList ( numaPinning ) ; return numaNode ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmNumaNode createVmNumaNode ( int index , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > vdsNumaNodes ) { org.ovirt.engine.core.common.businessentities.VmNumaNode numaNode = org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( index ) ; final java.util.List < java.lang.Integer > numaPinning = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNumaNode vdsNumaNode : vdsNumaNodes ) { numaPinning.add ( vdsNumaNode.getIndex ( ) ) ; } numaNode.setVdsNumaNodeList ( numaPinning ) ; return numaNode ; }
Source:
public void setInputFieldsEnabled ( boolean enabled ) { nameEditor.setEnabled ( enabled ) ; descriptionEditor.setEnabled ( enabled ) ; isVmNetworkEditor.setEnabled ( enabled ) ; vlanTagging.setEnabled ( enabled ) ; vlanTag.setEnabled ( enabled ) ; hasMtuEditor.setEnabled ( enabled ) ; mtuEditor.setEnabled ( enabled ) ; messageLabel.setVisible ( ( ! enabled ) ) ; }

Target:
public void postModelEnabled ( boolean enabled ) { messageLabel.setVisible ( ( ! enabled ) ) ; }
Source:
public void getAllowClusterWithVirtGlusterEnabled ( 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 ? source : java.lang.Boolean.TRUE ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.AllowClusterWithVirtGlusterEnabled , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getAllowClusterWithVirtGlusterEnabled ( 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 ? source : java.lang.Boolean.TRUE ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.AllowClusterWithVirtGlusterEnabled , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public 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.getInstance ( ) . 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 void getMigrationPolicies ( 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 returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( returnValue == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.migration.MigrationPolicy > ( ) ; } return returnValue ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllMigrationPolicies , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.VolumeFormat getTargetVolumeFormat ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat volumeFormat , org.ovirt.engine.core.common.businessentities.storage.VolumeType volumeType , org.ovirt.engine.core.compat.Guid storageDomainId ) { if ( ( volumeFormat == ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.RAW ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Sparse ) ) ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic destDomain = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getStorageDomainStaticDAO ( ) . get ( storageDomainId ) ; if ( destDomain.getStorageType ( ) . isBlockDomain ( ) ) { return org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.COW ; } } return volumeFormat ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.VolumeFormat getTargetVolumeFormat ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat volumeFormat , org.ovirt.engine.core.common.businessentities.storage.VolumeType volumeType , org.ovirt.engine.core.compat.Guid storageDomainId ) { if ( ( volumeFormat == ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.RAW ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Sparse ) ) ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic destDomain = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getStorageDomainStaticDao ( ) . get ( storageDomainId ) ; if ( destDomain.getStorageType ( ) . isBlockDomain ( ) ) { return org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.COW ; } } return volumeFormat ; }
Source:
public void mapNoneSsoFromBackendToRest ( ) { org.ovirt.engine.core.common.businessentities.SsoMethod backendSsoMethod = org.ovirt.engine.core.common.businessentities.SsoMethod.NONE ; org.ovirt.engine.api.model.Sso restSso = org.ovirt.engine.api.restapi.types.SsoMapper.map ( backendSsoMethod , null ) ; org.junit.Assert.assertNotNull ( restSso ) ; org.junit.Assert.assertNotNull ( restSso.getMethods ( ) ) ; org.junit.Assert.assertNotNull ( restSso.getMethods ( ) . getMethods ( ) ) ; org.junit.Assert.assertTrue ( restSso.getMethods ( ) . getMethods ( ) . isEmpty ( ) ) ; }

Target:
public void mapNoneSsoFromBackendToRest ( ) { org.ovirt.engine.core.common.businessentities.SsoMethod backendSsoMethod = org.ovirt.engine.core.common.businessentities.SsoMethod.NONE ; org.ovirt.engine.api.model.Sso restSso = org.ovirt.engine.api.restapi.types.SsoMapper.map ( backendSsoMethod , null ) ; org.junit.jupiter.api.Assertions.assertNotNull ( restSso ) ; org.junit.jupiter.api.Assertions.assertNotNull ( restSso.getMethods ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( restSso.getMethods ( ) . getMethods ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( restSso.getMethods ( ) . getMethods ( ) . isEmpty ( ) ) ; }
Source:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( EngineMessage.CLUSTER_UPGRADE_DETAIL_VM_NUMA_PINNED.name ( ) ) ; }

Target:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Collections.singletonList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( EngineMessage.CLUSTER_UPGRADE_DETAIL_VM_NUMA_PINNED.name ( ) ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( ( succeeded ? ( ( org.ovirt.engine.core.compat.Guid ) ( retVal.getActionReturnValue ( ) ) ) : null ) , succeeded ) ; }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { onGetClusterList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( ReturnValue ) ) ) ; }
Source:
private void createCommand ( ) { org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase params = new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( ) ; params.setStorageDomainId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; params.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.domain.ActivateStorageDomainCommand ( params , null ) ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( cmd ) . getVdsDao ( ) ; }

Target:
private void createCommand ( ) { org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase params = new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( ) ; params.setStorageDomainId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; params.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.domain.ActivateStorageDomainCommand ( params , null ) ) ; cmd.init ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( cmd ) . getVdsDao ( ) ; }
Source:
public void testIsConnectionDoesNotExistForHostAndTargetFails ( ) { org.mockito.Mockito.when ( storageServerConnectionExtensionDao.getByHostIdAndTarget ( conn.getHostId ( ) , conn.getIqn ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension ( ) ) ; org.junit.Assert.assertThat ( validator.isConnectionDoesNotExistForHostAndTarget ( conn ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_EXTENSION_ALREADY_EXISTS ) ) ; }

Target:
public void testIsConnectionDoesNotExistForHostAndTargetFails ( ) { org.mockito.Mockito.when ( storageServerConnectionExtensionDao.getByHostIdAndTarget ( conn.getHostId ( ) , conn.getIqn ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.isConnectionDoesNotExistForHostAndTarget ( conn ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_EXTENSION_ALREADY_EXISTS ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ! ( getGlusterUtil ( ) . isGlusterSnapshotSupported ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getId ( ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } if ( ! ( getGlusterUtil ( ) . isGlusterSnapshotSupported ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getId ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED ) ; } return true ; }
Source:
protected int calcEvenDistributionScore ( float maxMemoryOfVdsInCluster , org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VM vm , boolean countThreadsAsCores ) { int score = ( MaxSchedulerWeight ) - 1 ; java.lang.Integer effectiveCpuCores = slaValidator.getEffectiveCpuCores ( vds , countThreadsAsCores ) ; if ( ( effectiveCpuCores != null ) && ( ( vds.getUsageCpuPercent ( ) ) != null ) ) { score = java.lang.Math.min ( ( ( ( int ) ( java.lang.Math.round ( calcDistributeMetric ( vds , vm , effectiveCpuCores ) ) ) ) + 1 ) , org.ovirt.engine.core.bll.scheduling.policyunits.MaxSchedulerWeight ) ; } return score ; }

Target:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters ) { boolean countThreadsAsCores = cluster.getCountThreadsAsCores ( ) ; java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > scores = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hosts ) { scores.add ( new org.ovirt.engine.core.common.utils.Pair ( vds.getId ( ) , calcHostScore ( vds , vm , countThreadsAsCores ) ) ) ; } return scores ; }
Source:
public final com.google.gwt.safehtml.shared.SafeHtml getValue ( T object ) { java.lang.Integer progressValue = getProgressValue ( object ) ; int progress = ( progressValue != null ) ? progressValue : 0 ; java.lang.String text = getProgressText ( object ) ; java.lang.String color = ( progress < 70 ) ? "#669966" : progress < 95 ? "#FF9900" : "#FF0000" ; return org.ovirt.engine.ui.webadmin.gin.ClientGinjectorProvider.getApplicationTemplates ( ) . progressBar ( progress , text , color ) ; }

Target:
protected java.lang.String getColorByProgress ( int progress ) { if ( progress < 70 ) { return org.ovirt.engine.ui.webadmin.widget.table.column.ProgressBarColumn.ProgressBarColors.GREEN.asCode ( ) ; } else if ( progress < 95 ) { return org.ovirt.engine.ui.webadmin.widget.table.column.ProgressBarColumn.ProgressBarColors.ORANGE.asCode ( ) ; } else { return org.ovirt.engine.ui.webadmin.widget.table.column.ProgressBarColumn.ProgressBarColors.RED.asCode ( ) ; } }
Source:
public void testMigrateMacsToAnotherMacPool ( ) throws java.lang.Exception { underTest.migrateMacsToAnotherMacPool ( sourceMacPoolId , targetMacPoolId , macsToMigrate , false , commandContext ) ; org.mockito.Mockito.verify ( macPoolPerCluster ) . getMacPoolById ( sourceMacPoolId , commandContext ) ; org.mockito.Mockito.verify ( macPoolPerCluster ) . getMacPoolById ( targetMacPoolId , commandContext ) ; org.mockito.InOrder inOrder = org.mockito.Mockito.inOrder ( sourceMacPool , targetMacPool ) ; inOrder.verify ( sourceMacPool ) . freeMacs ( macsToMigrate ) ; inOrder.verify ( targetMacPool ) . forceAddMacs ( macsToMigrate ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.Cluster createClusterAndMockMacs ( org.ovirt.engine.core.compat.Guid sourceMacPoolId , java.util.List < java.lang.String > macsToMigrate ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = createCluster ( sourceMacPoolId ) ; org.mockito.Mockito.when ( vmNicDao.getAllMacsByClusterId ( cluster.getId ( ) ) ) . thenReturn ( macsToMigrate ) ; return cluster ; }
Source:
private static boolean isDiskOrInterface ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { return ( ( vmDevice.getDevice ( ) . equals ( VmDeviceType.DISK.getName ( ) ) ) && ( ( vmDevice.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK ) ) ) || ( ( vmDevice.getDevice ( ) . equals ( VmDeviceType.BRIDGE.getName ( ) ) ) && ( ( vmDevice.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.INTERFACE ) ) ) ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > getVirtioScsiControllers ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.CONTROLLER , VmDeviceType.VIRTIOSCSI.getName ( ) , userID , isFiltered ) ; }
Source:
public void autoCompletedInputIsAlwaysValid ( java.util.Map.Entry < java.lang.Integer , java.lang.String > osCompletionEntry ) { java.lang.String reason = ( "input " + ( osCompletionEntry.getValue ( ) ) ) + " is invalid" ; org.junit.Assert.assertThat ( reason , true , org.hamcrest.core.Is.is ( completer.validate ( osCompletionEntry.getValue ( ) ) ) ) ; }

Target:
public void autoCompletedInputIsAlwaysValid ( java.util.Map.Entry < java.lang.Integer , java.lang.String > osCompletionEntry ) { java.lang.String reason = ( "input " + ( osCompletionEntry.getValue ( ) ) ) + " is invalid" ; org.hamcrest.MatcherAssert.assertThat ( reason , true , org.hamcrest.core.Is.is ( completer.validate ( osCompletionEntry.getValue ( ) ) ) ) ; }
Source:
public void setUp ( ) { storagePool = cmd.getParameters ( ) . getStoragePool ( ) ; cmd.init ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; }

Target:
public void setUp ( ) { storagePool = cmd.getParameters ( ) . getStoragePool ( ) ; cmd.init ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > networkQoSes = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( ReturnValue ) ) ; getNetworkQoS ( ) . setItems ( networkQoSes ) ; getNetworkQoS ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.findNetworkQosById ( networkQoSes , defaultQosId ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > networkQoSes = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( ReturnValue ) ) ; getNetworkQoS ( ) . setItems ( networkQoSes ) ; defaultQos = org.ovirt.engine.ui.uicommonweb.Linq.findNetworkQosById ( networkQoSes , defaultQosId ) ; getNetworkQoS ( ) . setSelectedItem ( defaultQos ) ; }
Source:
public void getRoleList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public void getConfiguredVmHostDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmHostDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void testPK ( ) throws java.lang.Exception { try ( final java.io.ByteArrayOutputStream out = new org.ovirt.engine.core.uutils.ssh.ConstraintByteArrayOutputStream ( 500 ) ) { client.setKeyPair ( TestCommon.keyPair ) ; client.connect ( ) ; client.authenticate ( ) ; client.executeCommand ( org.ovirt.engine.core.uutils.ssh.BasicTest.helloCommand , null , out , null ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.uutils.ssh.BasicTest.helloResult , new java.lang.String ( out.toByteArray ( ) , "UTF-8" ) ) ; } }

Target:
public void testPK ( ) throws java.lang.Exception { try ( final java.io.ByteArrayOutputStream out = new org.ovirt.engine.core.uutils.ssh.ConstraintByteArrayOutputStream ( 500 ) ) { client.setKeyPair ( TestCommon.keyPair ) ; client.connect ( ) ; client.authenticate ( ) ; client.executeCommand ( org.ovirt.engine.core.uutils.ssh.BasicTest.helloCommand , null , out , null ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.uutils.ssh.BasicTest.helloResult , new java.lang.String ( out.toByteArray ( ) , "UTF-8" ) ) ; } }
Source:
public static void GetExternalNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }

Target:
public static void getExternalNetworkMap ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { 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 ) { if ( source == null ) { return new java.util.HashMap < org.ovirt.engine.core.common.businessentities.network.Network , java.util.Set < org.ovirt.engine.core.compat.Guid > > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( result.getState ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel ) ( array [ 0 ] ) ) ; boolean localApproveInitiated = ( ( java.lang.Boolean ) ( array [ 1 ] ) ) ; localModel.PostOnSaveInternal ( result.getReturnValue ( ) , localApproveInitiated ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( result.getState ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel ) ( array [ 0 ] ) ) ; boolean localApproveInitiated = ( ( java.lang.Boolean ) ( array [ 1 ] ) ) ; localModel.postOnSaveInternal ( result.getReturnValue ( ) , localApproveInitiated ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc glusterVolumeGeoRepSessionStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String userName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionStatus" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withOptionalParameter ( "remoteUserName" , userName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetail glusterVolumeGeoRepSessionStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String userName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionStatus" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withOptionalParameter ( "remoteUserName" , userName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetail ( response ) ; }
Source:
public static void addImportedDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , boolean isImportAsNewEntity ) { if ( isImportAsNewEntity ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setNewIdInImportedCollections ( vmBase ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevicesToAdd = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevicesToUpdate = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDiskDevices ( vmBase , vmDevicesToUpdate ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedInterfaces ( vmBase , vmDevicesToUpdate ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedOtherDevices ( vmBase , vmDevicesToAdd ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.saveAll ( vmDevicesToAdd ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.updateAll ( vmDevicesToUpdate ) ; }

Target:
public void addImportedDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , boolean isImportAsNewEntity ) { if ( isImportAsNewEntity ) { setNewIdInImportedCollections ( vmBase ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevicesToAdd = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevicesToUpdate = new java.util.ArrayList < > ( ) ; addImportedDiskDevices ( vmBase , vmDevicesToUpdate ) ; addImportedInterfaces ( vmBase , vmDevicesToUpdate ) ; addImportedOtherDevices ( vmBase , vmDevicesToAdd ) ; vmDeviceDao.saveAll ( vmDevicesToAdd ) ; vmDeviceDao.updateAll ( vmDevicesToUpdate ) ; }
Source:
public void newNetwork ( ) { if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel networkModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.NewNetworkModel ( this ) ; setWindow ( networkModel ) ; networkModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) ) ; networkModel.getDataCenters ( ) . setSelectedItem ( getEntity ( ) ) ; }

Target:
public void search ( ) { if ( ( getEntity ( ) ) != null ) { super . search ( ) ; } }
Source:
private static boolean canPlugInterface ( org.ovirt.engine.core.common.businessentities.network.VmNic iface , org.ovirt.engine.core.compat.Guid vdsGroupId ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVdsGroupDao ( ) . get ( vdsGroupId ) ; org.ovirt.engine.core.compat.Guid dataCenterId = ( vdsGroup == null ) ? null : vdsGroup.getStoragePoolId ( ) ; boolean canPlugInterface = org.ovirt.engine.core.bll.utils.VmDeviceUtils.canPlugInterfaceInDc ( iface , dataCenterId ) ; if ( ! canPlugInterface ) { new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) . auditLogMacInUseUnplug ( iface ) ; } return canPlugInterface ; }

Target:
private static boolean canPlugInterface ( org.ovirt.engine.core.common.businessentities.network.VmNic iface , org.ovirt.engine.core.compat.Guid vdsGroupId ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVdsGroupDao ( ) . get ( vdsGroupId ) ; org.ovirt.engine.core.compat.Guid dataCenterId = ( vdsGroup == null ) ? null : vdsGroup.getStoragePoolId ( ) ; java.lang.String macAddress = iface.getMacAddress ( ) ; boolean canPlugInterface = org.ovirt.engine.core.bll.utils.VmDeviceUtils.canPlugInterfaceInDc ( macAddress , dataCenterId ) ; if ( ! canPlugInterface ) { new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) . auditLogMacInUseUnplug ( iface ) ; } return canPlugInterface ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isDomainOfConnectionExistsAndInactive ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( storageDomain == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } if ( ( ( storageDomain.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Maintenance ) ) && ( ( storageDomain.getStorageDomainSharedStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_FOR_DOMAINS_STATUS , java.lang.String.format ( org.ovirt.engine.core.bll.validator.storage.StorageConnectionValidator.STORAGE_DOMAIN_NAME_REPLACEMENT , storageDomain.getStorageName ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isDomainOfConnectionExistsAndInactive ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( storageDomain == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } if ( ( ( storageDomain.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Maintenance ) ) && ( ( storageDomain.getStorageDomainSharedStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_DOMAIN_MUST_BE_IN_MAINTENANCE_OR_UNATTACHED , java.lang.String.format ( org.ovirt.engine.core.bll.validator.storage.StorageConnectionValidator.STORAGE_DOMAIN_NAME_REPLACEMENT , storageDomain.getStorageName ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > buildVmGraphicsSpecParamsFromVm ( java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > infos ) { java.util.Map < java.lang.String , java.lang.Object > specParamsFromVm = null ; if ( ( infos != null ) && ( infos.containsKey ( GraphicsType.SPICE ) ) ) { specParamsFromVm = new java.util.HashMap ( ) ; addVmSpiceOptions ( infos , specParamsFromVm ) ; } return specParamsFromVm ; }

Target:
public static void addNetworkFiltersToNic ( java.util.Map < java.lang.String , java.lang.Object > struct , org.ovirt.engine.core.common.businessentities.network.VmNic vmNic ) { final org.ovirt.engine.core.common.businessentities.network.NetworkFilter networkFilter = org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.fetchVnicProfileNetworkFilter ( vmNic ) ; if ( networkFilter != null ) { final java.lang.String networkFilterName = networkFilter.getName ( ) ; struct.put ( VdsProperties.NW_FILTER , networkFilterName ) ; } }
Source:
public void run ( ) { try { org.ovirt.engine.core.common.action.VdcReturnValueBase ret = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ApproveVds , params ) ; if ( ( ret == null ) || ( ! ( ret.getSucceeded ( ) ) ) ) { log.errorFormat ( "Approval of oVirt {0} failed. " , params.getVdsId ( ) ) ; } else if ( ret.getSucceeded ( ) ) { log.infoFormat ( "Approval of oVirt {0} ended successfully. " , params.getVdsId ( ) ) ; } } catch ( java.lang.RuntimeException ex ) { log.error ( "Failed to Approve host" , ex ) ; } }

Target:
public void run ( ) { try { org.ovirt.engine.core.common.action.VdcReturnValueBase ret = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ApproveVds , params ) ; if ( ( ret == null ) || ( ! ( ret.getSucceeded ( ) ) ) ) { log.error ( "Approval of oVirt '{}' failed. " , params.getVdsId ( ) ) ; } else if ( ret.getSucceeded ( ) ) { log.info ( "Approval of oVirt '{}' ended successfully. " , params.getVdsId ( ) ) ; } } catch ( java.lang.RuntimeException ex ) { log.error ( "Failed to Approve host" , ex ) ; } }