auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void mockGraphicsDevices ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VmDevice graphicsDevice = new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ; graphicsDevice.setDeviceId ( Guid.Empty ) ; graphicsDevice.setVmId ( vmId ) ; org.mockito.Mockito.when ( deviceDao.getVmDeviceByVmIdAndType ( vmId , VmDeviceGeneralType.GRAPHICS ) ) . thenReturn ( java.util.Arrays.asList ( graphicsDevice ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.setDbFacade ( dbFacade ) ; org.mockito.Mockito.doReturn ( deviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; }

Target:
private void mockGraphicsDevices ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VmDevice graphicsDevice = new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ; graphicsDevice.setDeviceId ( Guid.Empty ) ; graphicsDevice.setVmId ( vmId ) ; org.mockito.Mockito.when ( deviceDao.getVmDeviceByVmIdAndType ( vmId , VmDeviceGeneralType.GRAPHICS ) ) . thenReturn ( java.util.Arrays.asList ( graphicsDevice ) ) ; org.mockito.Mockito.doReturn ( deviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; }
Source:
private void updatePriority ( ) { if ( ( cachedMaxPriority ) == null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxVmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { cachedMaxPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; postUpdatePriority ( ) ; } } , model.getHash ( ) ) ) ; } else { postUpdatePriority ( ) ; } }

Target:
private void updatePriority ( ) { if ( ( cachedMaxPriority ) == null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { cachedMaxPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; postUpdatePriority ( ) ; } } , model.getHash ( ) ) ) ; } else { postUpdatePriority ( ) ; } }
Source:
private void verifyActions ( org.ovirt.engine.api.model.HostNics list ) { assertNotNull ( list.getActions ( ) ) ; assertNotNull ( list.getActions ( ) . getLinks ( ) ) ; assertNotNull ( list.getActions ( ) . getLinks ( ) . get ( 0 ) ) ; assertEquals ( list.getActions ( ) . getLinks ( ) . get ( 0 ) . getHref ( ) , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SETUPNETWORKS_ACTION_URL ) ; assertEquals ( list.getActions ( ) . getLinks ( ) . get ( 0 ) . getRel ( ) , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SETUPNETWORKS_ACTION_REL ) ; }

Target:
private void verifyActions ( org.ovirt.engine.api.model.HostNics list ) { assertNotNull ( list.getActions ( ) ) ; assertNotNull ( list.getActions ( ) . getLinks ( ) ) ; assertNotNull ( list.getActions ( ) . getLinks ( ) . get ( 0 ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SETUPNETWORKS_ACTION_URL , list.getActions ( ) . getLinks ( ) . get ( 0 ) . getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SETUPNETWORKS_ACTION_REL , list.getActions ( ) . getLinks ( ) . get ( 0 ) . getRel ( ) ) ; }
Source:
public void getWANColorDepth ( 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 ? org.ovirt.engine.core.common.console.ConsoleOptions.WanColorDepth.fromInt ( ( ( java.lang.Integer ) ( source ) ) . intValue ( ) ) : org.ovirt.engine.core.common.console.ConsoleOptions.WanColorDepth.depth16 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.WANColorDepth , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getWANColorDepth ( 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 ? org.ovirt.engine.core.common.console.ConsoleOptions.WanColorDepth.fromInt ( ( ( java.lang.Integer ) ( source ) ) ) : org.ovirt.engine.core.common.console.ConsoleOptions.WanColorDepth.depth16 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.WANColorDepth , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageTemplateListModel templateModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageTemplateListModel ) ( model ) ) ; templateModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; templateModel.setIsEmpty ( ( ( ( ( java.util.List ) ( templateModel.getItems ( ) ) ) . size ( ) ) == 0 ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageTemplateListModel templateModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageTemplateListModel ) ( model ) ) ; templateModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; templateModel.setIsEmpty ( ( ( ( ( java.util.List ) ( templateModel.getItems ( ) ) ) . size ( ) ) == 0 ) ) ; }
Source:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setstatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . sethibernation_vol_handle ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "StopVmCommandBase::EndVmCommand: Vm is null - not performing full EndAction" ) ; } setSucceeded ( true ) ; }

Target:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setstatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . sethibernation_vol_handle ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "StopVmCommandBase::EndVmCommand: Vm is null - not performing full EndAction" ) ; } org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }
Source:
protected java.lang.String idToHref ( java.lang.String id ) { org.ovirt.engine.api.model.HostNic master = new org.ovirt.engine.api.model.HostNic ( ) ; master.setId ( id ) ; master.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; master.getHost ( ) . setId ( hostId ) ; return org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , master ) . getHref ( ) ; }

Target:
private java.lang.String idToHref ( java.lang.String id ) { org.ovirt.engine.api.model.HostNic master = new org.ovirt.engine.api.model.HostNic ( ) ; master.setId ( id ) ; master.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; master.getHost ( ) . setId ( hostId ) ; return org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , master ) . getHref ( ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > newItems = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.NetworkComparator ( ) ) ; searchableListModel.setItems ( newItems ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > newItems = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.NetworkComparator ( ) ) ; searchableListModel.setItems ( newItems ) ; }
Source:
private static java.lang.String getTimeZone ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String timeZone ; if ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) { vm.setTimeZone ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.DefaultWindowsTimeZone ) ) ; } if ( org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.osRepository.isTimezoneValueInteger ( vm.getStaticData ( ) . getOsId ( ) , null ) ) { timeZone = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneIndexByKey ( vm.getTimeZone ( ) ) ; } else { timeZone = vm.getTimeZone ( ) ; } return timeZone ; }

Target:
private static java.lang.String getTimeZone ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String timeZone ; if ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) { vm.setTimeZone ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.DefaultWindowsTimeZone ) ) ; } if ( org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.osRepository.isTimezoneValueInteger ( vm.getStaticData ( ) . getOsId ( ) , null ) ) { timeZone = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneIndexByKey ( vm.getTimeZone ( ) ) ; } else { timeZone = vm.getTimeZone ( ) ; } return timeZone ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addNetworkInterfaceDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , boolean plugged , boolean hostDev ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , VmDeviceGeneralType.INTERFACE , ( hostDev ? org.ovirt.engine.core.common.utils.VmDeviceType.HOST_DEVICE : org.ovirt.engine.core.common.utils.VmDeviceType.BRIDGE ) , java.util.Collections.< java.lang.String , java.lang.Object > emptyMap ( ) , plugged , false , null ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice addNetworkInterfaceDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , boolean plugged , boolean hostDev ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , VmDeviceGeneralType.INTERFACE , ( hostDev ? org.ovirt.engine.core.common.utils.VmDeviceType.HOST_DEVICE : org.ovirt.engine.core.common.utils.VmDeviceType.BRIDGE ) , java.util.Collections.< java.lang.String , java.lang.Object > emptyMap ( ) , plugged , false , null , false ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.VDS vds1 , org.ovirt.engine.core.common.businessentities.VDS vds2 ) { return ( vds1.getVdsSpmPriority ( ) ) < ( vds2.getVdsSpmPriority ( ) ) ? 1 : ( vds1.getVdsSpmPriority ( ) ) == ( vds2.getVdsSpmPriority ( ) ) ? 0 : - 1 ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.VDS vds1 , org.ovirt.engine.core.common.businessentities.VDS vds2 ) { return java.lang.Integer.compare ( vds2.getVdsSpmPriority ( ) , vds1.getVdsSpmPriority ( ) ) ; }
Source:
public void bondWithNetworkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , "net" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = createNics ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , ifaces ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ; ifaces.add ( bond ) ; parameters.setInterfaces ( ifaces ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoNetworksRemoved ( helper ) ; }

Target:
public void bondWithNetworkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , "net" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifaces = createNics ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , ifaces ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ; ifaces.add ( bond ) ; parameters.setInterfaces ( ifaces ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoNetworksRemoved ( helper ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { boolean returnValue = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( returnValue ) { command.Execute ( ) ; } else { displayConsoleConnectConfirmPopup ( command ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { boolean returnValue = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( returnValue ) { command.Execute ( ) ; } else { displayConsoleConnectConfirmPopup ( command ) ; } }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > getClustersToAttach ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusterToAttach = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; for ( java.lang.Object item : getNetworkClusterList ( ) . getItems ( ) ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel networkClusterModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel ) ( item ) ) ; if ( networkClusterModel.isAttached ( ) ) { clusterToAttach.add ( networkClusterModel.getEntity ( ) ) ; } } return clusterToAttach ; }

Target:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel > getClustersToAttach ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel > clusterToAttach = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel > ( ) ; for ( java.lang.Object item : getNetworkClusterList ( ) . getItems ( ) ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel networkClusterModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel ) ( item ) ) ; if ( networkClusterModel.isAttached ( ) ) { clusterToAttach.add ( networkClusterModel ) ; } } return clusterToAttach ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = ( ( org.ovirt.engine.core.common.businessentities.Cluster ) ( returnValue ) ) ; if ( ( cluster.getEmulatedMachine ( ) ) != null ) { getEmulatedMachine ( ) . setSelectedItem ( cluster.getEmulatedMachine ( ) ) ; } } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { if ( cluster != null ) { if ( ( cluster.getEmulatedMachine ( ) ) != null ) { getEmulatedMachine ( ) . setSelectedItem ( cluster.getEmulatedMachine ( ) ) ; } } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > upHosts = filterUpHosts ( hosts ) ; proxyHosts.setItems ( addAnyHostInCluster ( upHosts ) ) ; xenProxyHosts.setItems ( addAnyHostInCluster ( upHosts ) ) ; kvmProxyHosts.setItems ( addAnyHostInCluster ( upHosts ) ) ; this . hosts.setItems ( upHosts ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > upHosts = filterUpHosts ( hosts ) ; proxyHosts.setItems ( addAnyHostInCluster ( upHosts ) ) ; xenProxyHosts.setItems ( addAnyHostInCluster ( upHosts ) ) ; kvmProxyHosts.setItems ( addAnyHostInCluster ( upHosts ) ) ; this . hosts.setItems ( upHosts ) ; stopProgress ( ) ; }
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredNetworkData = new org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData ( getParameters ( ) . getNetworkAttachments ( ) , applyUserConfiguredNics ( ) ) ; hostNetworkTopologyPersister.persistAndEnforceNetworkCompliance ( updatedHost , false , userConfiguredNetworkData ) ; getVdsDynamicDao ( ) . updateNetConfigDirty ( getVds ( ) . getId ( ) , getVds ( ) . getNetConfigDirty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getModifiedNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredNetworkData = new org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData ( getParameters ( ) . getNetworkAttachments ( ) , applyUserConfiguredNics ( ) ) ; hostNetworkTopologyPersister.persistAndEnforceNetworkCompliance ( updatedHost , false , userConfiguredNetworkData ) ; getVdsDynamicDao ( ) . updateNetConfigDirty ( updatedHost.getId ( ) , updatedHost.getNetConfigDirty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getModifiedNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return null ; }
Source:
public void testImportWithStorageDomainName ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ( "Storage: name=" + ( NAMES [ 2 ] ) ) , SearchType.StorageDomain , getStorageDomain ( 2 ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setName ( NAMES [ 2 ] ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; doTestImport ( storageDomain , cluster ) ; }

Target:
public void testImportWithStorageDomainName ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ( "Storage: name=" + ( NAMES [ 2 ] ) ) , SearchType.StorageDomain , getStorageDomain ( 2 ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setName ( NAMES [ 2 ] ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; doTestImport ( storageDomain , cluster , false , false ) ; }
Source:
public void testGetVmsCountByClusterId ( ) { org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , dao.getVmsCountByClusterId ( FixturesTool.CLUSTER_RHEL6_NFS ) , FixturesTool.NUMBER_OF_VMS_IN_CLUSTER_RHEL6_NFS_CLUSTER ) ; org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , dao.getVmsCountByClusterId ( FixturesTool.CLUSTER_RHEL6_ISCSI ) , FixturesTool.NUMBER_OF_VMS_IN_CLUSTER_RHEL6_ISCSI ) ; org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , dao.getVmsCountByClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , 0 ) ; }

Target:
public void testGetVmsCountByClusterId ( ) { org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , FixturesTool.NUMBER_OF_VMS_IN_CLUSTER_RHEL6_NFS_CLUSTER , dao.getVmsCountByClusterId ( FixturesTool.CLUSTER_RHEL6_NFS ) ) ; org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , FixturesTool.NUMBER_OF_VMS_IN_CLUSTER_RHEL6_ISCSI , dao.getVmsCountByClusterId ( FixturesTool.CLUSTER_RHEL6_ISCSI ) ) ; org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , 0 , dao.getVmsCountByClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ; }
Source:
private void cacheConfigValues ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { getDefaultConfigurationVersion ( ) ; aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( returnValue != null ) { cachedConfigValuesPreConvert.putAll ( ( ( java.util.HashMap < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > , java.lang.Object > ) ( returnValue ) ) ) ; } return cachedConfigValuesPreConvert ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConfigurationValues , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
private void cacheConfigValues ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( returnValue != null ) { cachedConfigValuesPreConvert.putAll ( ( ( java.util.HashMap < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > , java.lang.Object > ) ( returnValue ) ) ) ; } return cachedConfigValuesPreConvert ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConfigurationValues , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setSizeInGigabytes ( size ) ; diskImage.setActualSize ( size ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return diskImage ; }

Target:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setSizeInGigabytes ( size ) ; diskImage.setActualSize ( size ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return diskImage ; }
Source:
private void printBoolean ( java.lang.Object arg ) throws java.io.IOException { java.lang.String s ; if ( arg != null ) { s = ( arg instanceof java.lang.Boolean ) ? ( ( java.lang.Boolean ) ( arg ) ) . toString ( ) : java.lang.Boolean.toString ( true ) ; } else { s = java.lang.Boolean.toString ( false ) ; } print ( s ) ; }

Target:
private void printBoolean ( java.lang.Object arg ) throws java.io.IOException { java.lang.String s ; if ( arg != null ) { s = ( arg instanceof java.lang.Boolean ) ? arg.toString ( ) : java.lang.Boolean.toString ( true ) ; } else { s = java.lang.Boolean.toString ( false ) ; } print ( s ) ; }
Source:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.CreateSnapshotCommand.CanCreateSnapshot ( ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = performImageVdsmOperation ( ) ; if ( ( vdsReturnValue != null ) && ( vdsReturnValue.getSucceeded ( ) ) ) { ProcessOldImageFromDb ( ) ; AddDiskImageToDb ( mNewCreatedDiskImage ) ; setActionReturnValue ( mNewCreatedDiskImage ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.setSucceeded ( true ) ; } } }

Target:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.CreateSnapshotCommand.CanCreateSnapshot ( ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = performImageVdsmOperation ( ) ; if ( ( vdsReturnValue != null ) && ( vdsReturnValue.getSucceeded ( ) ) ) { ProcessOldImageFromDb ( ) ; AddDiskImageToDb ( mNewCreatedDiskImage , null ) ; setActionReturnValue ( mNewCreatedDiskImage ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.setSucceeded ( true ) ; } } }
Source:
public static void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
public void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
private static < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > boolean isNameAndIdIncoherent ( org.ovirt.engine.core.compat.Guid id , java.lang.String name , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { T entityById = map.get ( id ) ; T entityByName = map.get ( name ) ; return ! ( java.util.Objects.equals ( entityById , entityByName ) ) ; }

Target:
private < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > boolean isNameAndIdIncoherent ( org.ovirt.engine.core.compat.Guid id , java.lang.String name , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { T entityById = map.get ( id ) ; T entityByName = map.get ( name ) ; return ! ( java.util.Objects.equals ( entityById , entityByName ) ) ; }
Source:
public void testGetEntityNameByIdAndTypeForDataCenter ( ) { org.ovirt.engine.core.common.businessentities.storage_pool storagePool = dbFacade.getStoragePoolDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_POOL_ID ) ; org.junit.Assert.assertNotNull ( storagePool ) ; java.lang.String name = storagePool.getname ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_POOL_ID , VdcObjectType.StoragePool ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForDataCenter ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = dbFacade.getStoragePoolDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_POOL_ID ) ; org.junit.Assert.assertNotNull ( storagePool ) ; java.lang.String name = storagePool.getname ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_POOL_ID , VdcObjectType.StoragePool ) ) ) ; }
Source:
public void testNegativeConstructors ( ) { org.ovirt.engine.core.compat.TimeSpan span = new org.ovirt.engine.core.compat.TimeSpan ( 1 , ( - 20 ) , ( - 10 ) , 10 ) ; org.junit.Assert.assertEquals ( "days1" , 0 , span.Days ) ; org.junit.Assert.assertEquals ( "hours1" , 3 , span.Hours ) ; org.junit.Assert.assertEquals ( "minutes1" , 50 , span.Minutes ) ; org.junit.Assert.assertEquals ( "seconds1" , 10 , span.Seconds ) ; org.junit.Assert.assertEquals ( "miliseconds" , 0 , span.Milliseconds ) ; }

Target:
public void testNegativeConstructors ( ) { org.ovirt.engine.core.compat.TimeSpan span = new org.ovirt.engine.core.compat.TimeSpan ( 1 , ( - 20 ) , ( - 10 ) , 10 ) ; org.junit.Assert.assertEquals ( 0 , span.Days ) ; org.junit.Assert.assertEquals ( 3 , span.Hours ) ; org.junit.Assert.assertEquals ( 50 , span.Minutes ) ; org.junit.Assert.assertEquals ( 10 , span.Seconds ) ; org.junit.Assert.assertEquals ( 0 , span.Milliseconds ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }
Source:
private static void logVmStatusTransition ( org.ovirt.engine.core.common.businessentities.VM vmToUpdate , org.ovirt.engine.core.common.businessentities.VmDynamic runningVm ) { if ( ( vmToUpdate.getStatus ( ) ) != ( runningVm.getstatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "VM {0} {1} moved from {2} --> {3}" , vmToUpdate.getVmName ( ) , vmToUpdate.getId ( ) , vmToUpdate.getStatus ( ) . name ( ) , runningVm.getstatus ( ) . name ( ) ) ; } }

Target:
private static void logVmStatusTransition ( org.ovirt.engine.core.common.businessentities.VM vmToUpdate , org.ovirt.engine.core.common.businessentities.VmDynamic runningVm ) { if ( ( vmToUpdate.getStatus ( ) ) != ( runningVm.getStatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "VM {0} {1} moved from {2} --> {3}" , vmToUpdate.getName ( ) , vmToUpdate.getId ( ) , vmToUpdate.getStatus ( ) . name ( ) , runningVm.getStatus ( ) . name ( ) ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { for ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map : getStoragePoolIsoMap ( domain ) ) { context.snapshotEntityStatus ( map , map.getStatus ( ) ) ; updateStatus ( map , status ) ; } } getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { for ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map : getStoragePoolIsoMap ( domain ) ) { context.snapshotEntityStatus ( map ) ; updateStatus ( map , status ) ; } } getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
private void setUpDisks ( ) { com.woorea.openstack.cinder.model.Volume existingVolume = volumes.get ( 1 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > existingDisks = new java.util.ArrayList ( org.ovirt.engine.core.bll.storage.disk.cinder.CinderBroker.volumesToCinderDisks ( java.util.Collections.singletonList ( existingVolume ) , getQueryParameters ( ) . getId ( ) ) ) ; org.mockito.Mockito.when ( diskDao.getAllFromDisksByDiskStorageType ( DiskStorageType.CINDER , getUser ( ) . getId ( ) , false ) ) . thenReturn ( existingDisks ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getDiskDao ( ) ) . thenReturn ( diskDao ) ; }

Target:
private void setUpDisks ( ) { com.woorea.openstack.cinder.model.Volume existingVolume = volumes.get ( 1 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > existingDisks = new java.util.ArrayList ( org.ovirt.engine.core.bll.storage.disk.cinder.CinderBroker.volumesToCinderDisks ( java.util.Collections.singletonList ( existingVolume ) , getQueryParameters ( ) . getId ( ) ) ) ; org.mockito.Mockito.when ( diskDao.getAllFromDisksByDiskStorageType ( DiskStorageType.CINDER , getUser ( ) . getId ( ) , false ) ) . thenReturn ( existingDisks ) ; }
Source:
public void encodeWhenAliasIsTruncated ( ) throws java.io.IOException { java.lang.String alias = org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateRandomString ( 200 ) ; disk.setDiskAlias ( alias ) ; disk.setDiskDescription ( "DiskDescription" ) ; assertDiskDescriptionMap ( disk , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateDiskAliasJsonEntry ( alias.substring ( 0 , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.DISK_ALIAS_MAX_LENGTH ) ) ) ; }

Target:
public void encodeWhenAliasIsTruncated ( ) throws java.io.IOException { java.lang.String alias = org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateRandomString ( 200 ) ; disk.setDiskAlias ( alias ) ; disk.setDiskDescription ( "DiskDescription" ) ; assertDiskDescriptionMap ( disk , generateDiskAliasJsonEntry ( alias.substring ( 0 , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.DISK_ALIAS_MAX_LENGTH ) ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice createVirtioSerialDeviceForVm ( org.ovirt.engine.core.compat.Guid vmId ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmId ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.CONTROLLER , VmDeviceType.VIRTIOSERIAL.getName ( ) , "" , 0 , new java.util.HashMap < java.lang.String , java.lang.Object > ( ) , true , true , false , "" , null , null , null ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice createVirtioSerialDeviceForVm ( org.ovirt.engine.core.compat.Guid vmId ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmId ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.CONTROLLER , VmDeviceType.VIRTIOSERIAL.getName ( ) , "" , new java.util.HashMap < java.lang.String , java.lang.Object > ( ) , true , true , false , "" , null , null , null ) ; }
Source:
private java.util.List < java.lang.Integer > findIndependentPossibleValues ( int max ) { java.util.List < java.lang.Integer > res = new java.util.ArrayList < java.lang.Integer > ( ) ; int totalCPUCores = getTotalCpuCores ( ) ; for ( int i = 1 ; i <= ( java.lang.Math.min ( totalCPUCores , max ) ) ; i ++ ) { if ( ( totalCPUCores % i ) == 0 ) { res.add ( i ) ; } } return res ; }

Target:
protected java.util.List < java.lang.Integer > findIndependentPossibleValues ( int max ) { java.util.List < java.lang.Integer > res = new java.util.ArrayList < java.lang.Integer > ( ) ; int totalCPUCores = getTotalCpuCores ( ) ; for ( int i = 1 ; i <= ( java.lang.Math.min ( totalCPUCores , max ) ) ; i ++ ) { if ( ( totalCPUCores % i ) == 0 ) { res.add ( i ) ; } } return res ; }
Source:
void initComboBox ( ) { keyListBoxEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( new org.ovirt.engine.ui.common.widget.renderer.StringRenderer < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( ) { @ java.lang.Override public java.lang.String render ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo optionInfo ) { if ( optionInfo != null ) { return optionInfo.getKey ( ) ; } return null ; } } ) ; keyTextBoxEditor = new org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextBoxEditor ( ) ; keyComboBox = new org.ovirt.engine.ui.common.widget.ComboBox < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( keyListBoxEditor , keyTextBoxEditor ) ; }

Target:
void initComboBox ( ) { keyListBoxEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.StringRenderer < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( ) { @ java.lang.Override public java.lang.String render ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo optionInfo ) { if ( optionInfo != null ) { return optionInfo.getKey ( ) ; } return null ; } } ) ; keyTextBoxEditor = new org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextBoxEditor ( ) ; keyComboBox = new org.ovirt.engine.ui.common.widget.ComboBox ( keyListBoxEditor , keyTextBoxEditor ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmDevice createVMDevice ( org.ovirt.engine.core.compat.Guid vmID , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vmID ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 1 , null , true , true , true , "" , null , disk.getVmSnapshotId ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmDevice createVMDevice ( org.ovirt.engine.core.compat.Guid vmID , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vmID ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 1 , null , true , true , true , "" , null , disk.getVmSnapshotId ( ) , null ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc getDeviceList ( int storageType , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct options ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getDeviceList ( storageType , options.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc ( 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.LUNListReturnForXmlRpc getDeviceList ( int storageType ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getDeviceList ( storageType ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void hostNInUse ( ) { org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.ArgumentMatchers.anyString ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VDS_WITH_SAME_HOST_EXIST ) ) ; }

Target:
public void hostNInUse ( ) { org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VDS_WITH_SAME_HOST_EXIST ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; vmID = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; pluggedDisk = createDiskImage ( true ) ; unpluggedDisk = createDiskImage ( true ) ; pluggedDiskSnapshot = createDiskImage ( false ) ; pluggedDiskSnapshot.setVmSnapshotId ( snapshotId ) ; pluggedDiskSnapshot.setActive ( false ) ; unpluggedDiskSnapshot = createDiskImage ( false ) ; unpluggedDiskSnapshot.setVmSnapshotId ( snapshotId ) ; unpluggedDiskSnapshot.setActive ( false ) ; setUpDaoMocks ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; vmID = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; pluggedDisk = createDiskImage ( true ) ; unpluggedDisk = createDiskImage ( true ) ; pluggedDiskSnapshot = createDiskImage ( false ) ; pluggedDiskSnapshot.setVmSnapshotId ( snapshotId ) ; unpluggedDiskSnapshot = createDiskImage ( false ) ; unpluggedDiskSnapshot.setVmSnapshotId ( snapshotId ) ; setUpDaoMocks ( ) ; }
Source:
protected boolean checkImageConfiguration ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { return org.ovirt.engine.core.bll.ImagesHandler.CheckImageConfiguration ( destStorages.get ( diskInfoDestinationMap.get ( diskImage.getId ( ) ) . getStorageIds ( ) . get ( 0 ) ) . getStorageStaticData ( ) , diskImage , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean checkImageConfiguration ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { return org.ovirt.engine.core.bll.ImagesHandler.checkImageConfiguration ( destStorages.get ( diskInfoDestinationMap.get ( diskImage.getId ( ) ) . getStorageIds ( ) . get ( 0 ) ) . getStorageStaticData ( ) , diskImage , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getAllForStoragePoolAndStatus ( org.ovirt.engine.core.compat.Guid storagePool , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = getCallsHandler ( ) . executeReadList ( "getVdsByStoragePoolIdWithStatus" , org.ovirt.engine.core.dao.VdsDAODbFacadeImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , storagePool ) . addValue ( "status" , status.getValue ( ) ) ) ; return uniteAgents ( vdsList ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getAllForStoragePoolAndStatus ( org.ovirt.engine.core.compat.Guid storagePool , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = getCallsHandler ( ) . executeReadList ( "getVdsByStoragePoolIdWithStatus" , org.ovirt.engine.core.dao.VdsDAODbFacadeImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , storagePool ) . addValue ( "status" , ( status != null ? status.getValue ( ) : null ) ) ) ; return uniteAgents ( vdsList ) ; }
Source:
public void refreshHeavyWeightData ( ) { org.ovirt.engine.core.bll.gluster.GlusterManager.log.debug ( "Refreshing Gluster Data [heavyweight]" ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : getClusterDao ( ) . getAll ( ) ) { try { refreshClusterHeavyWeightData ( cluster ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.gluster.GlusterManager.log.errorFormat ( "Error while refreshing Gluster heavyweight data of cluster {0}!" , cluster.getname ( ) , e ) ; } } }

Target:
public void refreshHeavyWeightData ( ) { log.debug ( "Refreshing Gluster Data [heavyweight]" ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : getClusterDao ( ) . getAll ( ) ) { try { refreshClusterHeavyWeightData ( cluster ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Error while refreshing Gluster heavyweight data of cluster {0}!" , cluster.getname ( ) , e ) ; } } }