auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetStorageDomainByIdAndStoragePoolId , org.ovirt.engine.core.common.queries.StorageDomainAndPoolQueryParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , ( notFound ? null : getEntity ( 0 ) ) ) ; }

Target:
private void setUpGetDomainExpectations ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , boolean succeed ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetStorageDomainByIdAndStoragePoolId , org.ovirt.engine.core.common.queries.StorageDomainAndPoolQueryParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , ( succeed ? setUpDomainExpectations ( storageType ) : null ) ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentsByHostIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentsByHostIdQuery.getDbFacade ( ) . getNetworkAttachmentDao ( ) . getAllForHost ( org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentsByHostIdQuery.getParameters ( ) . getId ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentsByHostIdQuery.getParameters ( ) . getId ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = networkAttachmentDao.getAllForHost ( hostId ) ; reportedConfigurationsFiller.fillReportedConfigurations ( networkAttachments , hostId ) ; org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentsByHostIdQuery.getQueryReturnValue ( ) . setReturnValue ( networkAttachments ) ; }
Source:
private void SetSearchStringPage ( int newSearchPageNumber ) { if ( org.ovirt.engine.core.compat.Regex.IsMatch ( getSearchString ( ) , org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.PAGE_STRING_REGEX , RegexOptions.IgnoreCase ) ) { setSearchString ( org.ovirt.engine.core.compat.Regex.replace ( getSearchString ( ) , org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.PAGE_STRING_REGEX , org.ovirt.engine.core.compat.StringFormat.format ( " page %1$s" , newSearchPageNumber ) ) ) ; } else { setSearchString ( org.ovirt.engine.core.compat.StringFormat.format ( "%1$s page %2$s" , getSearchString ( ) , newSearchPageNumber ) ) ; } }

Target:
private void SetSearchStringPage ( int newSearchPageNumber ) { if ( org.ovirt.engine.core.compat.Regex.IsMatch ( getSearchString ( ) , org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.PAGE_STRING_REGEX , RegexOptions.IgnoreCase ) ) { setSearchString ( org.ovirt.engine.core.compat.Regex.replace ( getSearchString ( ) , org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.PAGE_STRING_REGEX , ( " page " + newSearchPageNumber ) ) ) ; } else { setSearchString ( ( ( ( getSearchString ( ) ) + " page " ) + newSearchPageNumber ) ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.job.Job > getJobsByOffsetAndPageSize ( int offset , int pageSize ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "position" , offset ) . addValue ( "page_size" , pageSize ) ; return getCallsHandler ( ) . executeReadList ( "GetJobsByOffsetAndPageSize" , createEntityRowMapper ( ) , parameterSource ) ; }

Target:
public void updateJobLastUpdateTime ( org.ovirt.engine.core.compat.Guid jobId , java.util.Date lastUpdateTime ) { org.ovirt.engine.core.common.job.Job job = get ( jobId ) ; job.setLastUpdateTime ( lastUpdateTime ) ; update ( job ) ; }
Source:
public void testGetAllForCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network_cluster > result = dao.getAllForCluster ( cluster.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network_cluster thiscluster : result ) { org.junit.Assert.assertEquals ( cluster.getId ( ) , thiscluster.getcluster_id ( ) ) ; } }

Target:
public void testGetAllForCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.NetworkCluster > result = dao.getAllForCluster ( cluster.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.NetworkCluster thiscluster : result ) { org.junit.Assert.assertEquals ( cluster.getId ( ) , thiscluster.getcluster_id ( ) ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Quota > getAllRelevantQuotasForStorage ( org.ovirt.engine.core.compat.Guid storageId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource ( ) ; quotaParameterSource.addValue ( "storage_id" , storageId ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = getCallsHandler ( ) . executeReadList ( "getAllThinQuotasByStorageId" , getQuotaMetaDataFromResultSet ( ) , quotaParameterSource ) ; return quotas ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Quota > getAllRelevantQuotasForStorage ( org.ovirt.engine.core.compat.Guid storageId , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource ( ) ; quotaParameterSource.addValue ( "storage_id" , storageId ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = getCallsHandler ( ) . executeReadList ( "getAllThinQuotasByStorageId" , getQuotaMetaDataFromResultSet ( ) , quotaParameterSource ) ; return quotas ; }
Source:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( source != null ) && ( ! ( ( java.lang.Boolean ) ( source ) ) ) ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator validator = new org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator ( getNetworkCluster ( ) ) ; return ( ( ( vdsGroupExists ( ) ) && ( changesAreClusterCompatible ( ) ) ) && ( logicalNetworkExists ( ) ) ) && ( ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isManagementNetwork ( getNetwork ( ) ) ) ) || ( validate ( validator.managementNetworkAttachment ( getNetworkName ( ) ) ) ) ) ; }

Target:
private boolean validateAttachment ( ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator validator = new org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator ( getNetworkCluster ( ) , org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ; return ( ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isManagementNetwork ( getNetwork ( ) ) ) ) || ( validate ( validator.managementNetworkAttachment ( getNetworkName ( ) ) ) ) ) && ( validate ( validator.migrationPropertySupported ( getNetworkName ( ) ) ) ) ; }
Source:
public synchronized void _timer_Elapsed ( ) { if ( thereAreTasksToPoll ( ) ) { pollAndUpdateAsyncTasks ( ) ; if ( ( thereAreTasksToPoll ( ) ) && ( logChangedMap ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.infoFormat ( "Finished polling Tasks, will poll again in {0} seconds." , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AsyncTaskPollingRate ) ) ; logChangedMap = false ; } if ( ( _tasks.size ( ) ) > 0 ) { cleanZombieTasks ( ) ; } } }

Target:
public synchronized void _timer_Elapsed ( ) { if ( thereAreTasksToPoll ( ) ) { pollAndUpdateAsyncTasks ( ) ; if ( ( thereAreTasksToPoll ( ) ) && ( logChangedMap ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.info ( "Finished polling Tasks, will poll again in seconds." , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AsyncTaskPollingRate ) ) ; logChangedMap = false ; } if ( ( _tasks.size ( ) ) > 0 ) { cleanZombieTasks ( ) ; } } }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpGetEntityExpectationsOnDoPopulate ( false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateProvider , org.ovirt.engine.core.common.action.ProviderParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyModel ( resource.update ( getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpGetEntityExpectationsOnDoPopulate ( false ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateProvider , org.ovirt.engine.core.common.action.ProviderParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyModel ( resource.update ( getModel ( 0 ) ) , 0 ) ; }
Source:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { java.lang.String ovf = getOvf ( ) ; if ( ovf == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = readVmFromOvf ( ovf ) ; if ( vm == null ) { return ; } addImportedDevices ( vm.getStaticData ( ) ) ; deleteV2VJob ( ) ; }

Target:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( true ) ; getCommand ( ) . endAction ( ) ; clearProgress ( ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; validateEnums ( org.ovirt.engine.api.model.Network.class , network ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getActionParameters ( network , entity ) ; return performCreation ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; validateEnums ( org.ovirt.engine.api.model.Network.class , network ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getActionParameters ( network , entity ) ; return performCreate ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }
Source:
public void testInterfaceIsBondWhenInterfaceIsNotBonded ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createVdsNetworkInterfaceWithName ( ) ; iface.setBonded ( false ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( iface ) . interfaceIsBondOrNull ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NETWORK_INTERFACE_IS_NOT_BOND ) ) ; }

Target:
public void testInterfaceIsBondWhenInterfaceIsNotBonded ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createVdsNetworkInterfaceWithName ( ) ; iface.setBonded ( false ) ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_NETWORK_INTERFACE_IS_NOT_BOND_ENTITY , iface.getName ( ) ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( iface ) . interfaceIsBondOrNull ( ) , matcher ) ; }
Source:
public void AttachTask ( org.ovirt.engine.core.bll.EntityAsyncTask asyncTask ) { synchronized ( _listTasks ) { if ( ! ( _listTasks.containsKey ( asyncTask.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks.log.infoFormat ( "EntityMultiAsyncTasks::AttachTask: Attaching task '{0}' to entity '{1}'." , asyncTask.getVdsmTaskId ( ) , getContainerId ( ) ) ; _listTasks.put ( asyncTask.getVdsmTaskId ( ) , asyncTask ) ; } } }

Target:
public boolean ShouldEndAction ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.EntityAsyncTask > CurrentActionTypeTasks = getCurrentTasks ( ) ; for ( org.ovirt.engine.core.bll.EntityAsyncTask task : CurrentActionTypeTasks ) { if ( ( task.getState ( ) ) != ( AsyncTaskState.Ended ) ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks.log.infoFormat ( "Task ID: '{0}' is in state {1}. End action for command {2} will proceed when all the entity's tasks are completed." , task.getVdsmTaskId ( ) , task.getState ( ) , getCommandId ( ) ) ; return false ; } } } return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.Cluster getCluster ( boolean glusterEnabled ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( clusterId ) ; cluster.setVirtService ( false ) ; cluster.setGlusterService ( glusterEnabled ) ; cluster.setCompatibilityVersion ( Version.v3_1 ) ; return cluster ; }

Target:
private org.ovirt.engine.core.common.businessentities.Cluster getCluster ( boolean glusterEnabled , org.ovirt.engine.core.compat.Version clusterVersion ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommandTest.clusterId ) ; cluster.setCompatibilityVersion ( clusterVersion ) ; cluster.setVirtService ( false ) ; cluster.setGlusterService ( glusterEnabled ) ; return cluster ; }
Source:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String templateName , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( templateName ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , params , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }
Source:
protected void initContainerDetails ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase parameters ) { }

Target:
public void setUp ( ) { org.mockito.Mockito.when ( iconDefaultsProvider.getVmIconDefaults ( ) ) . thenReturn ( new java.util.HashMap < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > ( ) { { put ( 0 , new org.ovirt.engine.core.common.queries.VmIconIdSizePair ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "00000000-0000-0000-0000-00000000000a" ) , org.ovirt.engine.core.compat.Guid.createGuidFromString ( "00000000-0000-0000-0000-00000000000b" ) ) ) ; } } ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.utils.ovf.OvfVmIconDefaultsProvider.class , iconDefaultsProvider ) ; injectorRule.bind ( org.ovirt.engine.core.dao.ClusterDao.class , clusterDao ) ; }
Source:
public void testHostTagLinks ( ) { org.ovirt.engine.api.model.Tag tag = new org.ovirt.engine.api.model.Tag ( ) ; tag.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.TAG_ID ) ; tag.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; tag.getHost ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.HOST_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( tag ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.HOST_TAG_HREF , tag.getHref ( ) ) ; }

Target:
public void testHostTagLinks ( ) { org.ovirt.engine.api.model.Tag tag = new org.ovirt.engine.api.model.Tag ( ) ; tag.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.TAG_ID ) ; tag.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; tag.getHost ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.HOST_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( tag ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.HOST_TAG_HREF , tag.getHref ( ) ) ; }
Source:
public void onKeyPress ( com.google.gwt.dom.client.NativeEvent event ) { if ( ( hasFocus ) && ( ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) == ( event.getKeyCode ( ) ) ) ) { model.setSearchString ( org.ovirt.engine.ui.common.presenter.popup.permissions.AbstractPermissionsPopupPresenterWidget.PermissionPopupNativeKeyPressHandler.getView ( ) . getSearchString ( ) . getValue ( ) ) ; org.ovirt.engine.ui.common.presenter.popup.permissions.AbstractPermissionsPopupPresenterWidget.PermissionPopupNativeKeyPressHandler.getView ( ) . getSearchButton ( ) . getCommand ( ) . Execute ( ) ; } else { decorated.onKeyPress ( event ) ; } }

Target:
public void onKeyPress ( com.google.gwt.dom.client.NativeEvent event ) { if ( ( hasFocus ) && ( ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) == ( event.getKeyCode ( ) ) ) ) { model.setSearchString ( org.ovirt.engine.ui.common.presenter.popup.permissions.AbstractPermissionsPopupPresenterWidget.PermissionPopupNativeKeyPressHandler.getView ( ) . getSearchString ( ) . getValue ( ) ) ; org.ovirt.engine.ui.common.presenter.popup.permissions.AbstractPermissionsPopupPresenterWidget.PermissionPopupNativeKeyPressHandler.getView ( ) . getSearchButton ( ) . getCommand ( ) . execute ( ) ; } else { decorated.onKeyPress ( event ) ; } }
Source:
public < T > java.util.Map < java.lang.String , java.lang.Object > executeReadAndReturnMap ( final java.lang.String procedureName , final org.springframework.jdbc.core.RowMapper < T > mapper , final org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource ) { java.util.Map < java.lang.String , java.lang.Object > resultsMap = executeImpl ( procedureName , parameterSource , createCallForRead ( procedureName , mapper , parameterSource ) ) ; return resultsMap ; }

Target:
public < T > java.util.List < T > executeReadList ( final java.lang.String procedureName , final org.springframework.jdbc.core.RowMapper < T > mapper , final org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource ) { java.util.Map < java.lang.String , java.lang.Object > resultsMap = executeImpl ( procedureName , parameterSource , createCallForRead ( procedureName , mapper , parameterSource ) ) ; return ( ( java.util.List < T > ) ( resultsMap.get ( BaseDAODbFacade.RETURN_VALUE_PARAMETER ) ) ) ; }
Source:
public void testGetAllForHostname ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllForHostname ( existingVds.getHostName ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( existingVds.getHostName ( ) , vds.getHostName ( ) ) ; } }

Target:
public void testGetAllForHostname ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllForHostname ( existingVds.getHostName ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.jupiter.api.Assertions.assertEquals ( existingVds.getHostName ( ) , vds.getHostName ( ) ) ; } }
Source:
protected boolean validateVmProperties ( org.ovirt.engine.core.common.businessentities.VM vm , java.lang.String runOnceCustomProperties , java.util.List < java.lang.String > messages ) { java.lang.String customProperties = ( runOnceCustomProperties != null ) ? runOnceCustomProperties : vm.getCustomProperties ( ) ; return getVmPropertiesUtils ( ) . validateVmProperties ( vm.getVdsGroupCompatibilityVersion ( ) , customProperties , messages ) ; }

Target:
protected boolean validateVmProperties ( org.ovirt.engine.core.common.businessentities.VM vm , java.lang.String runOnceCustomProperties , java.util.List < java.lang.String > messages ) { java.lang.String customProperties = ( runOnceCustomProperties != null ) ? runOnceCustomProperties : vm.getCustomProperties ( ) ; return getVmPropertiesUtils ( ) . validateVmProperties ( vm.getCompatibilityVersion ( ) , customProperties , messages ) ; }
Source:
public void setUnlimited ( ) { percentageBarA.setStyleName ( style.percentageBarUnlimited ( ) ) ; percentageLabelA.setStyleName ( style.percentageLabel ( ) ) ; percentageLabelA.setText ( "Unlimited" ) ; percentageLabelA.setTitle ( "Unlimited" ) ; percentageBarB.setVisible ( false ) ; }

Target:
public void setUnlimited ( ) { percentageBarA.setStyleName ( style.percentageBarUnlimited ( ) ) ; percentageLabelA.setStyleName ( style.percentageLabel ( ) ) ; percentageLabelA.setText ( org.ovirt.engine.ui.userportal.widget.QuotaProgressBar.constants.unlimitedQuota ( ) ) ; percentageLabelA.setTitle ( org.ovirt.engine.ui.userportal.widget.QuotaProgressBar.constants.unlimitedQuota ( ) ) ; percentageBarB.setVisible ( false ) ; }
Source:
public boolean isValid ( java.lang.String mask , javax.validation.ConstraintValidatorContext context ) { if ( ( mask == null ) || ( mask.isEmpty ( ) ) ) { return true ; } boolean maskFormatValidation = isMaskFormatValid ( mask ) ; org.ovirt.engine.core.common.validation.ValidatorConstraint.ValidatorConstraintArgsFormatValue args = new org.ovirt.engine.core.common.validation.ValidatorConstraint.ValidatorConstraintArgsFormatValue ( maskFormatValidation , ( maskFormatValidation ? isMaskValid ( mask ) : false ) , VdcBllMessages.UPDATE_NETWORK_ADDR_IN_SUBNET_BAD_FORMAT.name ( ) , VdcBllMessages.UPDATE_NETWORK_ADDR_IN_SUBNET_BAD_VALUE.name ( ) ) ; return org.ovirt.engine.core.common.validation.ValidatorConstraint.getInstance ( ) . isValid ( args , context , "mask" ) ; }

Target:
public boolean isValid ( java.lang.String mask , javax.validation.ConstraintValidatorContext context ) { if ( ( mask == null ) || ( mask.isEmpty ( ) ) ) { return true ; } boolean maskFormatValidation = isMaskFormatValid ( mask ) ; org.ovirt.engine.core.common.validation.ValidatorConstraint.ValidatorConstraintArgsFormatValue args = new org.ovirt.engine.core.common.validation.ValidatorConstraint.ValidatorConstraintArgsFormatValue ( maskFormatValidation , ( maskFormatValidation ? isMaskValid ( mask ) : false ) , EngineMessage.UPDATE_NETWORK_ADDR_IN_SUBNET_BAD_FORMAT.name ( ) , EngineMessage.UPDATE_NETWORK_ADDR_IN_SUBNET_BAD_VALUE.name ( ) ) ; return org.ovirt.engine.core.common.validation.ValidatorConstraint.getInstance ( ) . isValid ( args , context , "mask" ) ; }
Source:
public boolean isNetworkExclusivenessPermissiveValidation ( java.lang.String version ) { return ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.NetworkExclusivenessPermissiveValidation , version ) ) ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { 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.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
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.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( privateName ) == null ? 0 : privateName.hashCode ( ) ) ; result = ( prime * result ) + ( ( privateOwnerType ) == null ? 0 : privateOwnerType.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( privateName , privateOwnerType ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setEnumTitle ( object.getVmEntityType ( ) ) ; if ( ( object.getVmEntityType ( ) ) == null ) { setTitle ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.constants.unattachedDisk ( ) ) ; return null ; } return object.getVmEntityType ( ) . isVmType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.vmsImage ( ) : object.getVmEntityType ( ) . isTemplateType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.templatesImage ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( ( object.getVmEntityType ( ) ) == null ) { return null ; } return object.getVmEntityType ( ) . isVmType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.vmsImage ( ) : object.getVmEntityType ( ) . isTemplateType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.templatesImage ( ) : null ; }
Source:
static java.lang.String detail ( java.lang.Throwable t ) { java.lang.String detail = null ; if ( org.ovirt.engine.api.restapi.resource.BaseBackendResource.LOG.isDebugEnabled ( ) ) { java.io.StringWriter sw = new java.io.StringWriter ( ) ; t.printStackTrace ( new java.io.PrintWriter ( sw , true ) ) ; detail = sw.toString ( ) ; } else { detail = t.getMessage ( ) ; } return detail ; }

Target:
static java.lang.String detail ( java.lang.Throwable t ) { java.lang.String detail = null ; if ( org.ovirt.engine.api.restapi.resource.BaseBackendResource.log.isDebugEnabled ( ) ) { java.io.StringWriter sw = new java.io.StringWriter ( ) ; t.printStackTrace ( new java.io.PrintWriter ( sw , true ) ) ; detail = sw.toString ( ) ; } else { detail = t.getMessage ( ) ; } return detail ; }
Source:
public static 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 ) ; }

Target:
public static void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateManagementParameters.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public java.lang.String asString ( ) { return generatePreviewSentence ( ) ; }

Target:
private void addSyncDiff ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel ) { addRow ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.templates.imageTextSetupNetwork ( notInSyncImage , org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.constants.hostOutOfSync ( ) ) ) ; com.google.gwt.safehtml.shared.SafeHtml safeHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.constants.hostOutOfSyncPreviewSentence ( ) ) ; addRow ( safeHtml ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration > panelParameters = filterSyncProperties ( networkModel ) ; com.google.gwt.user.client.ui.Widget networkOutOfSyncPanel = new org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkOutOfSyncPanel ( panelParameters ) . outOfSyncTableAsWidget ( ) ; contents.insertRow ( contents.getRowCount ( ) ) ; contents.setWidget ( contents.getRowCount ( ) , 0 , networkOutOfSyncPanel ) ; }
Source:
public void testRemoveAllBeforeDate ( ) throws java.lang.Exception { java.util.Date cutoff = org.ovirt.engine.core.dao.AuditLogDAOTest.EXPECTED_DATE_FORMAT.parse ( "2010-12-20 13:11:00" ) ; dao.removeAllBeforeDate ( cutoff ) ; java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertEquals ( 3 , result.size ( ) ) ; }

Target:
public void testRemoveAllBeforeDate ( ) throws java.lang.Exception { java.util.Date cutoff = EXPECTED_DATE_FORMAT.parse ( "2010-12-20 13:11:00" ) ; dao.removeAllBeforeDate ( cutoff ) ; java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertEquals ( 3 , result.size ( ) ) ; }
Source:
protected void init ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) != null ) { needsHostDevices = hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) ; } }

Target:
protected void init ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) != null ) { needsHostDevices = hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) ; } fetchVmDisksFromDb ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) ; org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . setUseCinderCommandCallback ( ( ! ( cinderDisks.isEmpty ( ) ) ) ) ; }
Source:
public void isClusterEmpty ( 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.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void StartPollingTask ( ) { org.ovirt.engine.core.bll.AsyncTaskState state = getState ( ) ; if ( ( ( state != ( AsyncTaskState.AttemptingEndAction ) ) && ( state != ( AsyncTaskState.Cleared ) ) ) && ( state != ( AsyncTaskState.ClearFailed ) ) ) { org.ovirt.engine.core.bll.SPMAsyncTask.log.infoFormat ( "BaseAsyncTask::StartPollingTask: Starting to poll task '{0}'." , getVdsmTaskId ( ) ) ; ConcreteStartPollingTask ( ) ; } }

Target:
public void StartPollingTask ( ) { org.ovirt.engine.core.bll.AsyncTaskState state = getState ( ) ; if ( ( ( state != ( AsyncTaskState.AttemptingEndAction ) ) && ( state != ( AsyncTaskState.Cleared ) ) ) && ( state != ( AsyncTaskState.ClearFailed ) ) ) { org.ovirt.engine.core.bll.SPMAsyncTask.log.infoFormat ( "BaseAsyncTask::startPollingTask: Starting to poll task '{0}'." , getVdsmTaskId ( ) ) ; ConcreteStartPollingTask ( ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > getVmDeviceByVmIdAndType ( org.ovirt.engine.core.compat.Guid vmId , java.lang.String type ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , vmId ) . addValue ( "type" , type ) ; return getCallsHandler ( ) . executeReadList ( "GetVmDeviceByVmIdAndType" , createEntityRowMapper ( ) , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > getVmDeviceByVmIdAndType ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , vmId ) . addValue ( "type" , type.getValue ( ) ) ; return getCallsHandler ( ) . executeReadList ( "GetVmDeviceByVmIdAndType" , createEntityRowMapper ( ) , parameterSource ) ; }
Source:
public static void mockAsyncDataProvider ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider adp = org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.setup.getMocks ( ) . asyncDataProvider ( ) ; org.mockito.Mockito.when ( adp.getConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.mockito.Mockito.when ( adp.osNameExists ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.OS_TYPE ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( adp.getMaxVmNameLengthWin ( ) ) . thenReturn ( 15 ) ; }

Target:
public static void mockAsyncDataProvider ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.adp = org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.setup.getMocks ( ) . asyncDataProvider ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.adp.getConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.mockito.Mockito.when ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.adp.osNameExists ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.OS_TYPE ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.adp.getMaxVmNameLengthWin ( ) ) . thenReturn ( 15 ) ; org.mockito.Mockito.when ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.adp.getOsDefaultIconId ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.OS_TYPE , false ) ) . thenReturn ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.LARGE_OS_DEFAULT_ICON_ID ) ; }
Source:
public void refreshVmStats ( ) { org.ovirt.engine.core.vdsbroker.VmsMonitoring.log.debug ( "refresh VMs list entered" ) ; if ( fetchRunningVms ( ) ) { refreshCommitedMemory ( ) ; java.util.List < org.ovirt.engine.core.compat.Guid > staleRunningVms = checkVmsStatusChanged ( ) ; proceedWatchdogEvents ( ) ; proceedBalloonCheck ( ) ; proceedDownVms ( ) ; proceedGuaranteedMemoryCheck ( ) ; processExternallyManagedVms ( ) ; updateRepository ( staleRunningVms ) ; if ( ! ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isOldClusterVersion ( vds.getVdsGroupCompatibilityVersion ( ) ) ) ) { handleVmDeviceChange ( ) ; } prepareGuestAgentNetworkDevicesForUpdate ( ) ; updateLunDisks ( ) ; } }

Target:
public void refreshVmStats ( ) { org.ovirt.engine.core.vdsbroker.VmsMonitoring.log.debug ( "refresh VMs list entered" ) ; refreshExistingVmJobList ( ) ; if ( fetchRunningVms ( ) ) { refreshCommitedMemory ( ) ; java.util.List < org.ovirt.engine.core.compat.Guid > staleRunningVms = checkVmsStatusChanged ( ) ; proceedWatchdogEvents ( ) ; proceedBalloonCheck ( ) ; proceedDownVms ( ) ; proceedGuaranteedMemoryCheck ( ) ; processExternallyManagedVms ( ) ; updateRepository ( staleRunningVms ) ; if ( ! ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isOldClusterVersion ( vds.getVdsGroupCompatibilityVersion ( ) ) ) ) { handleVmDeviceChange ( ) ; } prepareGuestAgentNetworkDevicesForUpdate ( ) ; updateLunDisks ( ) ; updateVmJobs ( ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( HostGeneralModel.RequestEditEventDefinition ) ) { getEditWithPMemphasisCommand ( ) . execute ( ) ; } if ( ev.matchesDefinition ( HostGeneralModel.RequestGOToEventsTabEventDefinition ) ) { goToEventsTab ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( HostGeneralModel.requestEditEventDefinition ) ) { getEditWithPMemphasisCommand ( ) . execute ( ) ; } if ( ev.matchesDefinition ( HostGeneralModel.requestGOToEventsTabEventDefinition ) ) { goToEventsTab ( ) ; } }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { return object.getRemoteNetworkName ( ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { java.util.ArrayList < java.lang.String > networkList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView network : importModel.getNetworkProfiles ( ) ) { networkList.add ( network.getName ( ) ) ; } ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( networkList ) ; return networkList.isEmpty ( ) ? "" : networkList.get ( 0 ) ; }
Source:
protected boolean canDoAction ( ) { boolean retVal = true ; if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) == null ) { retVal = false ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } else { retVal = ( super . canDoAction ( ) ) && ( canRemoveVm ( ) ) ; setDescription ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmName ( ) ) ; } return retVal ; }

Target:
protected boolean canDoAction ( ) { boolean retVal = true ; if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) == null ) { retVal = false ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } else if ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . isDeleteProtected ( ) ) { retVal = false ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DELETE_PROTECTION_ENABLED ) ; } else { retVal = ( super . canDoAction ( ) ) && ( canRemoveVm ( ) ) ; setDescription ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmName ( ) ) ; } return retVal ; }
Source:
private void doProcessRequest ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String sessionID = request.getParameter ( SESSION_ID_PARAMETER ) ; if ( runQuery ( response , sessionID ) ) { response.setStatus ( SUCCESS_CODE ) ; org.ovirt.engine.core.services.GetSessionUser.log.debug ( "Validate Session '{}' succeeded" , sessionID ) ; } else { response.setStatus ( FAILED_CODE ) ; org.ovirt.engine.core.services.GetSessionUser.log.debug ( "Validate Session '{}' failed" , sessionID ) ; } }

Target:
private void doProcessRequest ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String sessionID = request.getParameter ( org.ovirt.engine.core.services.GetSessionUser.SESSION_ID_PARAMETER ) ; if ( runQuery ( response , sessionID ) ) { response.setStatus ( org.ovirt.engine.core.services.GetSessionUser.SUCCESS_CODE ) ; org.ovirt.engine.core.services.GetSessionUser.log.debug ( "Validate Session '{}' succeeded" , sessionID ) ; } else { response.setStatus ( org.ovirt.engine.core.services.GetSessionUser.FAILED_CODE ) ; org.ovirt.engine.core.services.GetSessionUser.log.debug ( "Validate Session '{}' failed" , sessionID ) ; } }