auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static int getMaxNumberOfMonitors ( ) { int max = 0 ; java.lang.String numOfMonitorsStr = org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.ValidNumOfMonitors ) . toString ( ) . replaceAll ( "[\\[\\]]" , "" ) ; java.lang.String [ ] values = numOfMonitorsStr.split ( "," ) ; for ( java.lang.String val : values ) { val = val.trim ( ) ; if ( ( java.lang.Integer.valueOf ( val ) ) > max ) { max = java.lang.Integer.valueOf ( val ) ; } } return max ; }

Target:
private static int getMaxNumberOfMonitors ( ) { int max = 0 ; java.lang.String numOfMonitorsStr = org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.ValidNumOfMonitors ) . toString ( ) . replaceAll ( "[\\[\\]]" , "" ) ; java.lang.String [ ] values = numOfMonitorsStr.split ( "," ) ; for ( java.lang.String text : values ) { text = text.trim ( ) ; int val = java.lang.Integer.parseInt ( text ) ; if ( val > max ) { max = val ; } } return max ; }
Source:
public void shouldDetectMissingPinningEntry ( ) { vm.getvNumaNodeList ( ) . get ( 0 ) . getVdsNumaNodeList ( ) . get ( 0 ) . getSecond ( ) . setSecond ( null ) ; assertValidationFailure ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_PINNED_INDEX_ERROR ) ; }

Target:
public void shouldDetectMissingPinningEntry ( ) { vm.getvNumaNodeList ( ) . get ( 0 ) . getVdsNumaNodeList ( ) . get ( 0 ) . getSecond ( ) . setSecond ( null ) ; assertValidationFailure ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_PINNED_INDEX_ERROR ) ; }
Source:
public void getAAAProfilesEntriesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public static boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } boolean archMemorySnapshotSupported = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ; return ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) && archMemorySnapshotSupported ; }

Target:
public boolean isLiveMergeSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { return ( vm != null ) && ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.LiveMergeSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) ; }
Source:
public void testGetClusterFeaturesForVersionAndCategory ( ) { verifyFeaturesReturned ( dao.getClusterFeaturesForVersionAndCategory ( "3.5" , ApplicationMode.VirtOnly ) , java.util.Arrays.asList ( "TEST_FEATURE_1" , "TEST_FEATURE_3" , "TEST_FEATURE_4" , "TEST_FEATURE_5" ) ) ; verifyFeaturesReturned ( dao.getClusterFeaturesForVersionAndCategory ( "3.5" , ApplicationMode.GlusterOnly ) , java.util.Arrays.asList ( "TEST_FEATURE_2" , "TEST_FEATURE_3" , "TEST_FEATURE_4" , "TEST_FEATURE_5" ) ) ; verifyFeaturesReturned ( dao.getClusterFeaturesForVersionAndCategory ( "3.5" , ApplicationMode.AllModes ) , java.util.Arrays.asList ( "TEST_FEATURE_1" , "TEST_FEATURE_2" , "TEST_FEATURE_3" , "TEST_FEATURE_4" , "TEST_FEATURE_5" ) ) ; }

Target:
public void testGetClusterFeaturesForVersionAndCategory ( ) { verifyFeaturesReturned ( dao.getClusterFeaturesForVersionAndCategory ( "3.6" , ApplicationMode.VirtOnly ) , java.util.Arrays.asList ( "TEST_FEATURE_1" , "TEST_FEATURE_3" , "TEST_FEATURE_4" , "TEST_FEATURE_5" ) ) ; verifyFeaturesReturned ( dao.getClusterFeaturesForVersionAndCategory ( "3.6" , ApplicationMode.GlusterOnly ) , java.util.Arrays.asList ( "TEST_FEATURE_2" , "TEST_FEATURE_3" , "TEST_FEATURE_4" , "TEST_FEATURE_5" ) ) ; verifyFeaturesReturned ( dao.getClusterFeaturesForVersionAndCategory ( "3.6" , ApplicationMode.AllModes ) , java.util.Arrays.asList ( "TEST_FEATURE_1" , "TEST_FEATURE_2" , "TEST_FEATURE_3" , "TEST_FEATURE_4" , "TEST_FEATURE_5" ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior ) ( array [ 0 ] ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( array [ 1 ] ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; model.SetClusters ( model , clusters , null ) ; behavior.InitTemplate ( ) ; behavior.InitCdImage ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior ) ( array [ 0 ] ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( array [ 1 ] ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; model.setClusters ( model , clusters , null ) ; behavior.initTemplate ( ) ; behavior.initCdImage ( ) ; }
Source:
private static boolean verifyByteArray ( java.io.DataInputStream dataInputStream , byte [ ] expected ) throws java.io.IOException { int length = dataInputStream.readInt ( ) ; byte [ ] contents = new byte [ length ] ; int numBytes = dataInputStream.read ( contents , 0 , length ) ; if ( numBytes != length ) { return false ; } if ( expected != null ) { return java.util.Arrays.equals ( contents , expected ) ; } return true ; }

Target:
private static boolean isBase64 ( byte [ ] octects ) { for ( int i = 0 ; i < ( octects.length ) ; i ++ ) { if ( ! ( org.apache.commons.codec.binary.Base64.isBase64 ( octects [ i ] ) ) ) { return false ; } } return true ; }
Source:
public void testNetworksOnNicMatchMtu ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = java.util.Arrays.asList ( createNetwork ( 1 , false ) , createNetwork ( 1 , false ) ) ; java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > networksOnNics = java.util.Collections.singletonMap ( "nicName" , networks ) ; org.ovirt.engine.core.bll.network.host.NetworkMtuValidator networkMtuValidator = new org.ovirt.engine.core.bll.network.host.NetworkMtuValidator ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networks ) ) ; org.junit.Assert.assertThat ( networkMtuValidator.validateMtu ( networksOnNics ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworksOnNicMatchMtu ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = java.util.Collections.singletonList ( createNetwork ( 1 , false , "netA" ) ) ; java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > networksOnNics = java.util.Collections.singletonMap ( "nicName" , networks ) ; org.ovirt.engine.core.bll.network.host.NetworkMtuValidator networkMtuValidator = new org.ovirt.engine.core.bll.network.host.NetworkMtuValidator ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networks ) ) ; org.junit.Assert.assertThat ( networkMtuValidator.validateMtu ( networksOnNics ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void onRollback ( ) { }

Target:
private void updateHeOvf ( ) { if ( ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) == null ) { ovfDataUpdater.triggerNow ( ) ; return ; } org.ovirt.engine.core.bll.VmCommand.registerRollbackHandler ( ( ( org.ovirt.engine.core.utils.transaction.TransactionSuccessListener ) ( ( ) -> ovfDataUpdater.triggerNow ( ) ) ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { validateParameters ( storageDomain , "id|name" ) ; org.ovirt.engine.core.compat.Guid storageDomainId ; if ( storageDomain.isSetId ( ) ) { storageDomainId = asGuid ( storageDomain.getId ( ) ) ; } else { storageDomainId = lookupStorageDomainIdByName ( storageDomain.getName ( ) ) ; } return performCreate ( VdcActionType.AttachStorageDomainToPool , new org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters ( storageDomainId , dataCenterId ) , new org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainsResource.StorageDomainIdResolver ( storageDomainId ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { validateParameters ( storageDomain , "id|name" ) ; org.ovirt.engine.core.compat.Guid storageDomainId ; if ( storageDomain.isSetId ( ) ) { storageDomainId = asGuid ( storageDomain.getId ( ) ) ; } else { storageDomainId = lookupStorageDomainIdByName ( storageDomain.getName ( ) ) ; } return performCreate ( VdcActionType.AttachStorageDomainToPool , new org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters ( storageDomainId , dataCenterId ) , new org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainsResource.StorageDomainIdResolver ( storageDomainId ) ) ; }
Source:
public java.lang.String getVar_value ( ) { return this . var_value ; }

Target:
public int hashCode ( ) { if ( this . hashCodeDirty ) { final int prime = ovirt_engine_dwh.aggregationtodaily_3_4.AggregationToDaily.row11Struct.PRIME ; int result = ovirt_engine_dwh.aggregationtodaily_3_4.AggregationToDaily.row11Struct.DEFAULT_HASHCODE ; result = ( prime * result ) + ( ( this . var_name ) == null ? 0 : this . var_name.hashCode ( ) ) ; this . hashCode = result ; this . hashCodeDirty = false ; } return this . hashCode ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > parseLUNList ( java.util.Map < java.lang.String , java.lang.Object > [ ] lunList , org.ovirt.engine.core.compat.Version compatibilityVersion ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > result = new java.util.ArrayList < > ( lunList.length ) ; for ( java.util.Map < java.lang.String , java.lang.Object > xlun : lunList ) { result.add ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLunFromXmlRpc ( xlun , compatibilityVersion ) ) ; } return result ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > parseLUNList ( java.util.Map < java.lang.String , java.lang.Object > [ ] lunList , org.ovirt.engine.core.compat.Version compatibilityVersion ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > result = new java.util.ArrayList < > ( lunList.length ) ; for ( java.util.Map < java.lang.String , java.lang.Object > xlun : lunList ) { result.add ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLun ( xlun , compatibilityVersion ) ) ; } return result ; }
Source:
public void testAddOperationAction ( ) { org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.ActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > testOperation = new org.ovirt.engine.ui.frontend.communication.VdcOperation ( org.ovirt.engine.core.common.action.ActionType.AddNetworkOnProvider , new org.ovirt.engine.core.common.action.VdcActionParametersBase ( ) , null ) ; testManager.addOperation ( testOperation ) ; org.mockito.Mockito.verify ( mockOperationProcessor ) . processOperation ( testManager ) ; org.mockito.Mockito.verify ( mockEventBus ) . fireEvent ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.ui.frontend.communication.EngineSessionRefreshedEvent.class ) ) ; org.junit.Assert.assertEquals ( "Operations must match" , testOperation , testManager.pollOperation ( ) ) ; }

Target:
public void testAddOperationAction ( ) { org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.ActionType , org.ovirt.engine.core.common.action.ActionParametersBase > testOperation = new org.ovirt.engine.ui.frontend.communication.VdcOperation ( org.ovirt.engine.core.common.action.ActionType.AddNetworkOnProvider , new org.ovirt.engine.core.common.action.ActionParametersBase ( ) , null ) ; testManager.addOperation ( testOperation ) ; org.mockito.Mockito.verify ( mockOperationProcessor ) . processOperation ( testManager ) ; org.mockito.Mockito.verify ( mockEventBus ) . fireEvent ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.ui.frontend.communication.EngineSessionRefreshedEvent.class ) ) ; org.junit.Assert.assertEquals ( "Operations must match" , testOperation , testManager.pollOperation ( ) ) ; }
Source:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { 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.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static void getDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public static void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
private java.lang.String determineSpiceProxy ( ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( getCachedVm ( ) . getVmPoolSpiceProxy ( ) ) ) { return getCachedVm ( ) . getVmPoolSpiceProxy ( ) ; } if ( org.apache.commons.lang.StringUtils.isNotBlank ( getCachedVm ( ) . getClusterSpiceProxy ( ) ) ) { return getCachedVm ( ) . getClusterSpiceProxy ( ) ; } java.lang.String globalSpiceProxy = getConfigValue ( ConfigValues.SpiceProxyDefault ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( globalSpiceProxy ) ) { return globalSpiceProxy ; } return null ; }

Target:
private java.lang.String determineSpiceProxy ( ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( getCachedVm ( ) . getVmPoolSpiceProxy ( ) ) ) { return getCachedVm ( ) . getVmPoolSpiceProxy ( ) ; } if ( org.apache.commons.lang.StringUtils.isNotBlank ( getCachedVm ( ) . getClusterSpiceProxy ( ) ) ) { return getCachedVm ( ) . getClusterSpiceProxy ( ) ; } java.lang.String globalSpiceProxy = org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.SpiceProxyDefault ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( globalSpiceProxy ) ) { return globalSpiceProxy ; } return null ; }
Source:
public static void main ( java.lang.String ... args ) { try { org.apache.log4j.Logger.getRootLogger ( ) . setLevel ( org.apache.log4j.Level.OFF ) ; org.ovirt.engine.core.config.EngineConfig.getInstance ( ) . setParser ( new org.ovirt.engine.core.config.EngineConfigCLIParser ( ) ) ; org.ovirt.engine.core.config.EngineConfig.getInstance ( ) . setUpAndExecute ( args ) ; } catch ( java.lang.Throwable t ) { org.ovirt.engine.core.config.EngineConfig.log.debug ( "Exiting with error: " , t ) ; java.lang.System.err.println ( t.getMessage ( ) ) ; java.lang.System.exit ( 1 ) ; } }

Target:
public static void main ( java.lang.String ... args ) { try { org.apache.log4j.Logger.getRootLogger ( ) . setLevel ( org.apache.log4j.Level.DEBUG ) ; org.ovirt.engine.core.config.EngineConfig.getInstance ( ) . setParser ( new org.ovirt.engine.core.config.EngineConfigCLIParser ( ) ) ; org.ovirt.engine.core.config.EngineConfig.getInstance ( ) . setUpAndExecute ( args ) ; } catch ( java.lang.Throwable t ) { org.ovirt.engine.core.config.EngineConfig.log.debug ( "Exiting with error: " , t ) ; java.lang.System.err.println ( t.getMessage ( ) ) ; java.lang.System.exit ( 1 ) ; } }
Source:
public void vdspysGroupWithVirtGlusterNotSupported ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; canDoActionFailedWithReason ( EngineMessage.GLUSTER_NOT_SUPPORTED ) ; }

Target:
public void vdspysGroupWithVirtGlusterNotSupported ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.GLUSTER_NOT_SUPPORTED ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getImage ( ) { switch ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getActionState ( ) ) { case END_SUCCESS : case END_FAILURE : if ( ( diskImage ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getParameters ( ) . getImageGroupID ( ) ) ; diskImage = ( diskImages.isEmpty ( ) ) ? null : diskImages.get ( 0 ) ; } return diskImage ; default : return super . getImage ( ) ; } }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getImage ( ) { switch ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getActionState ( ) ) { case END_SUCCESS : case END_FAILURE : if ( ( diskImage ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = diskImageDao.getAllSnapshotsForImageGroup ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getParameters ( ) . getImageGroupID ( ) ) ; diskImage = ( diskImages.isEmpty ( ) ) ? null : diskImages.get ( 0 ) ; } return diskImage ; default : return super . getImage ( ) ; } }
Source:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
public void isSupportBridgesReportByVDSM ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , 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.GetProviderCertificateChainText , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMInfoListReturnForXmlRpc getVmStats ( java.lang.String vmId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.getStats" ) . withParameter ( "vmID" , vmId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "statsList" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VMInfoListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMInfoListReturn getVmStats ( java.lang.String vmId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.getStats" ) . withParameter ( "vmID" , vmId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "statsList" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VMInfoListReturn ( response ) ; }
Source:
public void getAllForVmForUnprivilegedUserWithNoFilter ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > interfaces = dao.getAllForVm ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID , org.ovirt.engine.core.dao.UNPRIVILEGED_USER_ID , false ) ; assertVmGuestAgentInterfaceForVm ( interfaces ) ; }

Target:
public void removeAllForVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > interfaces = dao.getAllForVm ( FixturesTool.VM_RHEL5_POOL_50 ) ; org.junit.Assert.assertFalse ( interfaces.isEmpty ( ) ) ; dao.removeAllForVms ( java.util.Collections.singletonList ( FixturesTool.VM_RHEL5_POOL_50 ) ) ; interfaces = dao.getAllForVm ( FixturesTool.VM_RHEL5_POOL_50 ) ; org.junit.Assert.assertTrue ( interfaces.isEmpty ( ) ) ; }
Source:
public void OnSuccess ( org.ovirt.engine.ui.uicompat.FrontendQueryAsyncResult result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > permissions = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ) ( result.getReturnValue ( ) . getReturnValue ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.permissions permission : permissions ) { if ( ( ( permission.getObjectType ( ) ) == ( org.ovirt.engine.core.common.VdcObjectType.System ) ) && ( ( permission.getRoleType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) ) { hasAdminSystemPermission = true ; break ; } } UpdateConfigureLocalStorageCommandAvailability1 ( ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.String prefix = ( ( java.lang.String ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel ) ( target ) ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( prefix ) ) ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel pathModel = model.getStorage ( ) . getPath ( ) ; pathModel.setEntity ( prefix ) ; pathModel.setIsChangable ( false ) ; } configureLocalStorage3 ( model ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc reconstructMaster ( java.lang.String spUUID , java.lang.String msdUUID , java.lang.String masterVersion ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = irsServer.reconstructMaster ( spUUID , msdUUID , masterVersion ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc reconstructMaster ( java.lang.String spUUID , int hostSpmId , java.lang.String msdUUID , java.lang.String masterVersion ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = irsServer.reconstructMaster ( spUUID , hostSpmId , msdUUID , masterVersion ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }
Source:
public org.ovirt.engine.sdk.entities.Action resetoption ( org.ovirt.engine.sdk.entities.Action action , java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/resetoption" ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.entities.Action rebalance ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/rebalance" ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }
Source:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }

Target:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
public static void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.UploadStreamCommand.setSucceeded ( true ) ; }

Target:
protected boolean commandSpecificCanDoAction ( ) { org.ovirt.engine.core.common.businessentities.DiskImage targetDisk = org.ovirt.engine.core.bll.UploadStreamCommand.getDiskImage ( ) ; if ( ( targetDisk.getVolumeType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VolumeType.Preallocated ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_VOLUME_TYPE_UNSUPPORTED , java.lang.String.format ( "$volumeType %1$s" , targetDisk.getVolumeType ( ) . toString ( ) ) , java.lang.String.format ( "$supportedVolumeTypes %1$s" , VolumeType.Preallocated ) ) ; } return true ; }
Source:
protected boolean isImageNotLocked ( ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ; if ( ( diskImage.getimageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Move ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; addCanDoActionMessage ( java.lang.String.format ( "$%1$s %2$s" , "diskAlias" , diskImage.getDiskAlias ( ) ) ) ; } else { addCanDoActionMessage ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } return false ; } return true ; }

Target:
protected boolean isImageNotLocked ( ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ; if ( ( diskImage.getimageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Move ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; addCanDoActionMessage ( java.lang.String.format ( "$%1$s %2$s" , "diskAliases" , diskImage.getDiskAlias ( ) ) ) ; } else { addCanDoActionMessage ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } return false ; } return true ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = getDbFacade ( ) . getDiskDao ( ) . get ( getParameters ( ) . getObjectId ( ) ) ; if ( disk == null ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; return false ; } if ( ! ( disk.getDiskStorageType ( ) . isInternal ( ) ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_DISK_OPERATION ) ; return false ; } this . disk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; return super . canDoAction ( ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = getDbFacade ( ) . getDiskDao ( ) . get ( getParameters ( ) . getObjectId ( ) ) ; if ( disk == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; return false ; } if ( ! ( disk.getDiskStorageType ( ) . isInternal ( ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_DISK_OPERATION ) ; return false ; } this . disk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; return super . validate ( ) ; }
Source:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public void getHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { getHostListByStatus ( aQuery , null ) ; }
Source:
private void internalFreeLock ( java.lang.String mac ) { if ( mAllocatedCustomMacs.contains ( mac ) ) { mAllocatedCustomMacs.remove ( mac ) ; } else if ( mAllocatedMacs.contains ( mac ) ) { mAllocatedMacs.remove ( mac ) ; mAvailableMacs.add ( mac ) ; } }

Target:
private void internalFreeMac ( java.lang.String mac ) { if ( mAllocatedCustomMacs.contains ( mac ) ) { mAllocatedCustomMacs.remove ( mac ) ; } else if ( mAllocatedMacs.contains ( mac ) ) { mAllocatedMacs.remove ( mac ) ; mAvailableMacs.add ( mac ) ; } }
Source:
private void mockOsRepository ( ) { org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.mockito.Mockito.when ( osRepository.get64bitOss ( ) ) . thenReturn ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest._64_BIT_OS ) ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }

Target:
private void mockOsRepository ( ) { org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.mockito.Mockito.when ( osRepository.get64bitOss ( ) ) . thenReturn ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest._64_BIT_OS ) ) ; final java.util.Map < java.lang.Integer , org.ovirt.engine.core.common.businessentities.ArchitectureType > osArchitectures = new java.util.HashMap < java.lang.Integer , org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { { put ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest._64_BIT_OS , ArchitectureType.x86_64 ) ; } } ; org.mockito.Mockito.when ( osRepository.getOsArchitectures ( ) ) . thenReturn ( java.util.Collections.unmodifiableMap ( osArchitectures ) ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }
Source:
public void shouldDetectSufficientMemory ( ) { vm.setNumaTuneMode ( NumaTuneMode.STRICT ) ; vmNumaNodes.get ( 0 ) . setMemTotal ( 1000 ) ; vdsNumaNodes.get ( 0 ) . setMemTotal ( 2000 ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }

Target:
public void shouldDetectSufficientMemory ( ) { vm.setNumaTuneMode ( NumaTuneMode.STRICT ) ; vmNumaNodes.get ( 0 ) . setMemTotal ( 1000 ) ; vdsNumaNodes.get ( 0 ) . setMemTotal ( 2000 ) ; org.junit.Assert.assertTrue ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity getDistributedVolume ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getVolume ( volumeId ) ; volume.setStatus ( ( volumeId == ( volumeId1 ) ? org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP : org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.DOWN ) ) ; volume.setBricks ( getBricks ( volumeId , "distrib" , 2 ) ) ; volume.setVolumeType ( GlusterVolumeType.DISTRIBUTE ) ; volume.setClusterId ( clusterId ) ; return volume ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity getDistributedVolume ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getVolume ( volumeId ) ; volume.setStatus ( ( volumeId == ( volumeId1 ) ? org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP : org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.DOWN ) ) ; volume.setBricks ( getBricks ( volumeId , "distrib" , 2 ) ) ; volume.setVolumeType ( GlusterVolumeType.DISTRIBUTED_REPLICATE ) ; volume.setClusterId ( clusterId ) ; return volume ; }
Source:
public void removeNetworkFromParameters ( org.ovirt.engine.core.common.action.SetupNetworksParameters params , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.common.businessentities.network.Network net ) { if ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( net ) ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = getVlanDevice ( params.getInterfaces ( ) , nic , net ) ; if ( vlan == null ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.NETWORK_LABEL_CONFLICT ) ; } else { params.getInterfaces ( ) . remove ( vlan ) ; } } else if ( org.apache.commons.lang.StringUtils.equals ( net.getName ( ) , nic.getNetworkName ( ) ) ) { nic.setNetworkName ( null ) ; } }

Target:
public void removeNetworkFromParameters ( org.ovirt.engine.core.common.action.PersistentSetupNetworksParameters params , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.common.businessentities.network.Network net ) { if ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( net ) ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = getVlanDevice ( params.getInterfaces ( ) , nic , net ) ; if ( vlan == null ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.NETWORK_LABEL_CONFLICT ) ; } else { params.getInterfaces ( ) . remove ( vlan ) ; } } else if ( org.apache.commons.lang.StringUtils.equals ( net.getName ( ) , nic.getNetworkName ( ) ) ) { nic.setNetworkName ( null ) ; } }
Source:
private java.util.List < java.lang.String > getDisksAliases ( java.util.List < org.ovirt.engine.core.common.action.MoveDiskParameters > moveVmDisksParamsList ) { java.util.List < java.lang.String > disksAliases = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters : moveVmDisksParamsList ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = diskMap.get ( moveDiskParameters.getImageId ( ) ) ; disksAliases.add ( diskImage.getDiskAlias ( ) ) ; } return disksAliases ; }

Target:
private java.util.List < java.lang.String > getDisksAliases ( java.util.List < org.ovirt.engine.core.common.action.MoveDiskParameters > moveVmDisksParamsList ) { java.util.List < java.lang.String > disksAliases = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters : moveVmDisksParamsList ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = diskMap.get ( moveDiskParameters.getImageId ( ) ) ; disksAliases.add ( diskImage.getDiskAlias ( ) ) ; } return disksAliases ; }
Source:
public int hashCode ( ) { return java.util.Objects.hash ( id , hostName , consoleAddress , name , otpValidity , pmEnabled , pmKdumpDetection , port , protocol , sshPort , sshUsername , serverSslEnabled , uniqueId , clusterId , vdsStrength , vdsType , disablePowerManagementPolicy , hostProviderId ) ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( id , hostName , consoleAddress , name , otpValidity , pmEnabled , pmKdumpDetection , port , protocol , sshPort , sshUsername , serverSslEnabled , uniqueId , clusterId , vdsStrength , vdsType , disablePowerManagementPolicy , hostProviderId , openstackNetworkProviderId ) ; }
Source:
public void findNoneOfActiveVmsUsingNetworks ( ) { mockDaos ( true ) ; java.util.List < java.lang.String > vmNames = vmInterfaceManager.findActiveVmsUsingNetworks ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , java.util.Collections.singletonList ( ( ( NETWORK_NAME ) + "1" ) ) ) ; org.junit.Assert.assertTrue ( vmNames.isEmpty ( ) ) ; }

Target:
public void findNoneOfActiveVmsUsingNetworks ( ) { mockDaos ( true ) ; java.util.List < java.lang.String > vmNames = vmInterfaceManager.findActiveVmsUsingNetworks ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , java.util.Collections.singletonList ( ( ( org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.NETWORK_NAME ) + "1" ) ) ) ; org.junit.Assert.assertTrue ( vmNames.isEmpty ( ) ) ; }
Source:
public static org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes fromGraphicsTypes ( java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > types ) { if ( types.containsAll ( java.util.Arrays.asList ( GraphicsType.SPICE , GraphicsType.VNC ) ) ) { return org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.SPICE_AND_VNC ; } else if ( types.contains ( GraphicsType.SPICE ) ) { return org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.SPICE ; } else if ( types.contains ( GraphicsType.VNC ) ) { return org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.VNC ; } return null ; }

Target:
public static org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes fromGraphicsTypes ( java.util.Set < org.ovirt.engine.core.common.businessentities.GraphicsType > types ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes myTypes : org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.values ( ) ) { if ( myTypes.getBackingGraphicsTypes ( ) . equals ( types ) ) { return myTypes ; } } return org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.NONE ; }