auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void updateMemoryBalloonDevice ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } boolean isBalloonEnabled = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isBalloonEnabled ( osType , cluster.getcompatibility_version ( ) ) ; getMemoryBalloonDeviceEnabled ( ) . setIsChangable ( isBalloonEnabled ) ; if ( getBehavior ( ) . basedOnCustomInstanceType ( ) ) { getMemoryBalloonDeviceEnabled ( ) . setEntity ( isBalloonEnabled ) ; } }

Target:
private void updateMemoryBalloonDevice ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } boolean isBalloonEnabled = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isBalloonEnabled ( osType , cluster.getCompatibilityVersion ( ) ) ; getMemoryBalloonDeviceEnabled ( ) . setIsChangeable ( isBalloonEnabled ) ; if ( getBehavior ( ) . basedOnCustomInstanceType ( ) ) { getMemoryBalloonDeviceEnabled ( ) . setEntity ( isBalloonEnabled ) ; } }
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.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredClusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterByArchitecture ( clusters , selectedTemplate.getClusterArch ( ) ) ; model.setDataCentersAndClusters ( model , dataCenters , filteredClusters , selectedTemplate.getVdsGroupId ( ) ) ; initCdImage ( ) ; }

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.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > filteredClusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterByArchitecture ( clusters , selectedTemplate.getClusterArch ( ) ) ; model.setDataCentersAndClusters ( model , dataCenters , filteredClusters , selectedTemplate.getClusterId ( ) ) ; initCdImage ( ) ; }
Source:
private org.ovirt.engine.api.model.SchedulingPolicies getSchedulingPolicies ( ) { org.ovirt.engine.api.model.SchedulingPolicies policies = new org.ovirt.engine.api.model.SchedulingPolicies ( ) ; for ( org.ovirt.engine.api.model.SchedulingPolicyType policy : org.ovirt.engine.api.model.SchedulingPolicyType.values ( ) ) { policies.getPolicy ( ) . add ( policy.value ( ) ) ; } return policies ; }

Target:
private void addVmPoolTypes ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.VmPoolType [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_6 ) ) { org.ovirt.engine.api.model.VmPoolTypes types = new org.ovirt.engine.api.model.VmPoolTypes ( ) ; for ( org.ovirt.engine.api.model.VmPoolType state : values ) { types.getVmPoolTypes ( ) . add ( state.value ( ) ) ; } version.setVmPoolTypes ( types ) ; } }
Source:
private static void addFloppyDetails ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct struct ) { struct.add ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.add ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; struct.add ( VdsProperties.Index , "0" ) ; struct.add ( VdsProperties.Iface , VdsProperties.Fdc ) ; struct.add ( VdsProperties.ReadOnly , java.lang.String.valueOf ( vmDevice.getIsReadOnly ( ) ) ) ; }

Target:
private static void addFloppyDetails ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct struct ) { struct.add ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.add ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; struct.add ( VdsProperties.Index , "0" ) ; struct.add ( VdsProperties.Iface , VdsProperties.Fdc ) ; struct.add ( VdsProperties.ReadOnly , java.lang.String.valueOf ( vmDevice.getIsReadOnly ( ) ) ) ; struct.add ( VdsProperties.Shareable , java.lang.Boolean.FALSE.toString ( ) ) ; }
Source:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password , org.ovirt.engine.core.common.businessentities.OriginType originType , java.util.List < java.lang.String > vmsToImport ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , originType , vdsId , dataCenterId , vmsToImport ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { addCustomValue ( "NicName" , getNic ( ) . getName ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( VdcActionType.PersistentSetupNetworks , new org.ovirt.engine.core.bll.network.RemoveNetworksByLabelParametersBuilder ( org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.getContext ( ) ) . buildParameters ( getNic ( ) , getLabel ( ) , org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.getVds ( ) . getVdsGroupId ( ) ) , org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }

Target:
private org.ovirt.engine.core.common.action.HostSetupNetworksParameters createHostSetupNetworksParameters ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.getVdsId ( ) ) ; params.setRemovedLabels ( java.util.Collections.singleton ( getLabel ( ) ) ) ; return params ; }
Source:
public void testIsNetworkInSyncWhenStaticBootProtocolNetmaskDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocolNetmask ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL , false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv6StaticBootProtocolNetmaskEqual ( ) throws java.lang.Exception { initIpv6ConfigurationBootProtocolPrefix ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV6_BOOT_PROTOCOL , true ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
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 ) ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
private void subscribe ( java.lang.String queueName ) { java.lang.String subId = java.util.UUID.randomUUID ( ) . toString ( ) ; subscriptionIds.add ( subId ) ; send ( new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . subscribe ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_DESTINATION , queueName ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_ID , subId ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_ACK , "auto" ) . build ( ) ) ; }

Target:
private void subscribe ( java.lang.String queueName ) { java.lang.String subId = java.util.UUID.randomUUID ( ) . toString ( ) ; subscriptionIds.add ( subId ) ; sendNow ( new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . subscribe ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_DESTINATION , queueName ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_ID , subId ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_ACK , "auto" ) . build ( ) ) ; }
Source:
public void shouldDetectTooMuchVmNumaNodes ( ) { vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; assertValidationFailure ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_PREFERRED_NOT_PINNED_TO_SINGLE_NODE ) ; }

Target:
public void shouldDetectInsufficientMemory ( ) { vm.setNumaTuneMode ( NumaTuneMode.STRICT ) ; vmNumaNodes.get ( 0 ) . setMemTotal ( 1000 ) ; vdsNumaNodes.get ( 0 ) . setMemTotal ( 500 ) ; assertValidationFailure ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_MEMORY_ERROR ) ; }
Source:
public static org.ovirt.engine.core.vdsbroker.VMStatsRefresher create ( final org.ovirt.engine.core.vdsbroker.VdsManager manager , final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector auditLogDirector , final org.ovirt.engine.core.utils.timer.SchedulerUtil scheduler ) { org.ovirt.engine.core.compat.Version version = manager.getCompatibilityVersion ( ) ; if ( ( ( org.ovirt.engine.core.common.FeatureSupported.jsonProtocol ( version ) ) && ( ( org.ovirt.engine.core.common.businessentities.VdsProtocol.STOMP ) == ( manager.getCopyVds ( ) . getProtocol ( ) ) ) ) && ( org.ovirt.engine.core.common.FeatureSupported.vmStatsEvents ( version ) ) ) { return new org.ovirt.engine.core.vdsbroker.jsonrpc.EventVMStatsRefresher ( manager , auditLogDirector , scheduler ) ; } return new org.ovirt.engine.core.vdsbroker.PollVMStatsRefresher ( manager , auditLogDirector , scheduler ) ; }

Target:
private org.ovirt.engine.core.vdsbroker.VmStatsRefresher getRefresherForVds ( org.ovirt.engine.core.vdsbroker.VdsManager vdsManager ) { org.ovirt.engine.core.compat.Version version = vdsManager.getCompatibilityVersion ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = vdsManager.getCopyVds ( ) ; if ( ( ( org.ovirt.engine.core.common.FeatureSupported.jsonProtocol ( version ) ) && ( ( org.ovirt.engine.core.common.businessentities.VdsProtocol.STOMP ) == ( vds.getProtocol ( ) ) ) ) && ( org.ovirt.engine.core.common.FeatureSupported.vmStatsEvents ( version ) ) ) { return new org.ovirt.engine.core.vdsbroker.jsonrpc.EventVmStatsRefresher ( vdsManager ) ; } return new org.ovirt.engine.core.vdsbroker.PollListAndAllVmStatsRefresher ( vdsManager ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getRoleGroupMapDAO ( ) ) ; existingRoleGroupMap = dao.getByActionGroupAndRole ( ActionGroup.VM_BASIC_OPERATIONS , org.ovirt.engine.core.dao.RoleGroupMapDAOTest.EXISTING_ROLE_ID ) ; actionGroup = org.ovirt.engine.core.common.businessentities.ActionGroup.CONNECT_TO_VM ; newRoleGroupMap = new org.ovirt.engine.core.common.businessentities.RoleGroupMap ( actionGroup , org.ovirt.engine.core.dao.RoleGroupMapDAOTest.EXISTING_ROLE_ID ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getRoleGroupMapDao ( ) ) ; existingRoleGroupMap = dao.getByActionGroupAndRole ( ActionGroup.VM_BASIC_OPERATIONS , org.ovirt.engine.core.dao.RoleGroupMapDAOTest.EXISTING_ROLE_ID ) ; actionGroup = org.ovirt.engine.core.common.businessentities.ActionGroup.CONNECT_TO_VM ; newRoleGroupMap = new org.ovirt.engine.core.common.businessentities.RoleGroupMap ( actionGroup , org.ovirt.engine.core.dao.RoleGroupMapDAOTest.EXISTING_ROLE_ID ) ; }
Source:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void validateDestinationDomainValid ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; initializeCommand ( disk , VmEntityType.VM ) ; disk.getStorageIds ( ) . add ( destStorageId ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; command.getParameters ( ) . setStorageDomainId ( destStorageId ) ; command.setStorageDomainId ( destStorageId ) ; command.getStorageDomain ( ) . setId ( destStorageId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DESTINATION_STORAGE_DOMAIN_ALREADY_CONTAINS_THE_DISK ) ; }
Source:
public boolean checkIfCpusExist ( java.lang.String cpuName ) { return ( cpuName != null ) && ( ( ( intelCpuByNameDictionary.containsKey ( cpuName ) ) || ( amdCpuByNameDictionary.containsKey ( cpuName ) ) ) || ( ibmCpuByNameDictionary.containsKey ( cpuName ) ) ) ; }

Target:
public boolean checkIfCpusExist ( java.lang.String cpuName ) { return ( cpuName != null ) && ( ( ( ( intelCpuByNameDictionary.containsKey ( cpuName ) ) || ( amdCpuByNameDictionary.containsKey ( cpuName ) ) ) || ( ibmCpuByNameDictionary.containsKey ( cpuName ) ) ) || ( s390CpuByNameDictionary.containsKey ( cpuName ) ) ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel resolveSelectedConsoleModel ( org.ovirt.engine.core.compat.Guid vmId ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel model : cachedConsoleModels.get ( vmId ) ) { if ( model.isUserSelected ( ) ) { return model ; } } return null ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel resolveUserSelectedConsoleModel ( org.ovirt.engine.core.compat.Guid vmId ) { if ( ! ( cachedConsoleModels.containsKey ( vmId ) ) ) { return null ; } for ( org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel model : cachedConsoleModels.get ( vmId ) ) { if ( model.isUserSelected ( ) ) { return model ; } } return null ; }
Source:
public static < E extends org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > java.util.Map < java.lang.String , E > byName ( java.util.Collection < E > collection ) { java.util.Map < java.lang.String , E > map = new java.util.HashMap < > ( ) ; for ( E e : collection ) { map.put ( e.getName ( ) , e ) ; } return map ; }

Target:
public static void addBondToParams ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel , org.ovirt.engine.core.common.businessentities.network.Bond bond ) { for ( java.util.Iterator < org.ovirt.engine.core.common.businessentities.network.Bond > iter = dataFromHostSetupNetworksModel.removedBonds.iterator ( ) ; iter.hasNext ( ) ; ) { org.ovirt.engine.core.common.businessentities.network.Bond removedBond = iter.next ( ) ; if ( removedBond.getName ( ) . equals ( bond.getName ( ) ) ) { iter.remove ( ) ; break ; } } dataFromHostSetupNetworksModel.newOrModifiedBonds.add ( bond ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.NFS , true ) ; setUpGetConnectionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachStorageDomainFromPool , org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.NFS , true ) ; setUpGetConnectionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.DetachStorageDomainFromPool , org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private static void clearNetworks ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel nic , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > attachedNetworks = nic.getItems ( ) ; if ( ( attachedNetworks.size ( ) ) > 0 ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( attachedNetworks ) ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.DETACH_NETWORK.getCommand ( networkModel , null , allNics ) . Execute ( ) ; } } }

Target:
private static void clearNetworks ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel nic , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > attachedNetworks = nic.getItems ( ) ; if ( ( attachedNetworks.size ( ) ) > 0 ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( attachedNetworks ) ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.DETACH_NETWORK.getCommand ( networkModel , null , allNics ) . execute ( ) ; } } }
Source:
protected boolean canAddDomain ( ) { if ( ( ( ( org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand.getParameters ( ) . getLunIds ( ) ) == null ) || ( org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand.getParameters ( ) . getLunIds ( ) . isEmpty ( ) ) ) && ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand.getStorageDomain ( ) . getStorage ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ERROR_CANNOT_CREATE_STORAGE_DOMAIN_WITHOUT_VG_LV ) ; } return true ; }

Target:
protected boolean canAddDomain ( ) { if ( ( ( ( org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand.getParameters ( ) . getLunIds ( ) ) == null ) || ( org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand.getParameters ( ) . getLunIds ( ) . isEmpty ( ) ) ) && ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand.getStorageDomain ( ) . getStorage ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ERROR_CANNOT_CREATE_STORAGE_DOMAIN_WITHOUT_VG_LV ) ; } if ( isLunsAlreadyInUse ( org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand.getParameters ( ) . getLunIds ( ) ) ) { return false ; } return true ; }
Source:
public void Rollback ( ) { try { org.ovirt.engine.core.vdsbroker.irsbroker.IrsCreateCommand.getIrsProxy ( ) . deleteVolume ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsCreateCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.IrsCreateCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.IrsCreateCommand.getParameters ( ) . getImageGroupId ( ) . toString ( ) , new java.lang.String [ ] { mCreatedImageId } , "false" , "false" ) ; } catch ( java.lang.Exception e ) { } BaseRollback ( ) ; }

Target:
public void rollback ( ) { try { org.ovirt.engine.core.vdsbroker.irsbroker.IrsCreateCommand.getIrsProxy ( ) . deleteVolume ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsCreateCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.IrsCreateCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.IrsCreateCommand.getParameters ( ) . getImageGroupId ( ) . toString ( ) , new java.lang.String [ ] { mCreatedImageId } , "false" , "false" ) ; } catch ( java.lang.Exception e ) { } BaseRollback ( ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel object ) { if ( ! ( object.getAvailableProxies ( ) . getItems ( ) . isEmpty ( ) ) ) { pmProxyType.setVisible ( true ) ; noItemsAvailableLabel.setVisible ( false ) ; driver.edit ( object ) ; doFlush = true ; } else { pmProxyType.setVisible ( false ) ; noItemsAvailableLabel.setVisible ( true ) ; doFlush = false ; } }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel object ) { if ( ! ( object.getAvailableProxies ( ) . getItems ( ) . isEmpty ( ) ) ) { pmProxyTypeRow.setVisible ( true ) ; noItemsAvailableLabelRow.setVisible ( false ) ; driver.edit ( object ) ; doFlush = true ; } else { pmProxyTypeRow.setVisible ( false ) ; noItemsAvailableLabelRow.setVisible ( true ) ; doFlush = false ; } }
Source:
public static org.ovirt.engine.api.model.NfsVersion map ( org.ovirt.engine.api.model.NfsVersion version , org.ovirt.engine.api.model.NfsVersion outgoing ) { switch ( version ) { case V3 : return org.ovirt.engine.api.model.NfsVersion.V3 ; case V4 : return org.ovirt.engine.api.model.NfsVersion.V4 ; case V4_1 : return org.ovirt.engine.api.model.NfsVersion.V4_1 ; case AUTO : return org.ovirt.engine.api.model.NfsVersion.AUTO ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.NfsVersion map ( org.ovirt.engine.api.model.NfsVersion version , org.ovirt.engine.api.model.NfsVersion outgoing ) { switch ( version ) { case V3 : return org.ovirt.engine.api.model.NfsVersion.V3 ; case V4 : return org.ovirt.engine.api.model.NfsVersion.V4 ; case V4_1 : return org.ovirt.engine.api.model.NfsVersion.V4_1 ; case V4_2 : return org.ovirt.engine.api.model.NfsVersion.V4_2 ; case AUTO : return org.ovirt.engine.api.model.NfsVersion.AUTO ; default : return null ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } else { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( model ) ) ; loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.EMPTY ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { _defaultConfigurationVersion = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } else { _defaultConfigurationVersion = GENERAL ; } org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( model ) ) ; loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.EMPTY ) ; }
Source:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void validateEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public void setUp ( ) { createStorageDomain ( ) ; storageDomainDisks = new java.util.LinkedList < > ( ) ; org.mockito.Mockito.when ( diskImageDao.getAllForStorageDomain ( storageDomain.getId ( ) ) ) . thenReturn ( storageDomainDisks ) ; storageDomainVmDisks = new java.util.LinkedList < > ( ) ; org.mockito.Mockito.when ( diskVmElementDao.getAllDiskVmElementsByDisksIds ( org.mockito.Matchers.anyCollectionOf ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomainVmDisks ) ; }

Target:
public void setUp ( ) { createStorageDomain ( ) ; storageDomainDisks = new java.util.LinkedList < > ( ) ; org.mockito.Mockito.when ( diskImageDao.getAllForStorageDomain ( storageDomain.getId ( ) ) ) . thenReturn ( storageDomainDisks ) ; storageDomainVmDisks = new java.util.LinkedList < > ( ) ; org.mockito.Mockito.when ( diskVmElementDao.getAllDiskVmElementsByDisksIds ( org.mockito.Matchers.anyCollectionOf ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomainVmDisks ) ; org.mockito.Mockito.when ( storageDomainDao.get ( storageDomain.getId ( ) ) ) . thenReturn ( storageDomain ) ; }
Source:
private boolean connectStorageToLunByVdsId ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.LUNs lun ) { try { return org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) . getStorageType ( ) ) . connectStorageToLunByVdsId ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) , vds.getId ( ) , lun , Guid.Empty ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { handleFailure ( vds , lun ) ; throw e ; } }

Target:
private boolean connectStorageToLunByVdsId ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.storage.LUNs lun ) { try { return org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) . getStorageType ( ) ) . connectStorageToLunByVdsId ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) , vds.getId ( ) , lun , Guid.Empty ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { handleFailure ( vds , lun ) ; throw e ; } }
Source:
public static void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public static void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void nameIsAlreadyUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) , org.mockito.Matchers.any ( java.lang.Boolean.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ) ) ; org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CLUSTER_CANNOT_DO_ACTION_NAME_IN_USE ) ) ; }

Target:
public void nameIsAlreadyUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.any ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ) ) ; org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CLUSTER_CANNOT_DO_ACTION_NAME_IN_USE ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase res = result.getReturnValue ( ) ; if ( ( res == null ) || ( ! ( res.getSucceeded ( ) ) ) ) { return ; } cancel ( ) ; sourceListModel.getSearchCommand ( ) . execute ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase res = result.getReturnValue ( ) ; getTestResult ( ) . setEntity ( ( ( res != null ) && ( res.getSucceeded ( ) ) ) ) ; }
Source:
public void getMaxVmPriority ( 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 ) { if ( source == null ) { return 100 ; } return source ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPriorityMaxValue , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getMaxVmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Integer > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( 100 ) ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPriorityMaxValue , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; javax.ws.rs.core.Response response = resource.remove ( ) ; verifyRemove ( response ) ; }

Target:
public void testBadGuid ( ) throws java.lang.Exception { control.replay ( ) ; try { new org.ovirt.engine.api.restapi.resource.BackendTemplateResource ( "foo" ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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 : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
protected void initProviderList ( ) { startProgress ( null ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetAllNetworkProviders ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) ; providers.add ( 0 , null ) ; getProviders ( ) . setItems ( providers ) ; } } ) ) ; }

Target:
protected void initProviderList ( ) { startProgress ( null ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getAllNetworkProviders ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) ; providers.add ( 0 , null ) ; getProviders ( ) . setItems ( providers ) ; } } ) ) ; }
Source:
public void validateSlaveHasNoLabelsOldLabelWasRemovedValid ( ) { final java.lang.String removedLabelName = "lbl1" ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; slave.setLabels ( java.util.Collections.singleton ( removedLabelName ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedLabels ( removedLabelName ) ) . addExistingInterfaces ( slave ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateSlaveHasNoLabels ( slave.getName ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void validateSlaveHasNoLabelsOldLabelWasRemovedValid ( ) { final java.lang.String removedLabelName = "lbl1" ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; slave.setLabels ( java.util.Collections.singleton ( removedLabelName ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedLabels ( removedLabelName ) ) . addExistingInterfaces ( slave ) . build ( ) ; org.hamcrest.MatcherAssert.assertThat ( validator.validateSlaveHasNoLabels ( slave.getName ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network lookupAtachedNetwork ( java.lang.String networkName ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( networkName ) ) ) { for ( org.ovirt.engine.core.common.businessentities.network nwk : parent.getClusterNetworks ( ) ) { if ( nwk.getname ( ) . equals ( networkName ) ) return nwk ; } } return null ; }

Target:
private org.ovirt.engine.api.model.Network lookupAtachedNetwork ( java.lang.String networkName ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( networkName ) ) ) { for ( org.ovirt.engine.api.model.Network nwk : parent.getClusterNetworks ( ) ) { if ( nwk.getname ( ) . equals ( networkName ) ) return nwk ; } } return null ; }
Source:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getLunIdColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ? ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( object ) ) . getLun ( ) . getLUN_id ( ) : null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > getLunIdColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ? ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( object ) ) . getLun ( ) . getLUN_id ( ) : null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.DiskImage getImage ( ) { switch ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getActionState ( ) ) { case END_SUCCESS : case END_FAILURE : if ( ( _diskImage ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getDiskImageDAO ( ) . getAllSnapshotsForImageGroup ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getImageGroupID ( ) ) ; _diskImage = ( diskImages.isEmpty ( ) ) ? null : diskImages.get ( 0 ) ; } return _diskImage ; default : return super . getImage ( ) ; } }

Target:
protected org.ovirt.engine.core.common.businessentities.DiskImage getImage ( ) { switch ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getActionState ( ) ) { case END_SUCCESS : case END_FAILURE : if ( ( _diskImage ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getImageGroupID ( ) ) ; _diskImage = ( diskImages.isEmpty ( ) ) ? null : diskImages.get ( 0 ) ; } return _diskImage ; default : return super . getImage ( ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createConnection ( java.lang.String id , java.lang.String connection , java.lang.String iqn , java.lang.String username , java.lang.String password , java.lang.String portal , java.lang.String port ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newConn = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; newConn.setid ( id ) ; newConn.setconnection ( connection ) ; newConn.setiqn ( iqn ) ; newConn.setportal ( portal ) ; newConn.setport ( port ) ; newConn.setuser_name ( username ) ; newConn.setpassword ( password ) ; dao.save ( newConn ) ; return newConn ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createConnection ( java.lang.String id , java.lang.String connection , java.lang.String iqn , java.lang.String username , java.lang.String password , java.lang.String portal , java.lang.String port ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newConn = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; newConn.setId ( id ) ; newConn.setConnection ( connection ) ; newConn.setIqn ( iqn ) ; newConn.setPortal ( portal ) ; newConn.setPort ( port ) ; newConn.setUserName ( username ) ; newConn.setPassword ( password ) ; dao.save ( newConn ) ; return newConn ; }
Source:
public org.ovirt.engine.sdk.decorators.HostNIC update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.HostNIC.class , org.ovirt.engine.sdk.decorators.HostNIC.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.HostHostNic update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.HostNic.class , org.ovirt.engine.sdk.decorators.HostHostNic.class , headers ) ; }