auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static int getFirstImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( curr.getParentId ( ) . equals ( images.get ( i ) . getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
private void removeVmSnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Collection < java.lang.String > memoriesOfRemovedSnapshots = new org.ovirt.engine.core.bll.snapshots.SnapshotsManager ( ) . removeSnapshots ( vm.getId ( ) ) ; new org.ovirt.engine.core.bll.memory.MemoryImageRemover ( vm , this ) . removeMemoryVolumes ( memoriesOfRemovedSnapshots ) ; }
Source:
private void initExternalHostProviderWidgets ( boolean isAvailable ) { externalHostProviderEnabledEditor.setVisible ( isAvailable ) ; externalHostNameEditor.setVisible ( false ) ; providersEditor.setVisible ( false ) ; searchProviderPanel.setVisible ( false ) ; }

Target:
private void initExternalHostProviderWidgets ( boolean isAvailable ) { externalHostProviderEnabledEditor.setVisible ( isAvailable ) ; provisionedHostSection.setVisible ( false ) ; discoveredHostSection.setVisible ( false ) ; providersEditor.setVisible ( false ) ; discoveredHostsPanel.setVisible ( false ) ; searchProviderPanel.setVisible ( false ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { boolean hasIscsiStorage = false ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : connections ) { if ( ( connection.getstorage_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.StorageType.ISCSI ) ) { hasIscsiStorage = true ; break ; } } iscsiBondListModel.setIsAvailable ( hasIscsiStorage ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { boolean hasIscsiStorage = false ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : connections ) { if ( ( connection.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.StorageType.ISCSI ) ) { hasIscsiStorage = true ; break ; } } iscsiBondListModel.setIsAvailable ( hasIscsiStorage ) ; }
Source:
public static java.lang.String resolveStepMessage ( org.ovirt.engine.core.common.job.StepEnum stepName , java.util.Map < java.lang.String , java.lang.String > values ) { java.lang.String stepMessage = org.ovirt.engine.core.dal.job.ExecutionMessageDirector.getInstance ( ) . getStepMessage ( stepName ) ; if ( stepMessage != null ) { return org.ovirt.engine.core.dal.job.ExecutionMessageDirector.auditLogDirector.resolveMessage ( stepMessage , values ) ; } else { return stepName.name ( ) ; } }

Target:
public static java.lang.String resolveStepMessage ( org.ovirt.engine.core.common.job.StepEnum stepName , java.util.Map < java.lang.String , java.lang.String > values ) { java.lang.String stepMessage = org.ovirt.engine.core.dal.job.ExecutionMessageDirector.getInstance ( ) . getStepMessage ( stepName ) ; if ( stepMessage != null ) { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.MessageResolver.resolveMessage ( stepMessage , values ) ; } else { return stepName.name ( ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.Provider > providersListModel = getProviders ( ) ; providersListModel.setItems ( providers , org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( providers ) ) ; providersListModel.setIsChangable ( true ) ; getIsDiscoveredHosts ( ) . setEntity ( null ) ; getIsDiscoveredHosts ( ) . setEntity ( true ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangable ( true ) ; setEnableSearchHost ( true ) ; }
Source:
private void updateMemoryBoxVisibility ( ) { org.ovirt.engine.core.common.businessentities.VM vm = model.getVm ( ) ; if ( vm == null ) { return ; } boolean memorySnapshotSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) ; memoryEditor.setVisible ( ( memorySnapshotSupported && ( vm.isRunning ( ) ) ) ) ; if ( ! ( memoryEditor.isVisible ( ) ) ) { model.getMemory ( ) . setEntity ( false ) ; } }

Target:
private void updateMemoryBoxVisibility ( ) { org.ovirt.engine.core.common.businessentities.VM vm = model.getVm ( ) ; if ( vm == null ) { return ; } boolean memorySnapshotSupported = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isMemorySnapshotSupported ( vm ) ; memoryEditor.setVisible ( ( memorySnapshotSupported && ( vm.isRunning ( ) ) ) ) ; if ( ! ( memoryEditor.isVisible ( ) ) ) { model.getMemory ( ) . setEntity ( false ) ; } }
Source:
public void testStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( "AppErrors" ) ; java.util.List < java.lang.String > error = et.TranslateErrorText ( java.util.Arrays.asList ( "ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST" , "$action SOMEACTION" , "$type SOME Type" ) ) ; java.lang.String result = "Cannot SOMEACTION SOME Type. VM's Image doesn't exist." ; assertTrue ( "Size" , ( ( error.size ( ) ) == 1 ) ) ; assertEquals ( "String should equal" , result , error.get ( 0 ) ) ; }

Target:
public void testStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( "AppErrors" ) ; java.util.List < java.lang.String > error = et.TranslateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_WITH_REPLACEMENT , "$action SOMEACTION" , "$type SOME Type" ) ) ; java.lang.String result = "Cannot SOMEACTION SOME Type. VM's Image doesn't exist." ; assertTrue ( "Size" , ( ( error.size ( ) ) == 1 ) ) ; assertEquals ( "String should equal" , result , error.get ( 0 ) ) ; }
Source:
public void getClusterDesktopMemoryOverCommit ( 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 ) ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.vds_spm_id_map mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.vds_spm_id_map entity = new org.ovirt.engine.core.common.businessentities.vds_spm_id_map ( ) ; entity.setstorage_pool_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "storage_pool_id" ) ) ) ; entity.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "vds_id" ) ) ) ; entity.setvds_spm_id ( rs.getInt ( "vds_spm_id" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.vds_spm_id_map get ( org.ovirt.engine.core.compat.Guid vdsId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vds_id" , vdsId ) ; return getCallsHandler ( ) . executeRead ( "Getvds_spm_id_mapByvds_id" , org.ovirt.engine.core.dao.VdsSpmIdMapDAODbFacadeImpl.VdsSpmIdMapRowMapper.instance , parameterSource ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { doInit ( storageDomainId ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; if ( ( pools == null ) || ( ( pools.size ( ) ) != 1 ) ) { return ; } org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = pools.get ( 0 ) ; setStoragePool ( dataCenter ) ; callback.onSuccess ( model , returnValue ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( getNetwork ( ) ) ; return ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notLabeled ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( getNetwork ( ) ) ; return ( ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notLabeled ( ) ) ) ) && ( validate ( validator.notExternalNetwork ( ) ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > getEventNotificationMethodsByType ( java.lang.String method_type ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "method_type" , method_type ) ; org.springframework.jdbc.core.simple.ParameterizedRowMapper < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > mapper = new org.springframework.jdbc.core.simple.ParameterizedRowMapper < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.EventNotificationMethod mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.EventNotificationMethod entity = new org.ovirt.engine.core.common.businessentities.EventNotificationMethod ( ) ; entity.setmethod_id ( rs.getInt ( "method_id" ) ) ; entity.setmethod_type ( EventNotificationMethods.EMAIL ) ; return entity ; } } ; return getCallsHandler ( ) . executeReadList ( "GetEventNotificationMethodByType" , mapper , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > getEventNotificationMethodsByType ( java.lang.String method_type ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "method_type" , method_type ) ; return getCallsHandler ( ) . executeReadList ( "GetEventNotificationMethodByType" , org.ovirt.engine.core.dao.EventDAODbFacadeImpl.EventNotificationMethodRowMapper.instance , parameterSource ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStart ( volumeName , remoteHost , remoteVolumeName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionCreate ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String userName , java.lang.Boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeGeoRepSessionCreate ( volumeName , remoteHost , remoteVolumeName , userName , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected boolean validateQuota ( ) { getParameters ( ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Disk dit : getVm ( ) . getDiskMap ( ) . values ( ) ) { ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( dit ) ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; } return true ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.VM.name ( ) . toLowerCase ( ) , ( ( getVmName ( ) ) == null ? "" : getVmName ( ) ) ) ; jobProperties.put ( VdcObjectType.VdsGroups.name ( ) . toLowerCase ( ) , getVdsGroupName ( ) ) ; } return jobProperties ; }
Source:
public org.ovirt.engine.core.common.job.Step addTaskStep ( org.ovirt.engine.core.bll.job.ExecutionContext context , org.ovirt.engine.core.common.job.StepEnum stepName , java.lang.String description ) { if ( context == null ) { return null ; } org.ovirt.engine.core.common.job.Step step = null ; if ( context.isTasksMonitored ( ) ) { org.ovirt.engine.core.common.job.Step parentTaskStep = context.getParentTasksStep ( ) ; if ( parentTaskStep != null ) { step = addSubStep ( parentTaskStep , stepName , description ) ; } } return step ; }

Target:
public org.ovirt.engine.core.common.job.Step addTaskStep ( org.ovirt.engine.core.bll.job.ExecutionContext context , org.ovirt.engine.core.common.job.StepEnum stepName , java.lang.String description , java.util.Collection < org.ovirt.engine.core.common.job.StepSubjectEntity > stepSubjectEntities ) { if ( context == null ) { return null ; } org.ovirt.engine.core.common.job.Step step = null ; if ( context.isTasksMonitored ( ) ) { org.ovirt.engine.core.common.job.Step parentTaskStep = context.getParentTasksStep ( ) ; if ( parentTaskStep != null ) { step = addSubStep ( parentTaskStep , stepName , description , stepSubjectEntities ) ; } } return step ; }
Source:
public void qosOverridden ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_4 ) ; validateAndAssertQosOverridden ( helper , iface ) ; }

Target:
public void qosOverridden ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_4 ) ; validateAndAssertQosOverridden ( helper , iface ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getBroker ( ) . glusterVolumeRemoveBrickForce ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getParameters ( ) . getBrickDirectories ( ) . toArray ( new java.lang.String [ 0 ] ) , org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getParameters ( ) . getReplicaCount ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getBroker ( ) . glusterVolumeRemoveBrickForce ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getParameters ( ) . getBrickDirectories ( ) . toArray ( new java.lang.String [ 0 ] ) , org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getParameters ( ) . getReplicaCount ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public void validateMultiDisksWithNotEnoughSpaceOnDomains ( ) { setupMocks ( ) ; org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > cmd = createCommand ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.FreeSpaceCriticalLowInGB ) ) . thenReturn ( 95 ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW.toString ( ) ) ) ; }

Target:
public void validateNoFreeSpacePctOnDomains ( ) { mockGetImageDomainsListVdsCommand ( 2 , 2 ) ; mcr.mockConfigValue ( ConfigValues.FreeSpaceLow , 50 ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW.toString ( ) ) ) ; }
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 void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , 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 : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { if ( "CREATIONDATE" . equals ( fieldName ) ) { return TimeConditionRelationAutoCompleter.INSTANCE ; } else if ( ( "CHILDCOUNT" . equals ( fieldName ) ) || ( "MEM" . equals ( fieldName ) ) ) { return NumericConditionRelationAutoCompleter.INSTANCE ; } else { return StringConditionRelationAutoCompleter.INSTANCE ; } }

Target:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { if ( org.ovirt.engine.core.searchbackend.VmTemplateConditionFieldAutoCompleter.CREATIONDATE.equals ( fieldName ) ) { return TimeConditionRelationAutoCompleter.INSTANCE ; } else if ( ( org.ovirt.engine.core.searchbackend.VmTemplateConditionFieldAutoCompleter.CHILDCOUNT.equals ( fieldName ) ) || ( org.ovirt.engine.core.searchbackend.VmTemplateConditionFieldAutoCompleter.MEM.equals ( fieldName ) ) ) { return NumericConditionRelationAutoCompleter.INSTANCE ; } else { return StringConditionRelationAutoCompleter.INSTANCE ; } }
Source:
protected java.util.List < org.ovirt.engine.core.bll.tasks.SPMAsyncTaskHandler > initTaskHandlers ( ) { return java.util.Arrays.< org.ovirt.engine.core.bll.tasks.SPMAsyncTaskHandler > asList ( new org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCreateTaskHandler ( this ) , new org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCopyTaskHandler ( this ) ) ; }

Target:
private void setupParameters ( ) { org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . setImageGroupID ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . setDestinationImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ) ; }
Source:
private boolean isClientBrowserUnsupported ( ) { return ( ( org.ovirt.engine.ui.uicommonweb.Configurator ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.Configurator.class ) ) ) . isClientWindowsExplorer ( ) ; }

Target:
private boolean isClientBrowserSupported ( ) { boolean isExplorer = ( ( org.ovirt.engine.ui.uicommonweb.Configurator ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.Configurator.class ) ) ) . isClientWindowsExplorer ( ) ; java.lang.Float browserVersion = ( ( org.ovirt.engine.ui.uicommonweb.Configurator ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.Configurator.class ) ) ) . clientBrowserVersion ( ) ; return isExplorer ? browserVersion >= 11.0F : true ; }
Source:
private void generateReadStruct ( org.ovirt.api.metamodel.concepts.StructMember member , java.lang.String variable ) { org.ovirt.sdk.ruby.RubyName readerName = rubyNames.getReaderName ( member.getType ( ) ) ; buffer.addLine ( "%1$s = %2$s.read_one(reader, connection)" , variable , readerName.getClassName ( ) ) ; buffer.addLine ( "%1$s.is_link = %2$s" , variable , ( member instanceof org.ovirt.api.metamodel.concepts.Link ) ) ; }

Target:
private void generateReadStruct ( org.ovirt.api.metamodel.concepts.StructMember member , java.lang.String variable ) { org.ovirt.sdk.ruby.RubyName readerName = rubyNames.getReaderName ( member.getType ( ) ) ; buffer.addLine ( "%1$s = %2$s.read_one(reader)" , variable , readerName.getClassName ( ) ) ; }
Source:
protected void updateSgIoUnfilteredChangeability ( ) { if ( ! ( getIsScsiPassthrough ( ) . getEntity ( ) ) ) { getIsSgIoUnfiltered ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.cannotEnableSgioWhenScsiPassthroughDisabled ( ) ) ; getIsSgIoUnfiltered ( ) . setIsChangable ( false ) ; getIsSgIoUnfiltered ( ) . setEntity ( false ) ; return ; } getIsSgIoUnfiltered ( ) . setIsChangable ( isEditEnabled ( ) ) ; }

Target:
protected void updateSgIoUnfilteredChangeability ( ) { if ( ! ( getIsScsiPassthrough ( ) . getEntity ( ) ) ) { getIsSgIoUnfiltered ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.cannotEnableSgioWhenScsiPassthroughDisabled ( ) ) ; getIsSgIoUnfiltered ( ) . setIsChangable ( false ) ; getIsSgIoUnfiltered ( ) . setEntity ( false ) ; return ; } getIsSgIoUnfiltered ( ) . setIsChangable ( isEditEnabled ( ) ) ; }
Source:
protected boolean canDoAction ( ) { boolean retValue = true ; if ( ( disk ) == null ) { retValue = false ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } if ( retValue ) { buildSharedLockMap ( ) ; retValue = org.ovirt.engine.core.bll.RemoveDiskCommand.acquireLockInternal ( ) ; } retValue = retValue && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? canRemoveDiskBasedOnImageStorageCheck ( ) : canRemoveLunDisk ( ) ) ; return retValue ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Disk getDisk ( ) { if ( ( disk ) == null ) { disk = getDiskDao ( ) . get ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getEntityId ( ) ) ) ) ; } return disk ; }
Source:
protected boolean checkStorageDomainStatus ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus ... statuses ) { boolean valid = false ; if ( ( getStorageDomainStatus ( ) ) != null ) { valid = java.util.Arrays.asList ( statuses ) . contains ( getStorageDomainStatus ( ) ) ; } if ( ! valid ) { addStorageDomainStatusIllegalMessage ( ) ; } return valid ; }

Target:
protected boolean checkStorageDomainStatus ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus ... statuses ) { boolean valid = false ; org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = getStorageDomainStatus ( ) ; if ( status != null ) { valid = java.util.Arrays.asList ( statuses ) . contains ( getStorageDomainStatus ( ) ) ; } if ( ! valid ) { if ( status == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Locked ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ; } addStorageDomainStatusIllegalMessage ( ) ; } return valid ; }
Source:
public void setEntity ( java.lang.Object value ) { if ( ( entity ) != value ) { entityChanging ( value , entity ) ; entity = value ; onEntityChanged ( ) ; getEntityChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Entity" ) ) ; } }

Target:
public void setEntity ( T value ) { if ( ( entity ) != value ) { entityChanging ( value , entity ) ; entity = value ; onEntityChanged ( ) ; getEntityChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Entity" ) ) ; } }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getDbFacade ( ) . getVmDao ( ) . getAllVmsRelatedToQuotaId ( org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getParameters ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( vm.getStaticData ( ) , true ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskImageByDiskAliasComparator ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.fillImagesBySnapshots ( vm ) ; } org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vms ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getDbFacade ( ) . getVmDao ( ) . getAllVmsRelatedToQuotaId ( org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getParameters ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( vm.getStaticData ( ) , true ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskImageByDiskAliasComparator ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.fillImagesBySnapshots ( vm ) ; } org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vms ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

Target:
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.storage_pool > ( ) ; } final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > storagePoolList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( source ) ) ; java.util.Collections.sort ( storagePoolList , new org.ovirt.engine.ui.uicommonweb.Linq.StoragePoolByNameComparer ( ) ) ; return source ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain getVgEntity ( int index ) { org.ovirt.engine.api.restapi.resource.StorageDomain entity = new org.ovirt.engine.api.restapi.resource.StorageDomain ( ) ; entity.setStorage ( ( ( org.ovirt.engine.api.restapi.resource.BackendHostStorageResourceTest.VG_ID_PREFIX ) + ( GUIDS [ index ] . toString ( ) ) ) ) ; entity.setStorageType ( org.ovirt.engine.core.common.businessentities.StorageType.ISCSI ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain getVgEntity ( int index ) { org.ovirt.engine.api.restapi.resource.StorageDomain entity = new org.ovirt.engine.api.restapi.resource.StorageDomain ( ) ; entity.setStorage ( ( ( org.ovirt.engine.api.restapi.resource.BackendHostStorageResourceTest.VG_ID_PREFIX ) + ( GUIDS [ index ] . toString ( ) ) ) ) ; entity.setStorageType ( org.ovirt.engine.core.common.businessentities.storage.StorageType.ISCSI ) ; return entity ; }
Source:
public void setSearchString ( java.lang.String value , boolean checkIfNewValue ) { if ( ( ! checkIfNewValue ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( searchString , value ) ) ) ) { searchString = value ; SearchStringChanged ( ) ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "SearchString" ) ) ; } }

Target:
public void setSearchString ( java.lang.String value , boolean checkIfNewValue ) { if ( ( ! checkIfNewValue ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( searchString , value ) ) ) ) { searchString = value ; SearchStringChanged ( ) ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SearchString" ) ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.DbGroup getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DbGroup entity = new org.ovirt.engine.core.common.businessentities.DbGroup ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.GROUP_NAMES [ index ] ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; entity.setNamespace ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.NAMESPACE ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.aaa.DbGroup getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.aaa.DbGroup entity = new org.ovirt.engine.core.common.businessentities.aaa.DbGroup ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.GROUP_NAMES [ index ] ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; entity.setNamespace ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.NAMESPACE ) ; return entity ; }
Source:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.core.common.businessentities.VmNetworkInterface entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , entity ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , entity ) ; } }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetPayloadExpectations ( 0 ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM vm = resource.get ( ) ; assertTrue ( vm.isSetStatistics ( ) ) ; verifyModel ( vm , 0 ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetPayloadExpectations ( 0 ) ; setUpGetBallooningExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM vm = resource.get ( ) ; assertTrue ( vm.isSetStatistics ( ) ) ; verifyModel ( vm , 0 ) ; } finally { accepts.clear ( ) ; } }
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.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
private void verifyAddUser ( javax.ws.rs.core.Response response ) { org.junit.Assert.assertEquals ( 201 , response.getStatus ( ) ) ; org.junit.Assert.assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.User ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.User ) ( response.getEntity ( ) ) ) , 0 ) ; }

Target:
private void verifyAddUser ( javax.ws.rs.core.Response response ) { org.junit.jupiter.api.Assertions.assertEquals ( 201 , response.getStatus ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.User ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.User ) ( response.getEntity ( ) ) ) , 0 ) ; }
Source:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel model ) { super . init ( model ) ; model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "AllowClusterWithVirtGlusterEnabled" . equals ( propName ) ) { getView ( ) . allowClusterWithVirtGlusterEnabled ( model.getAllowClusterWithVirtGlusterEnabled ( ) ) ; } } } ) ; }

Target:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel model ) { super . init ( model ) ; model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "AllowClusterWithVirtGlusterEnabled" . equals ( propName ) ) { getView ( ) . allowClusterWithVirtGlusterEnabled ( model.getAllowClusterWithVirtGlusterEnabled ( ) ) ; } } } ) ; }
Source:
private void doTestBadAddNetworkAttachment ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpVerifyHostExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AddNetworkAttachment , org.ovirt.engine.core.common.action.NetworkAttachmentParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddNetworkAttachment ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpVerifyHostExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AddNetworkAttachment , org.ovirt.engine.core.common.action.NetworkAttachmentParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected org.ovirt.engine.ui.userportal.widget.action.UserPortalImageButtonDefinition < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > createButtonDefinition ( final org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel data ) { return new org.ovirt.engine.ui.userportal.widget.action.UserPortalImageButtonDefinition < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > ( constants.suspendVmLabel ( ) , applicationResources.pauseIcon ( ) , applicationResources.pauseDisabledIcon ( ) ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return data.getPauseCommand ( ) ; } } ; }

Target:
protected java.lang.String getTitle ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel value ) { return constants.suspendVmLabel ( ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesAncestors = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.compat.Guid id : org.ovirt.engine.core.bll.storage.disk.image.GetAncestorImagesByImagesIdsQuery.getParameters ( ) . getIds ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage ancestor = org.ovirt.engine.core.bll.storage.disk.image.GetAncestorImagesByImagesIdsQuery.getDbFacade ( ) . getDiskImageDao ( ) . getAncestor ( id , org.ovirt.engine.core.bll.storage.disk.image.GetAncestorImagesByImagesIdsQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.disk.image.GetAncestorImagesByImagesIdsQuery.getParameters ( ) . isFiltered ( ) ) ; imagesAncestors.put ( id , ancestor ) ; } org.ovirt.engine.core.bll.storage.disk.image.GetAncestorImagesByImagesIdsQuery.getQueryReturnValue ( ) . setReturnValue ( imagesAncestors ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesAncestors = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.compat.Guid id : org.ovirt.engine.core.bll.storage.disk.image.GetAncestorImagesByImagesIdsQuery.getParameters ( ) . getIds ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage ancestor = diskImageDao.getAncestor ( id , org.ovirt.engine.core.bll.storage.disk.image.GetAncestorImagesByImagesIdsQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.disk.image.GetAncestorImagesByImagesIdsQuery.getParameters ( ) . isFiltered ( ) ) ; imagesAncestors.put ( id , ancestor ) ; } org.ovirt.engine.core.bll.storage.disk.image.GetAncestorImagesByImagesIdsQuery.getQueryReturnValue ( ) . setReturnValue ( imagesAncestors ) ; }
Source:
public void testStoragePoolDoesntExist ( ) { final int domainSizeGB = 20 ; final int sizeRequired = 5 ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddVmTests ( domainSizeGB , sizeRequired ) ; org.mockito.Mockito.doReturn ( null ) . when ( cmd ) . getStoragePool ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST ) ; }

Target:
public void testBeanValidations ( ) { org.junit.Assert.assertTrue ( createCommand ( initializeMock ( 1 ) ) . validateInputs ( ) ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( ( p.getusage_cpu_percent ( ) ) + ( CalcSpmCpuConsumption ( p ) ) ) < highVdsCount ) && ( isEvenlyDistribute || ( ( p.getusage_cpu_percent ( ) ) > ( p.getlow_utilization ( ) ) ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( ( p.getUsageCpuPercent ( ) ) + ( CalcSpmCpuConsumption ( p ) ) ) < highVdsCount ) && ( isEvenlyDistribute || ( ( p.getUsageCpuPercent ( ) ) > ( p.getLowUtilization ( ) ) ) ) ; }
Source:
protected void setUpCreationExpectations ( ) { setUpCreationExpectations ( ActionType.AddVmTemplate , org.ovirt.engine.core.common.action.AddVmTemplateParameters.class , new java.lang.String [ ] { "Name" , "Description" } , new java.lang.Object [ ] { NAMES [ 0 ] , DESCRIPTIONS [ 0 ] } , true , true , GUIDS [ 0 ] , asList ( GUIDS [ 2 ] ) , org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.asList ( new org.ovirt.engine.core.common.businessentities.AsyncTaskStatus ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.finished ) ) , VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.getEntity ( 0 ) ) ; }

Target:
protected void setUpCreationExpectations ( ) { setUpCreationExpectations ( ActionType.AddVmTemplate , org.ovirt.engine.core.common.action.AddVmTemplateParameters.class , new java.lang.String [ ] { "Name" , "Description" } , new java.lang.Object [ ] { NAMES [ 0 ] , DESCRIPTIONS [ 0 ] } , true , true , GUIDS [ 0 ] , asList ( GUIDS [ 2 ] ) , org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.asList ( new org.ovirt.engine.core.common.businessentities.AsyncTaskStatus ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.finished ) ) , QueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.getEntity ( 0 ) ) ; }