auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getDomainListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
protected void toggleGhost ( org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel value , org.ovirt.engine.ui.common.widget.form.key_value.KeyValueLineWidget widget , boolean becomingGhost ) { widget.setEnabled ( ( ( ! becomingGhost ) && ( enabled ) ) ) ; widget.keyField.setEnabled ( enabled ) ; setButtonEnabled ( widget , ( ( ! becomingGhost ) && ( enabled ) ) ) ; }

Target:
protected void toggleGhost ( org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel value , org.ovirt.engine.ui.common.widget.form.key_value.KeyValueLineWidget widget , boolean becomingGhost ) { widget.setEnabled ( ( ( ! becomingGhost ) && ( enabled ) ) ) ; widget.keyField.setEnabled ( enabled ) ; setButtonsEnabled ( widget , ( ( ! becomingGhost ) && ( enabled ) ) ) ; }
Source:
private void addInterfaceDeviceToDb ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addNetworkInterfaceDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . isPlugged ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . isPassthrough ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDevice ) ; }

Target:
private void addInterfaceDeviceToDb ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addInterface ( org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . isPlugged ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . isPassthrough ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDevice ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult notChangingManagementNetworkName ( ) { java.lang.String managementNetwork = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.ManagementNetwork ) ; return ( getOldNetwork ( ) . getName ( ) . equals ( managementNetwork ) ) && ( ! ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkName ( ) . equals ( managementNetwork ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_CAN_NOT_REMOVE_DEFAULT_NETWORK ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public java.lang.String getEntityOldName ( ) { return getOldNetwork ( ) . getName ( ) ; }
Source:
public void testAddVmToPool ( ) { int before = dao.getVmPoolsMapByVmPoolId ( newVmPoolMap.getvm_pool_id ( ) ) . size ( ) ; dao.addVmToPool ( newVmPoolMap ) ; int after = dao.getVmPoolsMapByVmPoolId ( newVmPoolMap.getvm_pool_id ( ) ) . size ( ) ; org.junit.Assert.assertEquals ( ( before + 1 ) , after ) ; org.ovirt.engine.core.common.businessentities.vm_pool_map result = dao.getVmPoolMapByVmGuid ( newVmPoolMap.getvm_guid ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( newVmPoolMap , result ) ; }

Target:
public void testAddVmToPool ( ) { int before = dao.getVmPoolsMapByVmPoolId ( newVmPoolMap.getvm_pool_id ( ) ) . size ( ) ; dao.addVmToPool ( newVmPoolMap ) ; int after = dao.getVmPoolsMapByVmPoolId ( newVmPoolMap.getvm_pool_id ( ) ) . size ( ) ; org.junit.Assert.assertEquals ( ( before + 1 ) , after ) ; org.ovirt.engine.core.common.businessentities.VmPoolMap result = dao.getVmPoolMapByVmGuid ( newVmPoolMap.getvm_guid ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( newVmPoolMap , result ) ; }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedBonds ( org.ovirt.engine.core.compat.Guid ... ids ) { if ( emptyParameters ( ids ) ) { return this ; } if ( ( parameters.getRemovedBonds ( ) ) == null ) { parameters.setRemovedBonds ( new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ) ; } parameters.getRemovedBonds ( ) . addAll ( java.util.Arrays.asList ( ids ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedLabels ( java.lang.String ... removedLabels ) { if ( nullParameters ( removedLabels ) ) { return this ; } if ( ( parameters.getRemovedLabels ( ) ) == null ) { parameters.setRemovedLabels ( new java.util.HashSet < > ( ) ) ; } parameters.getRemovedLabels ( ) . addAll ( java.util.Arrays.asList ( removedLabels ) ) ; return this ; }
Source:
public void onSuccess ( java.lang.Object listModel , java.lang.Object returnValue ) { cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; isLinkStateChangeable = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.NetworkLinkingSupported , cluster.getcompatibility_version ( ) . getValue ( ) ) ) ) ; UpdateActionAvailability ( ) ; }

Target:
public void onSuccess ( java.lang.Object listModel , java.lang.Object returnValue ) { cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; isLinkStateChangeable = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.NetworkLinkingSupported , cluster.getcompatibility_version ( ) . getValue ( ) ) ) ) ; updateActionAvailability ( ) ; }
Source:
public void testGetEligibleVolumeListQuery ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.queries.IdQueryParameters ( baseTest.getMASTER_VOLUME_ID ( ) ) ) . when ( getQuery ( ) ) . getParameters ( ) ; getQuery ( ) . executeQueryCommand ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > returnValue = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > expectedVolumes = getExpectedVolumes ( ) ; org.junit.Assert.assertEquals ( expectedVolumes.size ( ) , returnValue.size ( ) ) ; org.junit.Assert.assertTrue ( checkEquals ( returnValue , expectedVolumes ) ) ; }

Target:
public void testGetEligibleVolumeListQuery ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.queries.IdQueryParameters ( baseTest.getMASTER_VOLUME_ID ( ) ) ) . when ( getQuery ( ) ) . getParameters ( ) ; getQuery ( ) . executeQueryCommand ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > returnValue = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > expectedVolumes = getExpectedVolumes ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( expectedVolumes.size ( ) , returnValue.size ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( checkEquals ( returnValue , expectedVolumes ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotUnplugNic ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotunplugNic ( info.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterHookRemove ( java.lang.String glusterCommand , java.lang.String stage , java.lang.String hookName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHookRemove ( glusterCommand , stage , hookName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static void GetVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.GetVmsRunningOnOrMigratingToVdsParameters ( id ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult disksInStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus applicableStatus ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskImages ) { if ( ( diskImage.getImageStatus ( ) ) != applicableStatus ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_IN_APPLICABLE_STATUS , java.lang.String.format ( "$status %s" , applicableStatus.name ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult disksInStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus applicableStatus , org.ovirt.engine.core.common.errors.VdcBllMessages message ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskImages ) { if ( ( diskImage.getImageStatus ( ) ) != applicableStatus ) { return new org.ovirt.engine.core.bll.ValidationResult ( message , java.lang.String.format ( "$status %s" , applicableStatus.name ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddNetwork" ) ) { AddNetwork ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddDisk" ) ) { AddDisk ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddNetwork" ) ) { AddNetwork ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddDisk" ) ) { AddDisk ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }
Source:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpUriExpectations ( null ) ) ; setGetGuestAgentQueryExpectations ( 3 ) ; setUpQueryExpectations ( "" ) ; java.util.List < org.ovirt.engine.api.model.Nic > nics = getCollection ( ) ; org.junit.Assert.assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpUriExpectations ( null ) ) ; setGetGuestAgentQueryExpectations ( 3 ) ; setUpQueryExpectations ( "" ) ; java.util.List < org.ovirt.engine.api.model.Nic > nics = getCollection ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }
Source:
public void testChangeCdUsingMatrixParameter ( ) throws java.lang.Exception { resource.setUriInfo ( setUpChangeCdUriMatrixExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , VMStatus.Up ) ; setUpActionExpectations ( VdcActionType.ChangeDisk , org.ovirt.engine.core.common.action.ChangeDiskCommandParameters.class , new java.lang.String [ ] { "CdImagePath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendCdRomsResourceTest.ISO_PATH } , true , true ) ; org.ovirt.engine.api.model.CdRom cdrom = resource.update ( getUpdate ( ) ) ; assertTrue ( cdrom.isSetFile ( ) ) ; }

Target:
public void testChangeCdUsingMatrixParameter ( ) throws java.lang.Exception { resource.setUriInfo ( setUpChangeCdUriMatrixExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , VMStatus.Up ) ; setUpActionExpectations ( VdcActionType.ChangeDisk , org.ovirt.engine.core.common.action.ChangeDiskCommandParameters.class , new java.lang.String [ ] { "CdImagePath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendCdRomsResourceTest.ISO_PATH } , true , true ) ; org.ovirt.engine.api.model.Cdrom cdrom = resource.update ( getUpdate ( ) ) ; assertTrue ( cdrom.isSetFile ( ) ) ; }
Source:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( QueryType.GetRoleById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( QueryType.GetRoleById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public static java.lang.String encryptPassword ( java.lang.String password ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( password ) ) { return password ; } java.lang.String keyFile = org.ovirt.engine.core.common.config.Config.resolveKeyStorePath ( ) ; java.lang.String passwd = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.keystorePass , ConfigCommon.defaultConfigurationVersion ) ; java.lang.String alias = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.CertAlias , ConfigCommon.defaultConfigurationVersion ) ; try { return org.ovirt.engine.core.utils.crypt.EncryptionUtils.encrypt ( password , keyFile , passwd , alias ) ; } catch ( java.lang.Exception e ) { throw new java.lang.SecurityException ( e ) ; } }

Target:
public static java.lang.String encryptPassword ( java.lang.String password ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( password ) ) { return password ; } org.ovirt.engine.core.utils.EngineLocalConfig config = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) ; java.lang.String keyFile = config.getPKIEngineStore ( ) . getAbsolutePath ( ) ; java.lang.String passwd = config.getPKIEngineStorePassword ( ) ; java.lang.String alias = config.getPKIEngineStoreAlias ( ) ; try { return org.ovirt.engine.core.utils.crypt.EncryptionUtils.encrypt ( password , keyFile , passwd , alias ) ; } catch ( java.lang.Exception e ) { throw new java.lang.SecurityException ( e ) ; } }
Source:
void initialize ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleACronJob ( this , "onTimer" , new java.lang.Class < ? > [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.AutoRecoverySchedule ) ) ; }

Target:
void initialize ( ) { org.ovirt.engine.core.bll.AutoRecoveryManager.log.info ( ( "Start initializing " + ( getClass ( ) . getSimpleName ( ) ) ) ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleACronJob ( this , "onTimer" , new java.lang.Class < ? > [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.AutoRecoverySchedule ) ) ; org.ovirt.engine.core.bll.AutoRecoveryManager.log.info ( ( "Finished initializing " + ( getClass ( ) . getSimpleName ( ) ) ) ) ; }
Source:
public void testSaveMemoryPciPassthroughFailure ( ) { cmd.getParameters ( ) . setSaveMemory ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ) . when ( vmValidator ) . vmNotHavingPciPassthroughDevices ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertThat ( cmd.getReturnValue ( ) . getValidationMessages ( ) , org.hamcrest.Matchers.hasItem ( EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES.name ( ) ) ) ; }

Target:
public void testVmRunningStateless ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS ) ) . when ( vmValidator ) . vmNotRunningStateless ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS ) ; }
Source:
public static boolean isVmPriorityValueLegal ( int value , java.util.List < java.lang.String > reasons ) { boolean res = false ; if ( ( value >= 0 ) && ( value <= ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VmPriorityMaxValue ) ) ) ) { res = true ; } else { reasons.add ( VdcBllMessages.VM_OR_TEMPLATE_ILLEGAL_PRIORITY_VALUE.toString ( ) ) ; reasons.add ( java.lang.String.format ( "$MaxValue %1$s" , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VmPriorityMaxValue ) ) ) ; } return res ; }

Target:
public static boolean isVmPriorityValueLegal ( int value , java.util.List < java.lang.String > reasons ) { boolean res = false ; if ( ( value >= 0 ) && ( value <= ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VmPriorityMaxValue ) ) ) ) { res = true ; } else { reasons.add ( EngineMessage.VM_OR_TEMPLATE_ILLEGAL_PRIORITY_VALUE.toString ( ) ) ; reasons.add ( java.lang.String.format ( "$MaxValue %1$s" , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VmPriorityMaxValue ) ) ) ; } return res ; }
Source:
public org.ovirt.engine.api.model.Network get ( ) { org.ovirt.engine.core.common.businessentities.IscsiBond bond = getBond ( ) ; if ( ! ( bond.getNetworkIds ( ) . contains ( guid ) ) ) { notFound ( ) ; } return performGet ( VdcQueryType.GetNetworkById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) ) ; }

Target:
public org.ovirt.engine.api.model.Network get ( ) { org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond = parent.getIscsiBond ( ) ; if ( ! ( iscsiBond.getNetworkIds ( ) . contains ( guid ) ) ) { return notFound ( ) ; } org.ovirt.engine.api.model.Network entity = getNetwork ( ) ; if ( entity == null ) { return notFound ( ) ; } return addLinks ( map ( entity ) ) ; }
Source:
public void setItems ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > value ) { if ( ( items ) != value ) { itemsChanging ( value , items ) ; items = value ; itemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }

Target:
public void setItems ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > value ) { if ( ( items ) != value ) { itemsChanging ( value , items ) ; items = value ; itemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }
Source:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true , getEntity ( 0 ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true , getEntity ( 0 ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 0 ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public java.lang.Void call ( ) throws java.lang.Exception { connected.await ( policy.getRetryTimeOut ( ) , policy.getTimeUnit ( ) ) ; return null ; }

Target:
private void waitForConnect ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { org.ovirt.vdsm.jsonrpc.client.utils.retry.AwaitRetry.retry ( ( ) -> { org.ovirt.vdsm.jsonrpc.client.reactors.stomp.connected.await ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.policy.getRetryTimeOut ( ) , org.ovirt.vdsm.jsonrpc.client.reactors.stomp.policy.getTimeUnit ( ) ) ; return null ; } ) ; } catch ( java.lang.Exception e ) { log.error ( e.getMessage ( ) , e ) ; disconnect ( "Waiting for connect failed" ) ; throw new java.lang.IllegalStateException ( "Communication failed" ) ; } }
Source:
public void testValidateAndSetClusterQuotaForVCPUGlobalNotExceeded ( ) throws java.lang.Exception { quotaManager.removeStoragePoolFromCache ( storage_pool.getId ( ) ) ; org.junit.Assert.assertTrue ( quotaManager.validateAndSetClusterQuota ( storage_pool , org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID , org.ovirt.engine.core.bll.quota.QuotaManagerTest.VCPU_QUOTA_GLOBAL_NOT_EXCEEDED , 1 , 1 , canDoActionMessages ) ) ; assertEmptyCanDoActionMessage ( ) ; assertAuditLogNotWritten ( ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.Quota mockBasicQuota ( ) { ( dbCalls ) ++ ; org.ovirt.engine.core.common.businessentities.Quota quota = new org.ovirt.engine.core.common.businessentities.Quota ( ) ; quota.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; quota.setStoragePoolId ( storage_pool.getId ( ) . getValue ( ) ) ; quota.setDescription ( "My Quota description" ) ; quota.setQuotaName ( "My Quota Name" ) ; quota.setGraceStoragePercentage ( 20 ) ; quota.setGraceVdsGroupPercentage ( 20 ) ; quota.setThresholdStoragePercentage ( 80 ) ; quota.setThresholdVdsGroupPercentage ( 80 ) ; quota.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.HARD_ENFORCEMENT ) ; return quota ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; }
Source:
public void initialize ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel systemTreeSelectedItem ) { super . initialize ( systemTreeSelectedItem ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( pool.getVmPoolSpiceProxy ( ) ) ) ) { getModel ( ) . getSpiceProxyEnabled ( ) . setEntity ( true ) ; getModel ( ) . getSpiceProxy ( ) . setEntity ( pool.getVmPoolSpiceProxy ( ) ) ; getModel ( ) . getSpiceProxy ( ) . setIsChangable ( true ) ; } }

Target:
public void initialize ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel systemTreeSelectedItem ) { initTemplate ( ) ; super . initialize ( systemTreeSelectedItem ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( pool.getVmPoolSpiceProxy ( ) ) ) ) { getModel ( ) . getSpiceProxyEnabled ( ) . setEntity ( true ) ; getModel ( ) . getSpiceProxy ( ) . setEntity ( pool.getVmPoolSpiceProxy ( ) ) ; getModel ( ) . getSpiceProxy ( ) . setIsChangable ( true ) ; } }
Source:
private org.ovirt.engine.core.bll.network.macpool.MacPool createPoolInternal ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { if ( macPools.containsKey ( macPool.getId ( ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST ) ; } org.ovirt.engine.core.bll.network.macpool.MacPool poolForScope = new org.ovirt.engine.core.bll.network.macpool.MacPoolUsingRanges ( macPoolToRanges ( macPool ) , macPool.isAllowDuplicateMacAddresses ( ) ) ; macPools.put ( macPool.getId ( ) , lockedObjectFactory.createLockingInstance ( poolForScope , org.ovirt.engine.core.bll.network.macpool.MacPool.class ) ) ; return poolForScope ; }

Target:
private org.ovirt.engine.core.bll.network.macpool.MacPool createPoolInternal ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { if ( macPools.containsKey ( macPool.getId ( ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST ) ; } org.ovirt.engine.core.bll.network.macpool.MacPool poolForScope = new org.ovirt.engine.core.bll.network.macpool.MacPoolUsingRanges ( macPoolToRanges ( macPool ) , macPool.isAllowDuplicateMacAddresses ( ) ) ; macPools.put ( macPool.getId ( ) , lockedObjectFactory.createLockingInstance ( poolForScope , org.ovirt.engine.core.bll.network.macpool.MacPool.class , new java.util.concurrent.locks.ReentrantReadWriteLock ( ) ) ) ; return poolForScope ; }
Source:
public org.ovirt.engine.core.common.businessentities.VM getValue ( org.ovirt.engine.core.common.businessentities.VM vm ) { return vm ; }

Target:
public org.ovirt.engine.core.common.businessentities.VM getValue ( T object ) { if ( object instanceof org.ovirt.engine.core.common.businessentities.VM ) { return ( ( org.ovirt.engine.core.common.businessentities.VM ) ( object ) ) ; } if ( ( object instanceof org.ovirt.engine.core.common.utils.PairQueryable ) && ( ( ( ( org.ovirt.engine.core.common.utils.PairQueryable ) ( object ) ) . getSecond ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VM ) ) { return ( ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > ) ( object ) ) . getSecond ( ) ; } return null ; }
Source:
public static void GetExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , 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.storage_domains > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }

Target:
public static void GetStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public void setTestResultImage ( java.lang.String errorMessage ) { testResultImage.setResource ( ( errorMessage.isEmpty ( ) ? resources.logNormalImage ( ) : resources.logErrorImage ( ) ) ) ; testResultImage.setStylePrimaryName ( style.testResultImage ( ) ) ; testResultMessage.setText ( ( errorMessage.isEmpty ( ) ? constants.testSuccessMessage ( ) : errorMessage ) ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel flush ( ) { neutronAgentWidget.flush ( ) ; vmwarePropertiesWidget.flush ( ) ; return driver.flush ( ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase notAllowToRunAction ( org.ovirt.engine.core.common.action.VdcActionType actionType ) { java.lang.String mode = vdcOptionDao.getByNameAndVersion ( ConfigValues.EngineMode.name ( ) , ConfigCommon.defaultConfigurationVersion ) . getOptionValue ( ) ; if ( EngineWorkingMode.MAINTENANCE.name ( ) . equalsIgnoreCase ( mode ) ) { return getErrorCommandReturnValue ( EngineMessage.ENGINE_IS_RUNNING_IN_MAINTENANCE_MODE ) ; } else if ( EngineWorkingMode.PREPARE.name ( ) . equalsIgnoreCase ( mode ) ) { return notAllowedInPrepForMaintMode ( actionType ) ; } return null ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase notAllowToRunAction ( org.ovirt.engine.core.common.action.ActionType actionType ) { java.lang.String mode = vdcOptionDao.getByNameAndVersion ( ConfigValues.EngineMode.name ( ) , ConfigCommon.defaultConfigurationVersion ) . getOptionValue ( ) ; if ( EngineWorkingMode.MAINTENANCE.name ( ) . equalsIgnoreCase ( mode ) ) { return getErrorCommandReturnValue ( EngineMessage.ENGINE_IS_RUNNING_IN_MAINTENANCE_MODE ) ; } else if ( EngineWorkingMode.PREPARE.name ( ) . equalsIgnoreCase ( mode ) ) { return notAllowedInPrepForMaintMode ( actionType ) ; } return null ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getView ( ) . updateReportsPanel ( getModel ( ) . getUrl ( ) , getModel ( ) . getParams ( ) ) ; }

Target:
public void onResponseReceived ( com.google.gwt.http.client.Request request , com.google.gwt.http.client.Response response ) { if ( ( ( response.getStatusCode ( ) ) == ( com.google.gwt.http.client.Response.SC_OK ) ) && ( response.getText ( ) . trim ( ) . equals ( org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.REPORTS_WEBAPP_DEPLOYED_MSG ) ) ) { org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.reportsWebappDeployed = true ; getView ( ) . updateReportsPanel ( url , params ) ; } else { errorPopupManager.show ( applicationConstants.reportsWebAppNotDeployedMsg ( ) ) ; } }
Source:
long getLong ( java.lang.String val ) { if ( ( val == null ) || ( ( val.trim ( ) . length ( ) ) == 0 ) ) { return 0 ; } try { return java.lang.Long.valueOf ( val ) ; } catch ( java.lang.Exception e ) { return 0 ; } }

Target:
public long getDelayMinimum ( ) { return this . delayMinimum ; }
Source:
public void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { 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.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public 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 getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
protected org.ovirt.engine.ui.userportal.widget.action.UserPortalImageButtonDefinition < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > createButtonDefinition ( final org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel data ) { return new org.ovirt.engine.ui.userportal.widget.action.UserPortalImageButtonDefinition < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > ( constants.stopVmLabel ( ) , applicationResources.powerIcon ( ) , applicationResources.powerDisabledIcon ( ) ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return data.getStopCommand ( ) ; } } ; }

Target:
protected org.ovirt.engine.ui.userportal.widget.action.UserPortalImageButtonDefinition < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > createButtonDefinition ( final org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel data ) { return new org.ovirt.engine.ui.userportal.widget.action.UserPortalImageButtonDefinition < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > ( constants.powerOffVm ( ) , applicationResources.powerIcon ( ) , applicationResources.powerDisabledIcon ( ) ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return data.getStopCommand ( ) ; } } ; }
Source:
private org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.network_cluster , org.ovirt.engine.core.common.businessentities.VDSGroup > getItem ( java.lang.String clusterName ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.network_cluster , org.ovirt.engine.core.common.businessentities.VDSGroup > > items = ( ( java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.network_cluster , org.ovirt.engine.core.common.businessentities.VDSGroup > > ) ( getItems ( ) ) ) ; for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.network_cluster , org.ovirt.engine.core.common.businessentities.VDSGroup > item : items ) { if ( item.getSecond ( ) . getname ( ) . equals ( clusterName ) ) { return item ; } } return null ; }

Target:
private org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network_cluster > getItem ( java.lang.String clusterName ) { java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network_cluster > > items = ( ( java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network_cluster > > ) ( getItems ( ) ) ) ; for ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network_cluster > item : items ) { if ( item.getFirst ( ) . getname ( ) . equals ( clusterName ) ) { return item ; } } return null ; }
Source:
public void testValidModifiedBondsWhenAllOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setName ( "bond0" ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , null , true , true ) ; }

Target:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.ValidationResult slavesValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE_ENTITY , "slaveA" ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_NAME , "networkName" ) ) ; org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , slavesValidationResult , slavesValidationResult ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupsByStoragePoolId , org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) , null ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) , null ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel ) ( target ) ) ; loginModel.setENGINEUserActionGroupList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( returnValue ) ) ) ; loginModel.getENGINEUserActionGroupList ( ) . add ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel.ConsumeQuotaActionGroup ) ; loginModel.GetUserRoles ( loginModel ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel ) ( target ) ) ; loginModel.setENGINEUserActionGroupList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( returnValue ) ) ) ; loginModel.getENGINEUserActionGroupList ( ) . add ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel.ConsumeQuotaActionGroup ) ; loginModel.getUserRoles ( loginModel ) ; }
Source:
public java.lang.String GetVDSVerbDataByCpuName ( java.lang.String name ) { java.lang.String result = null ; org.ovirt.engine.core.common.businessentities.ServerCpu sc = null ; if ( name != null ) { if ( ( ( sc = _intelCpuByNameDictionary.get ( name ) ) != null ) || ( ( sc = _amdCpuByNameDictionary.get ( name ) ) != null ) ) { result = sc.getVdsVerbData ( ) ; } } return result ; }

Target:
public java.lang.String GetVDSVerbDataByCpuName ( java.lang.String name ) { java.lang.String result = null ; org.ovirt.engine.core.common.businessentities.ServerCpu sc = null ; if ( name != null ) { if ( ( ( ( sc = _intelCpuByNameDictionary.get ( name ) ) != null ) || ( ( sc = _amdCpuByNameDictionary.get ( name ) ) != null ) ) || ( ( sc = _ibmCpuByNameDictionary.get ( name ) ) != null ) ) { result = sc.getVdsVerbData ( ) ; } } return result ; }
Source:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.common.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.common.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getActionType ( ) . getActionGroup ( ) ) ) ; permissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( getVmIdFromSnapshot ( ) , org.ovirt.engine.core.common.VdcObjectType.VM , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getActionType ( ) . getActionGroup ( ) ) ) ; addPermissionSubjectForCustomProperties ( permissionList ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getActionType ( ) . getActionGroup ( ) ) ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getVmIdFromSnapshot ( ) , org.ovirt.engine.core.common.VdcObjectType.VM , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getActionType ( ) . getActionGroup ( ) ) ) ; addPermissionSubjectForCustomProperties ( permissionList ) ; return permissionList ; }