auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testScoreForCpuLoad ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionCPUWeightPolicyUnit unit = mockPolicyUnit ( org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionCPUWeightPolicyUnit.class ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > > cache = newCache ( ) ; final java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VDS > hosts = loadHosts ( "basic_power_saving_hosts_cpu_load.csv" , cache ) ; final java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > vms = loadVMs ( "basic_power_saving_vms.csv" , cache ) ; testScore ( unit , hosts , vms , org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionWeightPolicyUnitTest.DESTINATION_HOST ) ; }

Target:
public void setUp ( ) { org.ovirt.engine.core.bll.scheduling.pending.PendingResourceManager pendingResourceManager = new org.ovirt.engine.core.bll.scheduling.pending.PendingResourceManager ( ) ; evenDistributionCPUWeightPolicyUnit = new org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionCPUWeightPolicyUnit ( null , pendingResourceManager ) ; evenDistributionMemoryWeightPolicyUnit = new org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionMemoryWeightPolicyUnit ( null , pendingResourceManager ) ; }
Source:
public void onCreated ( org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault instance ) { getIcon ( ) . setEntity ( instance ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getBehavior ( ) . deactivateInstanceTypeManager ( ) ; updateWatchdogItems ( ( ( java.util.HashSet < org.ovirt.engine.core.common.businessentities.VmWatchdogType > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; getBehavior ( ) . activateInstanceTypeManager ( ) ; }
Source:
public void Configure ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { spice.setDesiredVersion ( getSpiceVersion ( ) ) ; spice.setCurrentVersion ( getSpiceVersion ( ) ) ; spice.setAdminConsole ( getSpiceAdminConsole ( ) ) ; spice.setFullScreen ( getSpiceFullScreen ( ) ) ; spice.setSpiceBaseURL ( org.ovirt.engine.ui.uicommonweb.Configurator.getSpiceBaseURL ( ) ) ; spice.setUsbFilter ( getUsbFilter ( ) ) ; updateSpiceUsbAutoShare ( spice ) ; if ( ! ( isInitialized ) ) { updateIsUsbEnabled ( ) ; isInitialized = true ; } }

Target:
public void configure ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { spice.setDesiredVersion ( getSpiceVersion ( ) ) ; spice.setCurrentVersion ( getSpiceVersion ( ) ) ; spice.setAdminConsole ( getSpiceAdminConsole ( ) ) ; spice.setFullScreen ( getSpiceFullScreen ( ) ) ; spice.setSpiceBaseURL ( org.ovirt.engine.ui.uicommonweb.Configurator.getSpiceBaseURL ( ) ) ; spice.setUsbFilter ( getUsbFilter ( ) ) ; updateSpiceUsbAutoShare ( spice ) ; if ( ! ( isInitialized ) ) { updateIsUsbEnabled ( ) ; isInitialized = true ; } }
Source:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getBroker ( ) . connectStorageServer ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , BuildStructFromConnectionListObject ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.ProceedProxyReturnValue ( ) ; setReturnValue ( _result.convertToStatusList ( ) ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getBroker ( ) . connectStorageServer ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , BuildStructFromConnectionListObject ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.ProceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.String > returnValue = _result.convertToStatusList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.setReturnValue ( returnValue ) ; logFailedStorageConnections ( returnValue ) ; }
Source:
public void isVirtioScsiEnabledDefaultedToTrue ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > cmd = setupCanAddVmTests ( 0 , 0 ) ; org.mockito.Mockito.doReturn ( createVdsGroup ( ) ) . when ( cmd ) . getVdsGroup ( ) ; junit.framework.Assert.assertTrue ( "isVirtioScsiEnabled hasn't been defaulted to true on cluster >= 3.3." , cmd.isVirtioScsiEnabled ( ) ) ; }

Target:
public void isVirtioScsiEnabledDefaultedToTrue ( ) { mockOsRepository ( ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > cmd = setupCanAddVmTests ( 0 , 0 ) ; org.mockito.Mockito.doReturn ( createVdsGroup ( ) ) . when ( cmd ) . getVdsGroup ( ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Arrays.asList ( "VirtIO_SCSI" ) ) ) ; junit.framework.Assert.assertTrue ( "isVirtioScsiEnabled hasn't been defaulted to true on cluster >= 3.3." , cmd.isVirtioScsiEnabled ( ) ) ; }
Source:
protected void IsAllLunsSelectedChanged ( ) { if ( ! ( getIsGrouppedByTarget ( ) ) ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.LunModel > items = ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.LunModel > ) ( getItems ( ) ) ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.LunModel lun : items ) { if ( ( ! ( lun.getIsIncluded ( ) ) ) && ( lun.getIsAccessible ( ) ) ) { lun.setIsSelected ( getIsAllLunsSelected ( ) ) ; } } } }

Target:
protected void isAllLunsSelectedChanged ( ) { if ( ! ( getIsGrouppedByTarget ( ) ) ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.LunModel > items = ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.LunModel > ) ( getItems ( ) ) ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.LunModel lun : items ) { if ( ( ! ( lun.getIsIncluded ( ) ) ) && ( lun.getIsAccessible ( ) ) ) { lun.setIsSelected ( getIsAllLunsSelected ( ) ) ; } } } }
Source:
public org.ovirt.engine.core.common.businessentities.network.Network getByName ( java.lang.String name ) { java.util.Map < java.lang.String , java.lang.Object > dbResults = dialect.createJdbcCallForQuery ( jdbcTemplate ) . withProcedureName ( "GetnetworkByName" ) . returningResultSet ( "RETURN_VALUE" , org.ovirt.engine.core.dao.network.NetworkDaoDbFacadeImpl.NetworkRowMapper.instance ) . execute ( getCustomMapSqlParameterSource ( ) . addValue ( "networkName" , name ) ) ; return ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( org.ovirt.engine.core.dal.dbbroker.DbFacadeUtils.asSingleResult ( ( ( java.util.List < ? > ) ( dbResults.get ( "RETURN_VALUE" ) ) ) ) ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.Network getByName ( java.lang.String name ) { return getCallsHandler ( ) . executeRead ( "GetnetworkByName" , org.ovirt.engine.core.dao.network.NetworkDaoDbFacadeImpl.NetworkRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "networkName" , name ) ) ; }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId , filterOutExistingHosts , searchFilter ) , aQuery ) ; }

Target:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters params = new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( ) ; params.setFilterOutExistingHosts ( filterOutExistingHosts ) ; params.setProviderId ( providerId ) ; params.setSearchFilter ( searchFilter ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , params , aQuery ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.AffinityGroup affinityGroup ) { org.ovirt.engine.api.model.AffinityGroup backendEntity = getMapper ( org.ovirt.engine.api.model.AffinityGroup.class , org.ovirt.engine.api.model.AffinityGroup.class ) . map ( affinityGroup , null ) ; backendEntity.setClusterId ( asGuid ( clusterId ) ) ; return performCreate ( VdcActionType.AddAffinityGroup , new org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters ( null , backendEntity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetAffinityGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) , true ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.AffinityGroup affinityGroup ) { org.ovirt.engine.api.model.AffinityGroup backendEntity = getMapper ( org.ovirt.engine.api.model.AffinityGroup.class , org.ovirt.engine.api.model.AffinityGroup.class ) . map ( affinityGroup , null ) ; backendEntity.setClusterId ( asGuid ( clusterId ) ) ; return performCreate ( ActionType.AddAffinityGroup , new org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters ( null , backendEntity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetAffinityGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) , true ) ; }
Source:
public org.ovirt.engine.sdk.decorators.VmPool update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.VmPool.class , org.ovirt.engine.sdk.decorators.VmPool.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.VmPool update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.VmPool.class , org.ovirt.engine.sdk.decorators.VmPool.class , headers ) ; }
Source:
private static boolean isDiskOrInterface ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { return ( ( vmDevice.getDevice ( ) . equals ( VmDeviceType.DISK.getName ( ) ) ) && ( ( vmDevice.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK ) ) ) || ( ( vmDevice.getDevice ( ) . equals ( VmDeviceType.BRIDGE.getName ( ) ) ) && ( ( vmDevice.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.INTERFACE ) ) ) ; }

Target:
private static boolean isDiskOrInterface ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { return ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isDisk ( vmDevice ) ) || ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isBridge ( vmDevice ) ) ; }
Source:
public void testConvertMillsecondsToMinutes ( ) { long milliSeconds = 60000L ; org.ovirt.engine.core.common.utils.Pair < java.lang.Long , java.util.concurrent.TimeUnit > expectedResults = org.ovirt.engine.core.common.utils.TimeConverter.autoConvert ( milliSeconds , java.util.concurrent.TimeUnit.MILLISECONDS ) ; org.junit.Assert.assertEquals ( 1L , expectedResults.getFirst ( ) . longValue ( ) ) ; org.junit.Assert.assertEquals ( java.util.concurrent.TimeUnit.MINUTES , expectedResults.getSecond ( ) ) ; }

Target:
public void testConvertMillsecondsToMinutes ( ) { long milliSeconds = 60000L ; org.ovirt.engine.core.common.utils.Pair < java.lang.Long , java.util.concurrent.TimeUnit > expectedResults = org.ovirt.engine.core.common.utils.TimeConverter.autoConvert ( milliSeconds , java.util.concurrent.TimeUnit.MILLISECONDS ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1L , expectedResults.getFirst ( ) . longValue ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( java.util.concurrent.TimeUnit.MINUTES , expectedResults.getSecond ( ) ) ; }
Source:
public void testAddLabelToNicAndValidateWhenUsingValidLabel ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; java.util.List < java.lang.Class < ? > > validationGroups = java.util.Arrays.< java.lang.Class < ? > > asList ( javax.validation.groups.Default.class , org.ovirt.engine.core.common.validation.group.UpdateEntity.class , org.ovirt.engine.core.common.validation.group.CreateEntity.class ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . addLabelToNicAndValidate ( "ok" , validationGroups ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testInterfaceIsBondWhenInterfaceIsNull ( ) throws java.lang.Exception { org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( null ) . interfaceIsBondOrNull ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private boolean verifyPropertyValues ( final java.util.Properties properties ) { boolean result = true ; if ( ( ( brandingProperties.getProperty ( org.ovirt.engine.core.branding.BrandingTheme.REPLACE_TEMPLATE_KEY ) ) != null ) && ( ! ( java.util.Arrays.asList ( org.ovirt.engine.core.branding.BrandingTheme.TEMPLATE_REPLACE_VALUES ) . contains ( brandingProperties.getProperty ( org.ovirt.engine.core.branding.BrandingTheme.REPLACE_TEMPLATE_KEY ) . toLowerCase ( ) ) ) ) ) { org.ovirt.engine.core.branding.BrandingTheme.log.warn ( ( ( org.ovirt.engine.core.branding.BrandingTheme.REPLACE_TEMPLATE_KEY ) + " value is not true or false" ) ) ; result = false ; } return result ; }

Target:
private boolean verifyPropertyValues ( final java.util.Properties properties ) { boolean result = true ; if ( ( ( brandingProperties.getProperty ( org.ovirt.engine.core.branding.BrandingTheme.REPLACE_TEMPLATE_KEY ) ) != null ) && ( ! ( java.util.Arrays.asList ( org.ovirt.engine.core.branding.BrandingTheme.TEMPLATE_REPLACE_VALUES ) . contains ( brandingProperties.getProperty ( org.ovirt.engine.core.branding.BrandingTheme.REPLACE_TEMPLATE_KEY ) . toLowerCase ( ) ) ) ) ) { org.ovirt.engine.core.branding.BrandingTheme.log.warn ( "'{}' value is not true or false" , org.ovirt.engine.core.branding.BrandingTheme.REPLACE_TEMPLATE_KEY ) ; result = false ; } return result ; }
Source:
protected void updateDetailsAvailability ( ) { super . updateDetailsAvailability ( ) ; if ( ( ( getSelectedItem ( ) ) != null ) && ( ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getSelectedItem ( ) ) ) . getQuotaEnforcementType ( ) ) != ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) ) { quotaListModel.setIsAvailable ( true ) ; } else { quotaListModel.setIsAvailable ( false ) ; } }

Target:
protected void updateDetailsAvailability ( ) { super . updateDetailsAvailability ( ) ; if ( ( getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getSelectedItem ( ) ) ) ; quotaListModel.setIsAvailable ( ( ( storagePool.getQuotaEnforcementType ( ) ) != ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) ) ; updateIscsiBondListAvailability ( storagePool ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.network.VnicProfile getVnicProfileForNetwork ( org.ovirt.engine.core.common.businessentities.network.Network network , java.lang.String vnicProfileName ) { if ( vnicProfileName == null ) { return null ; } for ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView vnicProfile : getVnicProfilesInDc ( ) ) { if ( ( org.apache.commons.lang.ObjectUtils.equals ( vnicProfile.getNetworkId ( ) , network.getId ( ) ) ) && ( vnicProfileName.equals ( vnicProfile.getName ( ) ) ) ) { return vnicProfile ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VnicProfile getVnicProfileForNetwork ( org.ovirt.engine.core.common.businessentities.network.Network network , java.lang.String vnicProfileName ) { if ( vnicProfileName == null ) { return null ; } for ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView vnicProfile : getVnicProfilesInDc ( ) ) { if ( ( java.util.Objects.equals ( vnicProfile.getNetworkId ( ) , network.getId ( ) ) ) && ( vnicProfileName.equals ( vnicProfile.getName ( ) ) ) ) { return vnicProfile ; } } return null ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isRunOnlyIfAllCanDoPass , boolean waitForResult ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = notAllowToRunAction ( actionType ) ; if ( returnValue != null ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > list = new java.util.ArrayList < > ( ) ; list.add ( returnValue ) ; return list ; } else { return runMultipleActionsImpl ( actionType , parameters , false , isRunOnlyIfAllCanDoPass , waitForResult , null ) ; } }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isRunOnlyIfAllValidationPass , boolean waitForResult ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = notAllowToRunAction ( actionType ) ; if ( returnValue != null ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > list = new java.util.ArrayList < > ( ) ; list.add ( returnValue ) ; return list ; } else { return runMultipleActionsImpl ( actionType , parameters , false , isRunOnlyIfAllValidationPass , waitForResult , null ) ; } }
Source:
public void testMigratoinCanBeSetWhenVMUsesScsiReservation ( ) { prepareVmToPassCanDoAction ( ) ; vm.setMigrationSupport ( MigrationSupport.MIGRATABLE ) ; org.ovirt.engine.core.common.businessentities.VmDevice device = createVmDevice ( ) ; device.setUsingScsiReservation ( false ) ; mockVmDevice ( device ) ; mockVmValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void testMigratoinCanBeSetWhenVMUsesScsiReservation ( ) { prepareVmToPassCanDoAction ( ) ; vm.setMigrationSupport ( MigrationSupport.MIGRATABLE ) ; org.ovirt.engine.core.common.businessentities.VmDevice device = createVmDevice ( ) ; device.setUsingScsiReservation ( false ) ; mockVmDevice ( device ) ; mockVmValidator ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS getHost ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getParameters ( ) . getVdsId ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( ( ( org.ovirt.engine.core.compat.Guid ) ( id != null ? id : org.ovirt.engine.core.compat.Guid.Empty ) ) ) ; vds.setStoragePoolId ( org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getParameters ( ) . getStoragePoolId ( ) ) ; vds.setPmProxyPreferences ( org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getParameters ( ) . getPmProxyPreferences ( ) ) ; return vds ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS getHost ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getParameters ( ) . getVdsId ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( ( ( org.ovirt.engine.core.compat.Guid ) ( id != null ? id : org.ovirt.engine.core.compat.Guid.Empty ) ) ) ; vds.setVdsGroupId ( org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getParameters ( ) . getVdsGroupId ( ) ) ; vds.setStoragePoolId ( org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getParameters ( ) . getStoragePoolId ( ) ) ; vds.setPmProxyPreferences ( org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getParameters ( ) . getPmProxyPreferences ( ) ) ; return vds ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "session_id" ) ) ; entity.setKey ( rs.getString ( "config_key" ) ) ; entity.setValue ( rs.getString ( "config_value" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "session_id" ) ) ; entity.setKey ( rs.getString ( "config_key" ) ) ; entity.setValue ( rs.getString ( "config_value" ) ) ; entity.setDescription ( rs.getString ( "config_description" ) ) ; entity.setAllowedValues ( java.util.Arrays.asList ( rs.getString ( "config_possible_values" ) . split ( ";" ) ) ) ; return entity ; }
Source:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > getDisksModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : getDisks ( ) ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = new org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ( ) ; diskModel.setDisk ( diskImage ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel storageDomain = new org.ovirt.engine.ui.uicommonweb.models.ListModel ( ) ; storageDomain.setSelectedItem ( getStorageDomain ( ) ) ; diskModel.setStorageDomain ( storageDomain ) ; diskModels.add ( diskModel ) ; } return diskModels ; }

Target:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > getDisksModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : getDisks ( ) ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = new org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ( ) ; diskModel.setDisk ( diskImage ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel storageDomain = new org.ovirt.engine.ui.uicommonweb.models.ListModel ( ) ; storageDomain.setSelectedItem ( getStorageDomain ( ) ) ; diskModel.setStorageDomain ( storageDomain ) ; diskModels.add ( diskModel ) ; } return diskModels ; }
Source:
public 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 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 getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
public void nullifiedSnapshotOnUpdateDiskToShareable ( ) { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableDisk ( VolumeFormat.RAW ) ) ; org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = createDiskImage ( ) ; oldDisk.setVmSnapshotId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( oldDisk ) ; initializeCommand ( parameters ) ; mockVmStatusDown ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( ( ( oldDisk.getVmSnapshotId ( ) ) == null ) ) ; }

Target:
public void canDoActionFailedShareableDiskVolumeFormatUnsupported ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableDisk ( VolumeFormat.COW ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; initializeCommand ( parameters ) ; mockVmStatusDown ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT.toString ( ) ) ) ; }
Source:
public static void GetUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName , java.lang.Integer maxCount ) { org.ovirt.engine.core.common.queries.SearchParameters searchParameters = new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Host: cluster = " + clusterName ) + " and status = up" ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; if ( maxCount != null ) { searchParameters.setMaxCount ( maxCount ) ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParameters , aQuery ) ; }

Target:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName , java.lang.Integer maxCount ) { org.ovirt.engine.core.common.queries.SearchParameters searchParameters = new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Host: cluster = " + clusterName ) + " and status = up" ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; if ( maxCount != null ) { searchParameters.setMaxCount ( maxCount ) ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParameters , aQuery ) ; }
Source:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomainStatic > domainStaticEntries = getDbFacade ( ) . getStorageDomainStaticDao ( ) . getAllByStorage ( provider.getId ( ) . toString ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic domainStaticEntry : domainStaticEntries ) { getDbFacade ( ) . getStorageDomainDynamicDao ( ) . remove ( domainStaticEntry.getId ( ) ) ; getDbFacade ( ) . getStorageDomainStaticDao ( ) . remove ( domainStaticEntry.getId ( ) ) ; } }

Target:
public org.ovirt.engine.core.common.businessentities.RepoImage getImageAsRepoImage ( java.lang.String id ) { org.ovirt.engine.core.common.businessentities.RepoImage repoImage = org.ovirt.engine.core.bll.provider.OpenstackImageProviderProxy.imageToRepoImage ( getClient ( ) . images ( ) . show ( id ) . execute ( ) ) ; repoImage.setLastRefreshed ( java.lang.System.currentTimeMillis ( ) ) ; return repoImage ; }
Source:
private < T extends org.ovirt.engine.core.dao.Dao > T getDao ( java.lang.Class < T > daoType ) { for ( org.ovirt.engine.core.dao.Dao dao : daos ) { if ( daoType.isAssignableFrom ( dao.getClass ( ) ) ) { return ( ( T ) ( dao ) ) ; } } org.ovirt.engine.core.dal.dbbroker.DbFacade.log.error ( ( "Can't find dao for " + daoType ) ) ; return null ; }

Target:
private < T extends org.ovirt.engine.core.dao.Dao > T getDao ( java.lang.Class < T > daoType ) { for ( org.ovirt.engine.core.dao.Dao dao : daos ) { if ( daoType.isAssignableFrom ( dao.getClass ( ) ) ) { return ( ( T ) ( dao ) ) ; } } throw new java.lang.IllegalArgumentException ( ( "There is no Dao registered for dao type " + ( daoType.getName ( ) ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc createVolumeContainer ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > createVolumeInfo ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.create_volume" ) . withParameter ( "job_id" , jobId ) . withParameter ( "vol_info" , createVolumeInfo ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn createVolumeContainer ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > createVolumeInfo ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.create_volume" ) . withParameter ( "job_id" , jobId ) . withParameter ( "vol_info" , createVolumeInfo ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
private void assertCanDoActionSucceeds ( ) { org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void createCommand ( ) { param = new org.ovirt.engine.core.common.action.AttachNetworkToVdsGroupParameter ( getExistingVdsGroupId ( ) , getNetwork ( ) ) ; command = new org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand < org.ovirt.engine.core.common.action.AttachNetworkToVdsGroupParameter > ( param ) { @ java.lang.Override public org.ovirt.engine.core.dao.VdsGroupDAO getVdsGroupDAO ( ) { return vdsGroupDAO ; } @ java.lang.Override protected org.ovirt.engine.core.dao.network.NetworkClusterDao getNetworkClusterDAO ( ) { return networkClusterDAO ; } @ java.lang.Override protected org.ovirt.engine.core.dao.network.NetworkDao getNetworkDAO ( ) { return networkDao ; } } ; }
Source:
protected boolean canDoAction ( ) { if ( ( hostedEngineHelper.getStorageDomain ( ) ) != null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST ) ; } if ( ! ( fetchStorageDomainInfo ( ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } if ( ! ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES ) . contains ( heStorageDomain.getStorageType ( ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ( hostedEngineHelper.getStorageDomain ( ) ) != null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST ) ; } if ( ! ( fetchStorageDomainInfo ( ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } if ( ! ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES ) . contains ( heStorageDomain.getStorageType ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED ) ; } return true ; }
Source:
public void testDiskLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk disk = new org.ovirt.engine.api.model.Disk ( ) ; disk.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.DISK_ID ) ; disk.setVm ( new org.ovirt.engine.api.model.VM ( ) ) ; disk.getVm ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.common.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , disk ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.DISK_HREF , disk.getHref ( ) ) ; }

Target:
public void testDiskLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk disk = new org.ovirt.engine.api.model.Disk ( ) ; disk.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.DISK_ID ) ; disk.setVm ( new org.ovirt.engine.api.model.VM ( ) ) ; disk.getVm ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , disk ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.DISK_HREF , disk.getHref ( ) ) ; }
Source:
public void getCustomValuesLeaksInternalStructure ( ) { final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; b.addCustomValue ( key , value ) ; final java.lang.String v = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , v ) ; final java.util.Map < java.lang.String , java.lang.String > m = b.getCustomValues ( ) ; m.clear ( ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( "" , s ) ; }

Target:
public void getCustomValuesLeaksInternalStructure ( ) { final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; b.addCustomValue ( key , value ) ; final java.lang.String v = b.getCustomValue ( key ) ; org.junit.jupiter.api.Assertions.assertEquals ( value , v ) ; final java.util.Map < java.lang.String , java.lang.String > m = b.getCustomValues ( ) ; m.clear ( ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.jupiter.api.Assertions.assertEquals ( "" , s ) ; }
Source:
public void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public static void getHostPublicKey ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testGlusterCompatibilityOnLowVersion ( ) { storagePool.setCompatibilityVersion ( Version.v3_0 ) ; storageDomain.setStorageFormat ( StorageFormatType.V1 ) ; storageDomain.setStorageType ( StorageType.GLUSTERFS ) ; org.ovirt.engine.core.bll.ValidationResult attachGlusterToLowVersionResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertFalse ( "Attaching a GLUSTER domain succeeded while it should have failed" , attachGlusterToLowVersionResult.isValid ( ) ) ; assertFailingMessage ( "Attaching a GLUSTER domain failed failed with the wrong message" , attachGlusterToLowVersionResult , VdcBllMessages.DATA_CENTER_GLUSTER_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ; }

Target:
public void testGlusterCompatibilityOnLowVersion ( ) { storagePool.setCompatibilityVersion ( Version.v3_0 ) ; storageDomain.setStorageFormat ( StorageFormatType.V1 ) ; storageDomain.setStorageType ( StorageType.GLUSTERFS ) ; org.ovirt.engine.core.bll.ValidationResult attachGlusterToLowVersionResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertFalse ( "Attaching a GLUSTER domain succeeded while it should have failed" , attachGlusterToLowVersionResult.isValid ( ) ) ; assertFailingMessage ( "Attaching a GLUSTER domain failed failed with the wrong message" , attachGlusterToLowVersionResult , EngineMessage.DATA_CENTER_GLUSTER_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ; }
Source:
public void setCurrentRefreshRate ( int newRefreshRate ) { saveRefreshRate ( newRefreshRate ) ; getModelTimer ( ) . setRefreshRate ( readRefreshRate ( ) ) ; updateTimer ( ) ; }

Target:
private void updateTimer ( ) { final org.ovirt.engine.ui.uicommonweb.models.GridTimer modelTimer = getModelTimer ( ) ; modelTimer.setRefreshRate ( readRefreshRate ( ) ) ; if ( ( statusUpdateHandlerRegistration ) != null ) { statusUpdateHandlerRegistration.removeHandler ( ) ; } statusUpdateHandlerRegistration = modelTimer.addGridTimerStateChangeEventHandler ( new org.ovirt.engine.ui.uicommonweb.models.GridTimerStateChangeEvent.GridTimerStateChangeEventHandler ( ) { @ java.lang.Override public void onGridTimerStateChange ( org.ovirt.engine.ui.uicommonweb.models.GridTimerStateChangeEvent event ) { onRefresh ( modelTimer.getTimerRefreshStatus ( ) ) ; } } ) ; modelTimer.resume ( ) ; }
Source:
public void freeMac ( java.lang.String mac ) { org.ovirt.engine.core.bll.MacPoolManager.log.infoFormat ( "MacPoolManager::freeMac(mac = '{0}') - entered" , mac ) ; synchronized ( mLocObj ) { if ( ! ( mInitialized ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_NOT_INITIALIZED ) ; } 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:
public static boolean isAdminUser ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > userRoles = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getRoleDAO ( ) . getAnyAdminRoleForUserAndGroups ( user.getId ( ) , org.apache.commons.lang.StringUtils.join ( user.getGroupIds ( ) , "," ) ) ; if ( ! ( userRoles.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.debug ( "LoginAdminUser: User logged to admin using role '{}'" , userRoles.get ( 0 ) . getName ( ) ) ; return true ; } return false ; }

Target:
public static boolean isAdminUser ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > userRoles = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getRoleDao ( ) . getAnyAdminRoleForUserAndGroups ( user.getId ( ) , org.apache.commons.lang.StringUtils.join ( user.getGroupIds ( ) , "," ) ) ; if ( ! ( userRoles.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.debug ( "LoginAdminUser: User logged to admin using role '{}'" , userRoles.get ( 0 ) . getName ( ) ) ; return true ; } return false ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachmentWithIpConfiguration ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol bootProtocol , java.lang.String address , java.lang.String netmask ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; org.ovirt.engine.core.common.businessentities.network.IPv4Address primaryAddress = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; primaryAddress.setAddress ( address ) ; primaryAddress.setNetmask ( netmask ) ; primaryAddress.setBootProtocol ( bootProtocol ) ; ipConfiguration.getIPv4Addresses ( ) . add ( primaryAddress ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( ipConfiguration ) ; return attachment ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachmentWithIpv4Configuration ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol bootProtocol , java.lang.String address , java.lang.String netmask ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; org.ovirt.engine.core.common.businessentities.network.IPv4Address primaryAddress = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; primaryAddress.setAddress ( address ) ; primaryAddress.setNetmask ( netmask ) ; primaryAddress.setBootProtocol ( bootProtocol ) ; ipConfiguration.getIPv4Addresses ( ) . add ( primaryAddress ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( ipConfiguration ) ; return attachment ; }