auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc startSpice ( java.lang.String vdsIp , int port , java.lang.String ticket ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.startSpice ( vdsIp , port , ticket ) ; 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.gluster.GlusterVolumesListReturnForXmlRpc glusterVolumeInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumesList ( volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesListReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void invalidHighMTU ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = new org.ovirt.engine.core.common.businessentities.VdsNetworkInterface ( ) ; nic.setMtu ( 15000 ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > > validate = validate ( nic ) ; junit.framework.Assert.assertTrue ( ( ( validate.size ( ) ) > 0 ) ) ; }

Target:
public void invalidHighMTU ( ) { java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.utils.MTUValidatorTest.MtuContainer > > validate = validate ( new org.ovirt.engine.core.common.utils.MTUValidatorTest.MtuContainer ( ( ( org.ovirt.engine.core.common.utils.MTUValidatorTest.TEST_MAX_MTU ) + 1 ) ) ) ; junit.framework.Assert.assertTrue ( ( ( validate.size ( ) ) > 0 ) ) ; }
Source:
protected boolean isVmInUpPausedDownStatus ( ) { if ( ( ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) && ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) && ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL , org.ovirt.engine.core.bll.validator.LocalizedVmStatus.from ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) ) ; } return true ; }

Target:
protected boolean isVmInUpPausedDownStatus ( ) { if ( ( ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) && ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) && ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL , org.ovirt.engine.core.bll.validator.LocalizedVmStatus.from ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) ) ; } return true ; }
Source:
public void testAddHostedEngineStorageFails ( ) { parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.mockito.Mockito.when ( command.getStorageDomainStaticDAO ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_HOSTED_ENGINE_STORAGE ) ; }

Target:
public void testAddHostedEngineStorageFails ( ) { parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_HOSTED_ENGINE_STORAGE ) ; }
Source:
private void initTimeZones ( ) { java.util.Set < java.lang.String > timeZoneTypes = TimeZoneType.GENERAL_TIMEZONE.getTimeZoneList ( ) . keySet ( ) ; getTimeZones ( ) . setItems ( timeZoneTypes ) ; }

Target:
private void initValueChangeListeners ( ) { org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > onPropertyChangeValidate = new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { validate ( true ) ; } } ; getSnapshotName ( ) . getEntityChangedEvent ( ) . addListener ( onPropertyChangeValidate ) ; getDaysOfTheWeek ( ) . getSelectedItemChangedEvent ( ) . addListener ( onPropertyChangeValidate ) ; getDaysOfMonth ( ) . getSelectedItemChangedEvent ( ) . addListener ( onPropertyChangeValidate ) ; getEndDate ( ) . getEntityChangedEvent ( ) . addListener ( onPropertyChangeValidate ) ; }
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 = macPoolFactory.createMacPool ( macPool ) ; macPools.put ( macPool.getId ( ) , poolForScope ) ; 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.MacPoolPerCluster.UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST ) ; } org.ovirt.engine.core.bll.network.macpool.MacPool poolForScope = macPoolFactory.createMacPool ( macPool ) ; macPools.put ( macPool.getId ( ) , poolForScope ) ; return poolForScope ; }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { headerLabel.setText ( constants.loginHeaderLabel ( ) ) ; userNameEditor.setLabel ( constants.loginFormUserNameLabel ( ) ) ; passwordEditor.setLabel ( constants.loginFormPasswordLabel ( ) ) ; domainEditor.setLabel ( constants.loginFormDomainLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }

Target:
private void addStyles ( ) { userNameEditor.hideLabel ( ) ; passwordEditor.hideLabel ( ) ; domainEditor.hideLabel ( ) ; }
Source:
public void executeQueryCommandWithNull ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDeviceDao ( ) ) . thenReturn ( vmDeviceDAO ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( new org.ovirt.engine.core.compat.Guid ( "ee655a4d-effc-4aab-be2b-2f80ff40cd1c" ) ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( java.util.List < ? > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) . isEmpty ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDeviceDao ( ) ) . thenReturn ( vmDeviceDAO ) ; }
Source:
public void networkWithTheSameDefaultMTUAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "nonVm" ) ; net.setVmNetwork ( false ) ; org.ovirt.engine.core.common.businessentities.network.Network newNet = createNetwork ( "vlanVm" ) ; newNet.setvlan_id ( 100 ) ; mockExistingNetworks ( net , newNet ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic.getName ( ) , newNet.getvlan_id ( ) , newNet.getName ( ) ) ) ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
public void networkWithTheSameDefaultMTUAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "nonVm" ) ; net.setVmNetwork ( false ) ; org.ovirt.engine.core.common.businessentities.network.Network newNet = createNetwork ( "vlanVm" ) ; newNet.setVlanId ( 100 ) ; mockExistingNetworks ( net , newNet ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic.getName ( ) , newNet.getVlanId ( ) , newNet.getName ( ) ) ) ) ; validateAndExpectNoViolations ( helper ) ; }
Source:
com.google.gwt.http.client.RequestBuilder createRequest ( java.lang.String engineAuthToken ) { com.google.gwt.http.client.RequestBuilder builder = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , restApiBaseUrl ) ; builder.setHeader ( "Session-TTL" , restApiSessionTimeout ) ; java.lang.String preferValue = "persistent-auth, csrf-protection" ; if ( engineAuthToken != null ) { preferValue += ", new-auth" ; builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.ENGINE_AUTH_TOKEN_HEADER , engineAuthToken ) ; } builder.setHeader ( "Prefer" , preferValue ) ; java.lang.String sessionId = getSessionId ( ) ; if ( sessionId != null ) { builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.SESSION_ID_HEADER , sessionId ) ; } return builder ; }

Target:
com.google.gwt.http.client.RequestBuilder createRequest ( java.lang.String engineAuthToken ) { com.google.gwt.http.client.RequestBuilder builder = createRequest ( ) ; java.lang.String preferValue = builder.getHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.PREFER_HEADER ) ; builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.PREFER_HEADER , ( preferValue + ", new-auth" ) ) ; builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.ENGINE_AUTH_TOKEN_HEADER , engineAuthToken ) ; return builder ; }
Source:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.VmPool selectedItem ) { driver.edit ( getDetailModel ( ) ) ; monitorCount.setText ( java.lang.String.valueOf ( getDetailModel ( ) . getMonitorCount ( ) ) ) ; isStateless.setText ( java.lang.Boolean.toString ( getDetailModel ( ) . getIsStateless ( ) ) ) ; formBuilder.update ( getDetailModel ( ) ) ; }

Target:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.VmPool selectedItem ) { driver.edit ( getDetailModel ( ) ) ; monitorCount.setText ( java.lang.String.valueOf ( getDetailModel ( ) . getMonitorCount ( ) ) ) ; isStateless.setText ( java.lang.Boolean.toString ( getDetailModel ( ) . getIsStateless ( ) ) ) ; oS.setText ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getOsName ( getDetailModel ( ) . getOS ( ) ) ) ; formBuilder.update ( getDetailModel ( ) ) ; }
Source:
private void initExternalHostProviderWidgets ( boolean isAvailable ) { externalHostProviderEnabledEditor.setVisible ( isAvailable ) ; externalHostNameEditor.setVisible ( false ) ; providersEditor.setVisible ( false ) ; searchProviderPanel.setVisible ( false ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( object.getIsDiscorveredHosts ( ) . getEntity ( ) ) == true ) { rbDiscoveredHost.setValue ( true ) ; showDiscoveredHostsWidgets ( true ) ; } else { rbProvisionedHost.setValue ( true ) ; showProvisionedHostsWidgets ( true ) ; } }
Source:
public void testDeactivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.DeactivateStorageDomain , org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase.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 } ) ) ; verifyActionResponse ( resource.deactivate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testDeactivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.DeactivateStorageDomainWithOvfUpdate , org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase.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 } ) ) ; verifyActionResponse ( resource.deactivate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( ) { java.util.Collection < java.lang.String > removedNetworks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment : removedNetworkAttachments ) { removedNetworks.add ( existingNetworkRelatedToAttachment ( removedAttachment ) . getName ( ) ) ; } java.util.List < java.lang.String > vmNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( host.getId ( ) , removedNetworks ) ; if ( vmNames.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS , org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.VAR_NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS_LIST , vmNames ) ) ; } }

Target:
org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( ) { java.util.Collection < java.lang.String > removedNetworks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment : removedNetworkAttachments ) { removedNetworks.add ( existingNetworkRelatedToAttachment ( removedAttachment ) . getName ( ) ) ; } final java.util.List < java.lang.String > vmsNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( host.getId ( ) , removedNetworks ) ; final java.util.List < java.lang.String > removedNetworksList = new java.util.ArrayList < > ( removedNetworks ) ; org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator detachNetworkUsedByVmValidator = new org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator ( vmsNames , removedNetworksList ) ; return detachNetworkUsedByVmValidator.validate ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel entity = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) ; boolean inputFieldsEnabled = ( ( java.lang.Boolean ) ( entity.getEntity ( ) ) ) ; getView ( ) . setInputFieldsEnabled ( inputFieldsEnabled ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel entity = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) ; boolean inputFieldsEnabled = ( ( java.lang.Boolean ) ( entity.getEntity ( ) ) ) ; getView ( ) . postModelEnabled ( inputFieldsEnabled ) ; }
Source:
protected static boolean isLogLevelOn ( org.ovirt.engine.core.utils.log.Log log , org.ovirt.engine.core.utils.log.Logged.LogLevel logLevel ) { switch ( logLevel ) { case FATAL : return log.isFatalEnabled ( ) ; case ERROR : return log.isErrorEnabled ( ) ; case WARN : return log.isWarnEnabled ( ) ; case INFO : return log.isInfoEnabled ( ) ; case DEBUG : return log.isDebugEnabled ( ) ; case TRACE : return log.isTraceEnabled ( ) ; case OFF : default : return false ; } }

Target:
protected static boolean isLogLevelOn ( org.slf4j.Logger log , org.ovirt.engine.core.utils.log.Logged.LogLevel logLevel ) { switch ( logLevel ) { case FATAL : case ERROR : return log.isErrorEnabled ( ) ; case WARN : return log.isWarnEnabled ( ) ; case INFO : return log.isInfoEnabled ( ) ; case DEBUG : return log.isDebugEnabled ( ) ; case TRACE : return log.isTraceEnabled ( ) ; case OFF : default : return false ; } }
Source:
public void testNetworksOnNicMatchMtu_whenNoNetworksAreProvided ( ) throws java.lang.Exception { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > networksOnNics = java.util.Collections.singletonMap ( "nicName" , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) ) ; org.junit.Assert.assertThat ( createHostSetupNetworksValidator ( ) . validateMtu ( networksOnNics ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; host.setVdsGroupCompatibilityVersion ( Version.v3_5 ) ; managementNetworkUtil = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil.class ) ; bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; }
Source:
public void setItems ( java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > values ) { java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > importedVms = getImportedVmModels ( ) . getItems ( ) ; if ( ( values != null ) && ( importedVms == values ) ) { sortVms ( values ) ; } else { super . setItems ( values ) ; } }

Target:
public void onSuccess ( java.lang.Object nothing , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > allClusters = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; clusterArchitecturesInDataCenters = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : allClusters ) { if ( ( cluster.supportsVirtService ( ) ) && ( ( cluster.getArchitecture ( ) ) != null ) ) { addArchitecture ( cluster.getStoragePoolId ( ) , cluster.getArchitecture ( ) ) ; } } }
Source:
public void networkInUseByHosts ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS host = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.NAMEABLE_NAME ) ; networkNotUsedByHostsTest ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.failsWithNetworkInUse ( ) , java.util.Collections.singletonList ( host ) ) ; }

Target:
public void networkInUseByOneHost ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS host = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.NAMEABLE_NAME ) ; networkNotUsedByHostsTest ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.failsWithOneNetworkInUse ( ) , java.util.Collections.singletonList ( host ) ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Template incoming , org.ovirt.engine.core.common.businessentities.VmTemplate entity ) { org.ovirt.engine.core.common.businessentities.VmTemplate updated = getMapper ( modelType , org.ovirt.engine.core.common.businessentities.VmTemplate.class ) . map ( incoming , entity ) ; org.ovirt.engine.core.common.businessentities.UsbPolicy usbPolicy = org.ovirt.engine.api.restapi.resource.utils.UsbResourceUtils.getUsbPolicy ( incoming.getUsb ( ) , lookupCluster ( updated.getvds_group_id ( ) ) ) ; if ( usbPolicy != null ) { updated.setusb_policy ( usbPolicy ) ; } return new org.ovirt.engine.core.common.action.UpdateVmTemplateParameters ( updated ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Template incoming , org.ovirt.engine.core.common.businessentities.VmTemplate entity ) { org.ovirt.engine.core.common.businessentities.VmTemplate updated = getMapper ( modelType , org.ovirt.engine.core.common.businessentities.VmTemplate.class ) . map ( incoming , entity ) ; updated.setUsbPolicy ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( incoming.getUsb ( ) , entity.getUsbPolicy ( ) , lookupCluster ( updated.getVdsGroupId ( ) ) ) ) ; return new org.ovirt.engine.core.common.action.UpdateVmTemplateParameters ( updated ) ; }
Source:
public void testValidRemovedBondsWhenBondIsNotRequired ( ) throws java.lang.Exception { java.lang.String nicName = "nicName" ; bond.setName ( nicName ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setRemovedBonds ( java.util.Collections.singleton ( bond.getId ( ) ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( params , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > singletonList ( bond ) ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidRemovedBondsWhenNotRemovingAnyBond ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . addExistingInterfaces ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( null ) ) ) . build ( ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testGetEntityNameByIdAndTypeForHost ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic vds = dbFacade.getVdsStaticDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDaoTest.VDS_ID ) ; org.junit.Assert.assertNotNull ( vds ) ; java.lang.String name = vds.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDaoTest.VDS_ID , VdcObjectType.VDS ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForHost ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic vds = dbFacade.getVdsStaticDao ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.VDS_ID ) ; org.junit.Assert.assertNotNull ( vds ) ; java.lang.String name = vds.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.VDS_ID , VdcObjectType.VDS ) ) ) ; }
Source:
protected void checkMaxMemoryOverCommitValue ( ) { if ( ( getVdsGroup ( ) . getmax_vds_memory_over_commit ( ) ) <= 0 ) { getVdsGroup ( ) . setmax_vds_memory_over_commit ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxVdsMemOverCommit ) ) ; } }

Target:
protected void updateMigrateOnError ( ) { if ( ( ( getVdsGroup ( ) ) != null ) && ( ( getVdsGroup ( ) . getMigrateOnError ( ) ) == null ) ) { boolean isMigrationSupported = org.ovirt.engine.core.common.FeatureSupported.isMigrationSupported ( getArchitecture ( ) , getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions migrateOnError = ( isMigrationSupported ) ? org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions.YES : org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions.NO ; getVdsGroup ( ) . setMigrateOnError ( migrateOnError ) ; } }
Source:
public void setUp ( ) { org.mockito.Mockito.doNothing ( ) . when ( command ) . addStorageDomainInDb ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateStorageDomainDynamicFromIrs ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . saveLUNsInDB ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.LUNs.class ) ) ; }

Target:
public void setUp ( ) { org.mockito.Mockito.doNothing ( ) . when ( command ) . addStorageDomainInDb ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateStorageDomainDynamicFromIrs ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . saveLUNsInDB ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.LUNs.class ) ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateMetadataDevices ( ) ; }
Source:
private void SleepOnReboot ( ) { int sleepTimeInSec = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ServerRebootTimeout ) ; log.infoFormat ( "Waiting {0} seconds, for server to finish reboot process." , sleepTimeInSec ) ; org.ovirt.engine.core.utils.ThreadUtils.sleep ( ( sleepTimeInSec * 1000 ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ; }

Target:
private void SleepOnReboot ( final org.ovirt.engine.core.common.businessentities.VDSStatus status ) { int sleepTimeInSec = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ServerRebootTimeout ) ; log.infoFormat ( "Waiting {0} seconds, for server to finish reboot process." , sleepTimeInSec ) ; org.ovirt.engine.core.utils.ThreadUtils.sleep ( ( sleepTimeInSec * 1000 ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) , status ) ) ; }
Source:
public void testExecuteQueryCommand ( ) { getQuery ( ) . executeQueryCommand ( ) ; java.util.Map < java.lang.String , java.lang.String > servers = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertNotNull ( servers ) ; org.junit.Assert.assertEquals ( getAddedServers ( ) , servers ) ; }

Target:
public void testExecuteQueryCommand ( ) { getQuery ( ) . executeQueryCommand ( ) ; java.util.Map < java.lang.String , java.lang.String > servers = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.jupiter.api.Assertions.assertNotNull ( servers ) ; org.junit.jupiter.api.Assertions.assertEquals ( getAddedServers ( ) , servers ) ; }
Source:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList ) { java.util.List < org.ovirt.engine.core.compat.Guid > vmIds = getAffinityGroup ( ) . getVmIds ( ) ; getVmsSelectionModel ( ) . init ( vmList , ( vmIds != null ? vmIds : new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostList ) { java.util.List < org.ovirt.engine.core.compat.Guid > hostIds = getAffinityGroup ( ) . getVdsIds ( ) ; getHostsSelectionModel ( ) . init ( hostList , ( hostIds != null ? hostIds : new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ) ; stopProgressOnVmsAndHostsInit ( ) ; }
Source:
private static boolean ValidateSubscription ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.EventSubscriber > subscriptions , org.ovirt.engine.core.common.businessentities.EventSubscriber current ) { boolean retValue = false ; for ( org.ovirt.engine.core.common.businessentities.EventSubscriber eventSubscriber : subscriptions ) { if ( ( ( eventSubscriber.getSubscriberId ( ) . equals ( current.getSubscriberId ( ) ) ) && ( org.apache.commons.lang.StringUtils.equals ( eventSubscriber.getEventUpName ( ) , current.getEventUpName ( ) ) ) ) && ( ( eventSubscriber.getEventNotificationMethod ( ) ) == ( current.getEventNotificationMethod ( ) ) ) ) { retValue = true ; break ; } } return retValue ; }

Target:
private static boolean validateSubscription ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.EventSubscriber > subscriptions , org.ovirt.engine.core.common.businessentities.EventSubscriber current ) { boolean retValue = false ; for ( org.ovirt.engine.core.common.businessentities.EventSubscriber eventSubscriber : subscriptions ) { if ( ( ( eventSubscriber.getSubscriberId ( ) . equals ( current.getSubscriberId ( ) ) ) && ( org.apache.commons.lang.StringUtils.equals ( eventSubscriber.getEventUpName ( ) , current.getEventUpName ( ) ) ) ) && ( ( eventSubscriber.getEventNotificationMethod ( ) ) == ( current.getEventNotificationMethod ( ) ) ) ) { retValue = true ; break ; } } return retValue ; }
Source:
public static boolean CanRemoveUser ( org.ovirt.engine.core.compat.Guid user_guid , java.util.ArrayList < java.lang.String > errors ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDAO ( ) . get ( user_guid ) ) == null ) { errors.add ( VdcBllMessages.USER_MUST_EXIST_IN_DB.toString ( ) ) ; returnValue = false ; } return returnValue ; }

Target:
public static boolean CanRemoveUser ( org.ovirt.engine.core.compat.Guid user_guid , java.util.ArrayList < java.lang.String > errors ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . get ( user_guid ) ) == null ) { errors.add ( VdcBllMessages.USER_MUST_EXIST_IN_DB.toString ( ) ) ; returnValue = false ; } return returnValue ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { setItems ( ( ( java.util.Collection < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VmTemplate > > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( getEntity ( ) . getId ( ) ) ; params.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesAndNetworkInterfacesByNetworkId , params , new org.ovirt.engine.ui.uicommonweb.models.networks.SetItemsAsyncQuery ( ) ) ; }
Source:
protected boolean verifySourceDomains ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > poolDomainsMap = org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getPoolDomains ( ) ) ; java.util.EnumSet < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > validDomainStatuses = java.util.EnumSet.of ( StorageDomainStatus.Active ) ; validDisksDomains = org.ovirt.engine.core.bll.ImagesHandler.findDomainsInApplicableStatusForDisks ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getImagesToCheckDestinationStorageDomains ( ) , poolDomainsMap , validDomainStatuses ) ; return validate ( new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getImagesToCheckDestinationStorageDomains ( ) ) . diskImagesOnAnyApplicableDomains ( validDisksDomains , poolDomainsMap , VdcBllMessages.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , validDomainStatuses ) ) ; }

Target:
protected boolean verifySourceDomains ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > poolDomainsMap = org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getPoolDomains ( ) ) ; java.util.EnumSet < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > validDomainStatuses = java.util.EnumSet.of ( StorageDomainStatus.Active ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > templateDiskImages = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getImagesToCheckDestinationStorageDomains ( ) , true , false , false ) ; validDisksDomains = org.ovirt.engine.core.bll.ImagesHandler.findDomainsInApplicableStatusForDisks ( templateDiskImages , poolDomainsMap , validDomainStatuses ) ; return validate ( new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( templateDiskImages ) . diskImagesOnAnyApplicableDomains ( validDisksDomains , poolDomainsMap , VdcBllMessages.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , validDomainStatuses ) ) ; }
Source:
public void newProfile ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel model = new org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel ( this , getEntity ( ) . getCompatibilityVersion ( ) ) ; setWindow ( model ) ; initProfileNetwork ( model ) ; }

Target:
public void newProfile ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel model = new org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel ( this , getEntity ( ) . getCompatibilityVersion ( ) , getEntity ( ) . getDataCenterId ( ) ) ; setWindow ( model ) ; initProfileNetwork ( model ) ; }
Source:
protected void actualSave ( ) { flush ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( action , new org.ovirt.engine.core.common.action.ProviderParameters ( provider ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ( ( result.getReturnValue ( ) ) == null ) || ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) ) { return ; } sourceListModel.getSearchCommand ( ) . execute ( ) ; cancel ( ) ; } } ) ; }

Target:
protected void actualSave ( ) { flush ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( action , new org.ovirt.engine.core.common.action.ProviderParameters ( provider ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ( ( result.getReturnValue ( ) ) == null ) || ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) ) { return ; } sourceListModel.getSearchCommand ( ) . execute ( ) ; cancel ( ) ; } } ) ; }
Source:
public void networkQosDoesntExist ( ) { org.mockito.Mockito.when ( vnicProfile.getNetworkQosId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkQosDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertThat ( validator.networkQosExistsOrNull ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_EXISTS ) ) ; }

Target:
public void networkQosDoesntExist ( ) { org.mockito.Mockito.when ( vnicProfile.getNetworkQosId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkQosDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( null ) ; org.hamcrest.MatcherAssert.assertThat ( validator.networkQosExistsOrNull ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_EXISTS ) ) ; }
Source:
private boolean validateDestStorage ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid destDomainId ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator validator = getValidator ( imageId , destDomainId ) ; return ( validateSourceStorageDomain ( imageId , destDomainId ) ) && ( validate ( validator.domainIsValidDestination ( ) ) ) ; }

Target:
private boolean validateDestStorage ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid destDomainId ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator validator = getValidator ( destDomainId , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePoolId ( ) . getValue ( ) ) ; return ( validate ( validator.isDomainExistAndActive ( ) ) ) && ( validate ( validator.domainIsValidDestination ( ) ) ) ; }
Source:
public void update ( int index , org.ovirt.engine.core.common.businessentities.DiskImage disk , java.lang.String value ) { org.ovirt.engine.core.common.businessentities.VolumeType tempVolumeType = org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ; if ( value.equals ( constants.thisAllocation ( ) ) ) { tempVolumeType = org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ; } else if ( value.equals ( constants.preallocatedAllocation ( ) ) ) { tempVolumeType = org.ovirt.engine.core.common.businessentities.VolumeType.Preallocated ; } object.VolumeType_SelectedItemChanged ( disk , tempVolumeType ) ; }

Target:
public void update ( int index , org.ovirt.engine.core.common.businessentities.DiskImage disk , java.lang.String value ) { org.ovirt.engine.core.common.businessentities.VolumeType tempVolumeType = org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ; if ( value.equals ( constants.thinAllocation ( ) ) ) { tempVolumeType = org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ; } else if ( value.equals ( constants.preallocatedAllocation ( ) ) ) { tempVolumeType = org.ovirt.engine.core.common.businessentities.VolumeType.Preallocated ; } org.ovirt.engine.ui.uicommonweb.models.vms.ImportData importData = object.getDiskImportData ( disk.getId ( ) ) ; if ( importData != null ) { importData.setSelectedVolumeType ( tempVolumeType ) ; } }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Map < org.ovirt.engine.core.compat.Version , java.util.Map < java.lang.String , java.lang.String > > ) ( source ) ) : new java.util.HashMap < org.ovirt.engine.core.compat.Version , java.util.Map < java.lang.String , java.lang.String > > ( ) ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Map < org.ovirt.engine.core.compat.Version , java.util.Map < java.lang.String , java.lang.String > > ) ( source ) ) : new java.util.HashMap < org.ovirt.engine.core.compat.Version , java.util.Map < java.lang.String , java.lang.String > > ( ) ; }
Source:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , 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 ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.List < java.lang.String > images = ( ( java.util.List < java.lang.String > ) ( returnValue ) ) ; getIso ( ) . setItems ( images ) ; getIso ( ) . setSelectedItem ( tryToFindVirtioTools ( images ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { networkProfiles = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ) ( returnValue ) ) ; initNetworksList ( ) ; initClusterAndStorage ( dataCenter ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.MigrateVDSCommandParameters createMigrateVDSCommandParameters ( ) { java.lang.String srcVdsHost = org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getHostName ( ) ; java.lang.String dstVdsHost = java.lang.String.format ( "%1$s:%2$s" , getDestinationVds ( ) . getHostName ( ) , getDestinationVds ( ) . getPort ( ) ) ; return new org.ovirt.engine.core.common.vdscommands.MigrateVDSCommandParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) , srcVdsHost , vdsDestinationId , dstVdsHost , org.ovirt.engine.core.common.businessentities.MigrationMethod.ONLINE , isTunnelMigrationUsed ( ) , getMigrationNetworkIp ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getVdsGroupCompatibilityVersion ( ) ) ; }

Target:
private org.ovirt.engine.core.common.vdscommands.MigrateVDSCommandParameters createMigrateVDSCommandParameters ( ) { java.lang.String srcVdsHost = org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getHostName ( ) ; java.lang.String dstVdsHost = java.lang.String.format ( "%1$s:%2$s" , getDestinationVds ( ) . getHostName ( ) , getDestinationVds ( ) . getPort ( ) ) ; return new org.ovirt.engine.core.common.vdscommands.MigrateVDSCommandParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) , srcVdsHost , vdsDestinationId , dstVdsHost , org.ovirt.engine.core.common.businessentities.MigrationMethod.ONLINE , isTunnelMigrationUsed ( ) , getMigrationNetworkIp ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getVdsGroupCompatibilityVersion ( ) , getMaximumMigrationDowntime ( ) ) ; }
Source:
private static void modifySettings ( org.ovirt.engine.api.extensions.ExtMap settingKeys , javax.sql.DataSource dataSource ) throws java.sql.SQLException { java.util.List < java.lang.String > updates = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.api.extensions.ExtKey , java.lang.Object > entry : settingKeys.entrySet ( ) ) { updates.add ( org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( "UPDATE settings SET value = WHERE uuid = {}" , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( entry.getValue ( ) ) , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( entry.getKey ( ) . getUuid ( ) . getUuid ( ) ) ) ) ; } new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Modification ( updates ) . execute ( dataSource ) ; }

Target:
private static void modifySettings ( org.ovirt.engine.api.extensions.ExtMap settingKeys , javax.sql.DataSource dataSource ) throws java.sql.SQLException { java.util.List < java.lang.String > updates = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.api.extensions.ExtKey , java.lang.Object > entry : settingKeys.entrySet ( ) ) { updates.add ( org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( org.ovirt.engine.extension.aaa.jdbc.Formatter.replaceSchemaPlaceholder ( "UPDATE @SCHEMA_NAME@.settings SET value = WHERE uuid = {}" ) , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( entry.getValue ( ) ) , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( entry.getKey ( ) . getUuid ( ) . getUuid ( ) ) ) ) ; } new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Modification ( updates ) . execute ( dataSource ) ; }
Source:
public void testGetHostDevicesByHostIdAndIommuGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > hostDevices = dao.getHostDevicesByHostIdAndIommuGroup ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_HOST_ID , org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_IOMMU_GROUP ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.HostDeviceDaoTest.TOTAL_DEVICES_IN_GROUP , hostDevices.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.HostDevice hostDevice : hostDevices ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_HOST_ID , hostDevice.getHostId ( ) ) ; org.junit.Assert.assertEquals ( java.lang.Integer.valueOf ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_IOMMU_GROUP ) , hostDevice.getIommuGroup ( ) ) ; } }

Target:
public void testGetHostDevicesByHostIdAndIommuGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > hostDevices = dao.getHostDevicesByHostIdAndIommuGroup ( FixturesTool.VDS_RHEL6_NFS_SPM , org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_IOMMU_GROUP ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.HostDeviceDaoTest.TOTAL_DEVICES_IN_GROUP , hostDevices.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.HostDevice hostDevice : hostDevices ) { org.junit.Assert.assertEquals ( FixturesTool.VDS_RHEL6_NFS_SPM , hostDevice.getHostId ( ) ) ; org.junit.Assert.assertEquals ( java.lang.Integer.valueOf ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_IOMMU_GROUP ) , hostDevice.getIommuGroup ( ) ) ; } }