auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static < T > java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > > toEntityModelList ( java.util.ArrayList < T > list ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > > entityModelList = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > > ( ) ; if ( list != null ) { for ( T item : list ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > model = new org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > ( ) ; model.setEntity ( item ) ; entityModelList.add ( model ) ; } } return entityModelList ; }

Target:
public static < T > java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > > toEntityModelList ( java.util.ArrayList < T > list ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > > entityModelList = new java.util.ArrayList < > ( ) ; if ( list != null ) { for ( T item : list ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > model = new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( ) ; model.setEntity ( item ) ; entityModelList.add ( model ) ; } } return entityModelList ; }
Source:
protected void ItemsChanged ( ) { super . ItemsChanged ( ) ; if ( ( getSelectionNodeList ( ) . isEmpty ( ) ) && ( ( getAttachedTagsToEntities ( ) ) != null ) ) { AttachedTagsToEntitiesChanged ( ) ; } }

Target:
protected void ItemsChanged ( ) { super . ItemsChanged ( ) ; if ( ( ( ( getSelectionNodeList ( ) ) != null ) && ( getSelectionNodeList ( ) . isEmpty ( ) ) ) && ( ( getAttachedTagsToEntities ( ) ) != null ) ) { AttachedTagsToEntitiesChanged ( ) ; } }
Source:
protected boolean detachStorage ( org.ovirt.engine.core.common.businessentities.storage_domains dom ) { org.ovirt.engine.core.compat.Guid domId = dom.getId ( ) ; org.ovirt.engine.core.compat.Guid poolId = dom.getstorage_pool_id ( ) . getValue ( ) ; org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters params = new org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters ( domId , poolId ) ; params.setDestroyingPool ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getParameters ( ) . getDestroyingPool ( ) ) ; return org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getBackend ( ) . runInternalAction ( VdcActionType.DetachStorageDomainFromPool , params ) . getSucceeded ( ) ; }

Target:
protected boolean detachStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain dom ) { org.ovirt.engine.core.compat.Guid domId = dom.getId ( ) ; org.ovirt.engine.core.compat.Guid poolId = dom.getstorage_pool_id ( ) . getValue ( ) ; org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters params = new org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters ( domId , poolId ) ; params.setDestroyingPool ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getParameters ( ) . getDestroyingPool ( ) ) ; return org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getBackend ( ) . runInternalAction ( VdcActionType.DetachStorageDomainFromPool , params ) . getSucceeded ( ) ; }
Source:
public static void getWANColorDepth ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? org.ovirt.engine.ui.uicommonweb.models.vms.WanColorDepth.fromInt ( ( ( java.lang.Integer ) ( source ) ) . intValue ( ) ) : org.ovirt.engine.ui.uicommonweb.models.vms.WanColorDepth.depth16 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.WANColorDepth , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getWANColorDepth ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? org.ovirt.engine.ui.uicommonweb.models.vms.WanColorDepth.fromInt ( ( ( java.lang.Integer ) ( source ) ) . intValue ( ) ) : org.ovirt.engine.ui.uicommonweb.models.vms.WanColorDepth.depth16 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.WANColorDepth , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > FindAllInterfaceBondNameIsEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface i : items ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getBondName ( ) ) ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > FindAllInterfaceBondNameIsEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getBondName ( ) ) ) { ret.add ( i ) ; } } return ret ; }
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getGlusterBricksForServer ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > glusterBricks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ) ( returnValue ) ) ; java.util.Collections.sort ( glusterBricks , new org.ovirt.engine.ui.uicommonweb.Linq.ServerBricksComparer ( ) ) ; setItems ( glusterBricks ) ; } } ) , getEntity ( ) . getId ( ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterBricksForServer ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > glusterBricks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ) ( returnValue ) ) ; java.util.Collections.sort ( glusterBricks , new org.ovirt.engine.ui.uicommonweb.Linq.ServerBricksComparer ( ) ) ; setItems ( glusterBricks ) ; } } ) , getEntity ( ) . getId ( ) ) ; }
Source:
protected void openDocumentation ( T model ) { java.lang.String helpTag = model.getHelpTag ( ) . name ; java.lang.String docPath = org.ovirt.engine.ui.common.uicommon.ContextSensitiveHelpManager.getPath ( helpTag ) ; java.lang.String docBase = model.getConfigurator ( ) . getDocsBaseUrl ( ) ; org.ovirt.engine.ui.common.utils.WebUtils.openUrlInNewWindow ( "_blank" , ( docBase + docPath ) , WebUtils.OPTION_SCROLLBARS ) ; }

Target:
protected void openDocumentation ( T model ) { java.lang.String helpTag = model.getHelpTag ( ) . name ( ) ; java.lang.String docPath = org.ovirt.engine.ui.common.uicommon.ContextSensitiveHelpManager.getPath ( helpTag ) ; java.lang.String docBase = model.getConfigurator ( ) . getDocsBaseUrl ( ) ; org.ovirt.engine.ui.common.utils.WebUtils.openUrlInNewWindow ( "_blank" , ( docBase + docPath ) , WebUtils.OPTION_SCROLLBARS ) ; }
Source:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , bond.getName ( ) ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }

Target:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , bond.getName ( ) ) ) ; doTestValidModifiedBonds ( bond , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) && ( ! ( validateUnregisteredEntity ( vmFromConfiguration , ovfEntityData ) ) ) ) { return false ; } setImagesWithStoragePoolId ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getStorageDomain ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getImages ( ) ) ; return super . canDoAction ( ) ; }

Target:
protected boolean canDoAction ( ) { if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { if ( ! ( validateUnregisteredEntity ( vmFromConfiguration , ovfEntityData ) ) ) { return false ; } setImagesWithStoragePoolId ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getStorageDomain ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getImages ( ) ) ; } return super . canDoAction ( ) ; }
Source:
private java.lang.String GetValue ( java.lang.Object obj ) { if ( obj instanceof org.ovirt.engine.core.common.businessentities.VM ) { return ( ( org.ovirt.engine.core.common.businessentities.VM ) ( obj ) ) . getVmName ( ) ; } if ( obj instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { return ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( obj ) ) . getVmPoolName ( ) ; } throw new org.ovirt.engine.core.compat.NotImplementedException ( ) ; }

Target:
private java.lang.String GetValue ( java.lang.Object obj ) { if ( obj instanceof org.ovirt.engine.core.common.businessentities.VM ) { return ( ( org.ovirt.engine.core.common.businessentities.VM ) ( obj ) ) . getVmName ( ) ; } if ( obj instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { return ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( obj ) ) . getName ( ) ; } throw new org.ovirt.engine.core.compat.NotImplementedException ( ) ; }
Source:
protected void updateWipeAfterDelete ( org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( storageType.isFileDomain ( ) ) { getIsWipeAfterDelete ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.CONSTANTS.wipeAfterDeleteNotSupportedForFileDomains ( ) ) ; getIsWipeAfterDelete ( ) . setIsChangable ( false ) ; getIsWipeAfterDelete ( ) . setEntity ( false ) ; } else { getIsWipeAfterDelete ( ) . setIsChangable ( true ) ; getIsWipeAfterDelete ( ) . setEntity ( ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.SANWipeAfterDelete ) ) ) ) ; } }

Target:
protected void updateWipeAfterDelete ( org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( storageType.isFileDomain ( ) ) { getIsWipeAfterDelete ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.CONSTANTS.wipeAfterDeleteNotSupportedForFileDomains ( ) ) ; getIsWipeAfterDelete ( ) . setIsChangable ( false ) ; getIsWipeAfterDelete ( ) . setEntity ( false ) ; } else { getIsWipeAfterDelete ( ) . setIsChangable ( true ) ; getIsWipeAfterDelete ( ) . setEntity ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.SANWipeAfterDelete ) ) ; } }
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.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
private void initVncKeyboardLayout ( ) { final java.util.List < java.lang.String > layouts = ( ( java.util.List < java.lang.String > ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) ) ; final java.util.ArrayList < java.lang.String > vncKeyboardLayoutItems = new java.util.ArrayList < java.lang.String > ( ) ; vncKeyboardLayoutItems.add ( null ) ; vncKeyboardLayoutItems.addAll ( layouts ) ; getVncKeyboardLayout ( ) . setItems ( vncKeyboardLayoutItems ) ; getVncKeyboardLayout ( ) . setIsAvailable ( isVncSelected ( ) ) ; }

Target:
private void initVncKeyboardLayout ( ) { final java.util.List < java.lang.String > layouts = ( ( java.util.List < java.lang.String > ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) ) ; final java.util.ArrayList < java.lang.String > vncKeyboardLayoutItems = new java.util.ArrayList < java.lang.String > ( ) ; vncKeyboardLayoutItems.add ( null ) ; vncKeyboardLayoutItems.addAll ( layouts ) ; getVncKeyboardLayout ( ) . setItems ( vncKeyboardLayoutItems ) ; getVncKeyboardLayout ( ) . setIsAvailable ( isVncSelected ( ) ) ; }
Source:
public static void Init ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool > allPools = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool pool : allPools ) { if ( ( pool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational ) ) { org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.PoolStatusChanged ( pool.getId ( ) , StoragePoolStatus.NotOperational ) ; } } }

Target:
public static void Init ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > allPools = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool pool : allPools ) { if ( ( pool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational ) ) { org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.PoolStatusChanged ( pool.getId ( ) , StoragePoolStatus.NotOperational ) ; } } }
Source:
public void testAddExistingBlockDomainSuccessfully ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.domain.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) . when ( command ) . getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getSucceeded ( ) ) ; }

Target:
public void testAddExistingBlockDomainSuccessfully ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.domain.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) . when ( command ) . getLUNsFromVgInfo ( ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getSucceeded ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Quota > getAllRelevantQuotasForStorage ( org.ovirt.engine.core.compat.Guid storageId , long engineSessionSeqId , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource ( ) ; quotaParameterSource.addValue ( "storage_id" , storageId ) . addValue ( "engine_session_seq_id" , engineSessionSeqId ) . addValue ( "is_filtered" , isFiltered ) ; 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 , long engineSessionSeqId , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource ( ) ; quotaParameterSource.addValue ( "storage_id" , storageId ) . addValue ( "engine_session_seq_id" , engineSessionSeqId ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "getAllThinQuotasByStorageId" , getQuotaMetaDataFromResultSet ( ) , quotaParameterSource ) ; }
Source:
private java.util.List < java.lang.String > getVdsIps ( org.ovirt.engine.core.common.businessentities.VDS vds ) { java.util.List < java.lang.String > vdsIps = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : getInterfaceDao ( ) . getAllInterfacesForVds ( vds.getId ( ) ) ) { if ( ( iface.getAddress ( ) ) != null ) { vdsIps.add ( iface.getAddress ( ) ) ; } } return vdsIps ; }

Target:
private java.util.List < java.lang.String > getVdsIps ( org.ovirt.engine.core.common.businessentities.VDS vds ) { java.util.List < java.lang.String > vdsIps = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : getInterfaceDao ( ) . getAllInterfacesForVds ( vds.getId ( ) ) ) { if ( ( iface.getAddress ( ) ) != null ) { vdsIps.add ( iface.getAddress ( ) ) ; } } return vdsIps ; }
Source:
private void clusterHasGlusterVolumes ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > ( ) ; volumes.add ( new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ) ; org.powermock.api.mockito.PowerMockito.when ( glusterVolumeDao.getByClusterId ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( volumes ) ; }

Target:
private void clusterHasGlusterVolumes ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > ( ) ; volumes.add ( new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ) ; org.mockito.Mockito.when ( glusterVolumeDao.getByClusterId ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( volumes ) ; }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.bll.validator.HostValidator hostValidator = new org.ovirt.engine.core.bll.validator.HostValidator ( getVds ( ) ) ; return ( ( validate ( hostValidator.hostExists ( ) ) ) && ( validate ( hostValidator.isUp ( ) ) ) ) && ( validate ( validateMinimumVersionSupport ( ) ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.validator.HostValidator hostValidator = new org.ovirt.engine.core.bll.validator.HostValidator ( getVds ( ) ) ; return ( validate ( hostValidator.hostExists ( ) ) ) && ( validate ( hostValidator.isUp ( ) ) ) ; }
Source:
public void execute ( ) { final org.ovirt.engine.ui.common.widget.panel.AlertPanel alert = createAlert ( type , message ) ; attachAlert ( alert ) ; if ( autoHideMs > 0 ) { final com.google.gwt.user.client.Timer timer = new com.google.gwt.user.client.Timer ( ) { @ java.lang.Override public void run ( ) { detachAlert ( alert ) ; } } ; alert.getWidget ( ) . addCloseHandler ( new org.gwtbootstrap3.client.shared.event.AlertCloseHandler ( ) { @ java.lang.Override public void onClose ( org.gwtbootstrap3.client.shared.event.AlertCloseEvent evt ) { timer.cancel ( ) ; } } ) ; timer.schedule ( autoHideMs ) ; } }

Target:
public void onClose ( org.gwtbootstrap3.client.shared.event.AlertCloseEvent evt ) { alert = null ; }
Source:
public void testQueryWithFilter ( ) throws java.lang.Exception { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < > ( ) ; filterValue.add ( "true" ) ; org.easymock.EasyMock.reset ( httpHeaders ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.USER_FILTER_HEADER ) ) . andReturn ( filterValue ) ; resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; resource.get ( ) ; }

Target:
public void testQueryWithFilter ( ) throws java.lang.Exception { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < > ( ) ; filterValue.add ( "true" ) ; org.mockito.Mockito.reset ( httpHeaders ) ; org.mockito.Mockito.when ( httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.USER_FILTER_HEADER ) ) . thenReturn ( filterValue ) ; resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; resource.get ( ) ; }
Source:
public void addPortMirroringToVmInterface ( java.util.Map < java.lang.String , java.lang.Object > struct , org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile , org.ovirt.engine.core.common.businessentities.network.Network network ) { if ( ( vnicProfile != null ) && ( vnicProfile.isPortMirroring ( ) ) ) { struct.put ( VdsProperties.PORT_MIRRORING , ( network == null ? java.util.Collections.< java.lang.String > emptyList ( ) : java.util.Collections.singletonList ( network.getName ( ) ) ) ) ; } }

Target:
private void addPortMirroringToVmInterface ( java.util.Map < java.lang.String , java.lang.Object > struct , org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile , org.ovirt.engine.core.common.businessentities.network.Network network ) { if ( ( vnicProfile != null ) && ( vnicProfile.isPortMirroring ( ) ) ) { struct.put ( VdsProperties.PORT_MIRRORING , ( network == null ? java.util.Collections.< java.lang.String > emptyList ( ) : java.util.Collections.singletonList ( network.getName ( ) ) ) ) ; } }
Source:
private void updateArbiterAvailability ( ) { getArbiterVolume ( ) . setIsAvailable ( ( ( getTypeList ( ) . getSelectedItem ( ) . isReplicatedType ( ) ) && ( ( Version.v4_1.compareTo ( getCluster ( ) . getSelectedItem ( ) . getCompatibilityVersion ( ) ) ) >= 0 ) ) ) ; }

Target:
private void updateArbiterAvailability ( ) { getArbiterVolume ( ) . setIsAvailable ( ( ( ( getTypeList ( ) . getSelectedItem ( ) . isReplicatedType ( ) ) && ( ( getCluster ( ) . getSelectedItem ( ) ) != null ) ) && ( ( Version.v4_1.compareTo ( getCluster ( ) . getSelectedItem ( ) . getCompatibilityVersion ( ) ) ) >= 0 ) ) ) ; }
Source:
public static java.lang.String mapToJsonUnchecked ( java.util.Map < java.lang.String , java.lang.Object > input ) { try { return org.ovirt.engine.core.utils.JsonHelper.mapToJson ( input ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( java.lang.String.format ( "Object \"%s\" cannot be serialized to JSON." , input ) , e ) ; } }

Target:
public static java.lang.String mapToJsonUnchecked ( java.util.Map < java.lang.String , java.lang.Object > input ) { if ( input == null ) { return null ; } try { return org.ovirt.engine.core.utils.JsonHelper.mapToJson ( input ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( java.lang.String.format ( "Object \"%s\" cannot be serialized to JSON." , input ) , e ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String fingerprint = ( ( java.lang.String ) ( result ) ) ; if ( ( fingerprint != null ) && ( ( fingerprint.length ( ) ) > 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( ( ( java.lang.String ) ( result ) ) ) ; setIsFingerprintVerified ( true ) ; } else { getGlusterHostFingerprint ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . errorLoadingFingerprint ( ) ) ; setIsFingerprintVerified ( false ) ; } }

Target:
public void onSuccess ( java.lang.String fingerprint ) { if ( ( fingerprint != null ) && ( ( fingerprint.length ( ) ) > 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( fingerprint ) ; setIsFingerprintVerified ( true ) ; } else { getGlusterHostFingerprint ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . errorLoadingFingerprint ( ) ) ; setIsFingerprintVerified ( false ) ; } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; org.ovirt.engine.core.compat.Guid Guid = ( ( org.ovirt.engine.core.compat.Guid ) ( returnValueBase.getActionReturnValue ( ) ) ) ; behavior.PostTakeVm ( Guid ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { return ; } org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; org.ovirt.engine.core.compat.Guid Guid = ( ( org.ovirt.engine.core.compat.Guid ) ( returnValueBase.getActionReturnValue ( ) ) ) ; behavior.PostTakeVm ( Guid ) ; }
Source:
public void testGetEntityNameByIdAndTypeForNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = networkDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.NETWORK_ID ) ; org.junit.Assert.assertNotNull ( network ) ; java.lang.String name = network.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.NETWORK_ID , VdcObjectType.Network ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = networkDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.NETWORK_ID ) ; org.junit.Assert.assertNotNull ( network ) ; java.lang.String name = network.getName ( ) ; org.junit.Assert.assertEquals ( name , underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.NETWORK_ID , VdcObjectType.Network ) ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingStorageConnection ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.STORAGE_CONNECTION_ID.toString ( ) } , getEntity ( 0 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.StorageConnection model = resource.get ( ) ; assertEquals ( GUIDS [ 0 ] . toString ( ) , model.getId ( ) ) ; verifyLinks ( model ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingStorageConnection ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.STORAGE_CONNECTION_ID.toString ( ) } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.StorageConnection model = resource.get ( ) ; assertEquals ( GUIDS [ 0 ] . toString ( ) , model.getId ( ) ) ; verifyLinks ( model ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > consoleDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < java.lang.String > consoleDevices = returnValue.getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ! ( org.ovirt.engine.core.common.gluster.GlusterFeatureSupported.glusterSnapshot ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) { failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ! ( org.ovirt.engine.core.common.gluster.GlusterFeatureSupported.glusterSnapshot ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED ) ; } return true ; }
Source:
public void executeCommandWhenFailed ( ) { setUpMocksForUpdate ( ) ; mockBackend ( false , EngineError.GlusterHookUpdateFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_UPDATE_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWhenFailed ( ) { setUpMocksForUpdate ( ) ; mockBackend ( false , EngineError.GlusterHookUpdateFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_UPDATE_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void testGetEntityNameByIdAndTypeForQuota ( ) { org.ovirt.engine.core.common.businessentities.Quota quota = quotaDao.getById ( org.ovirt.engine.core.dao.EntityDaoImplTest.QUOTA_ID ) ; org.junit.Assert.assertNotNull ( quota ) ; java.lang.String name = quota.getQuotaName ( ) ; org.junit.Assert.assertTrue ( name.equals ( underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.QUOTA_ID , VdcObjectType.Quota ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForQuota ( ) { org.ovirt.engine.core.common.businessentities.Quota quota = quotaDao.getById ( org.ovirt.engine.core.dao.EntityDaoImplTest.QUOTA_ID ) ; org.junit.Assert.assertNotNull ( quota ) ; java.lang.String name = quota.getQuotaName ( ) ; org.junit.Assert.assertEquals ( name , underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.QUOTA_ID , VdcObjectType.Quota ) ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "CREATIONDATE" ) ) { return TimeConditionRelationAutoCompleter.INSTANCE ; } else if ( ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "CHILDCOUNT" ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "MEM" ) ) ) { return NumericConditionRelationAutoCompleter.INSTANCE ; } else { return StringConditionRelationAutoCompleter.INSTANCE ; } }

Target:
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 ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.Cluster createClusterWithOlderVersion ( boolean supportsVirtService , boolean supportsGlusterService ) { org.ovirt.engine.core.common.businessentities.Cluster group = org.ovirt.engine.core.bll.UpdateClusterCommandTest.createNewCluster ( ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_0 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DC_ID1 ) ; group.setVirtService ( supportsVirtService ) ; group.setGlusterService ( supportsGlusterService ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.Cluster createClusterWithOlderVersion ( ) { org.ovirt.engine.core.common.businessentities.Cluster group = org.ovirt.engine.core.bll.UpdateClusterCommandTest.createNewCluster ( ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_0 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DC_ID1 ) ; group.setVirtService ( true ) ; group.setGlusterService ( false ) ; return group ; }
Source:
public void testImport ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster ) ; }

Target:
public void testImport ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , false , false ) ; }
Source:
public void customPropertiesNotSupported ( ) { 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.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void customPropertiesNotSupported ( ) { 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.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_NOT_SUPPORTED , network.getName ( ) ) ; }
Source:
protected boolean checkStoragePoolStatusNotEqual ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus status , org.ovirt.engine.core.common.errors.VdcBllMessages onFailMessage ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ; if ( storagePool != null ) { returnValue = ( storagePool.getStatus ( ) ) != status ; if ( ( ! returnValue ) && ( ! ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( onFailMessage.name ( ) ) ) ) ) { addCanDoActionMessage ( onFailMessage ) ; } } return returnValue ; }

Target:
protected boolean checkStoragePoolStatusNotEqual ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus status , org.ovirt.engine.core.common.errors.EngineMessage onFailMessage ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ; if ( storagePool != null ) { returnValue = ( storagePool.getStatus ( ) ) != status ; if ( ( ! returnValue ) && ( ! ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( onFailMessage.name ( ) ) ) ) ) { addCanDoActionMessage ( onFailMessage ) ; } } return returnValue ; }
Source:
private void updatePriority ( ) { if ( ( cachedMaxPriority ) == null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { cachedMaxPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; postUpdatePriority ( ) ; } } , model.getHash ( ) ) ) ; } else { postUpdatePriority ( ) ; } }

Target:
private void updatePriority ( ) { if ( ( cachedMaxPriority ) == null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( model , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { cachedMaxPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; postUpdatePriority ( ) ; } } ) ) ; } else { postUpdatePriority ( ) ; } }
Source:
public boolean matches ( java.lang.Object argument ) { if ( ! ( argument instanceof java.util.ArrayList ) ) { return false ; } @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ids = ( ( java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ) ( argument ) ) ; return ( ( ids != null ) && ( ( ids.size ( ) ) == ( removedBrickIds.size ( ) ) ) ) && ( removedBrickIds.containsAll ( ids ) ) ; }

Target:
public boolean matches ( java.lang.Object argument ) { if ( ! ( argument instanceof java.util.ArrayList ) ) { return false ; } @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ids = ( ( java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ) ( argument ) ) ; return ( ( ids.size ( ) ) == ( removedBrickIds.size ( ) ) ) && ( removedBrickIds.containsAll ( ids ) ) ; }
Source:
public void canRunVmFailVmRunning ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; org.mockito.Mockito.doReturn ( false ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }

Target:
public void canRunVmFailVmRunning ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }
Source:
private void populateVdsAndVmsList ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = vmDao.getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { if ( ( ! ( vm.isNotRunning ( ) ) ) && ( ( vm.getRunOnVds ( ) ) != null ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( vm.getRunOnVds ( ) , vm.getId ( ) , vdsAndVmsList , new org.ovirt.engine.core.utils.collections.MultiValueMapUtils.HashSetCreator < org.ovirt.engine.core.compat.Guid > ( ) ) ; } } }

Target:
private void populateVdsAndVmsList ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = vmDao.getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { if ( ( ! ( vm.isNotRunning ( ) ) ) && ( ( vm.getRunOnVds ( ) ) != null ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( vm.getRunOnVds ( ) , vm.getId ( ) , vdsAndVmsList , new org.ovirt.engine.core.utils.collections.MultiValueMapUtils.HashSetCreator < > ( ) ) ; } } }
Source:
public boolean matches ( java.lang.Object actual ) { boolean ret = false ; if ( actual instanceof org.ovirt.engine.core.common.queries.SearchParameters ) { org.ovirt.engine.core.common.queries.SearchParameters other = ( ( org.ovirt.engine.core.common.queries.SearchParameters ) ( actual ) ) ; ret = ( expected.getSearchPattern ( ) . equals ( other.getSearchPattern ( ) ) ) && ( expected.getSearchTypeValue ( ) . equals ( other.getSearchTypeValue ( ) ) ) ; } return ret ; }

Target:
public boolean matches ( org.ovirt.engine.core.common.queries.SearchParameters actual ) { return ( expected.getSearchPattern ( ) . equals ( actual.getSearchPattern ( ) ) ) && ( expected.getSearchTypeValue ( ) . equals ( actual.getSearchTypeValue ( ) ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResourceTest.TEMPLATE_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResourceTest.TEMPLATE_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , setUpClusters ( ) , null ) ; control.replay ( ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , setUpClusters ( ) , null ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
public javax.ws.rs.core.Response remove ( org.ovirt.engine.api.model.Action action ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setid ( id ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( ( action != null ) && ( action.isSetHost ( ) ) ) { hostId = getHostId ( action.getHost ( ) ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }

Target:
public javax.ws.rs.core.Response remove ( org.ovirt.engine.api.model.Action action ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( id ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( ( action != null ) && ( action.isSetHost ( ) ) ) { hostId = getHostId ( action.getHost ( ) ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }