auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > setupCanAddVmFromTemplateTests ( final int domainSizeGB , final int sizeRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > cmd = createVmFromTemplateCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }

Target:
public void validateSpaceNotWithinThreshold ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > command = setupCanAddVmTests ( 0 , 0 ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( command ) . createStorageDomainValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.junit.Assert.assertFalse ( command.validateSpaceRequirements ( ) ) ; }
Source:
public static < TResult > java.util.ArrayList < TResult > Cast ( java.lang.Iterable source ) { java.util.ArrayList < TResult > list = new java.util.ArrayList < TResult > ( ) ; for ( java.lang.Object a : source ) { TResult item = ( ( TResult ) ( a ) ) ; list.add ( item ) ; } return list ; }

Target:
public static < TResult > java.util.ArrayList < TResult > cast ( java.lang.Iterable source ) { java.util.ArrayList < TResult > list = new java.util.ArrayList < TResult > ( ) ; for ( java.lang.Object a : source ) { TResult item = ( ( TResult ) ( a ) ) ; list.add ( item ) ; } return list ; }
Source:
default void inputDetail ( ) { org.ovirt.api.metamodel.language.ApiLanguage.or ( org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( storageDomain ( ) . id ( ) ) , org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( storageDomain ( ) . name ( ) ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.or ( org.ovirt.api.metamodel.language.ApiLanguage.optional ( disk ( ) . name ( ) ) , org.ovirt.api.metamodel.language.ApiLanguage.optional ( disk ( ) . alias ( ) ) ) ; }

Target:
default void inputDetail ( ) { org.ovirt.api.metamodel.language.ApiLanguage.or ( org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( storageDomain ( ) . id ( ) ) , org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( storageDomain ( ) . name ( ) ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.or ( org.ovirt.api.metamodel.language.ApiLanguage.optional ( disk ( ) . name ( ) ) , org.ovirt.api.metamodel.language.ApiLanguage.optional ( disk ( ) . alias ( ) ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( diskProfile ( ) . id ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( quota ( ) . id ( ) ) ; }
Source:
private boolean deviceExists ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType generalType ) { return ! ( vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmTemplateId ( ) , generalType ) . isEmpty ( ) ) ; }

Target:
private void loadVmPayload ( org.ovirt.engine.core.common.action.AddVmParameters addVmParams ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmTemplateId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { if ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( vmDevice.getSpecParams ( ) ) ) { addVmParams.setVmPayload ( new org.ovirt.engine.core.common.businessentities.VmPayload ( vmDevice ) ) ; return ; } } }
Source:
public void testSave ( ) { dao.save ( new_permissions ) ; org.ovirt.engine.core.common.businessentities.Permissions result = dao.getForRoleAndAdElementAndObject ( new_permissions.getrole_id ( ) , new_permissions.getad_element_id ( ) , new_permissions.getObjectId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_permissions , result ) ; }

Target:
public void testSave ( ) { dao.save ( new_permissions ) ; org.ovirt.engine.core.common.businessentities.Permission result = dao.getForRoleAndAdElementAndObject ( new_permissions.getRoleId ( ) , new_permissions.getAdElementId ( ) , new_permissions.getObjectId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_permissions , result ) ; }
Source:
private void providers_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.Provider provider = getProviders ( ) . getSelectedItem ( ) ; setEnableSearchHost ( ( provider != null ) ) ; getExternalHostName ( ) . setItems ( null ) ; getExternalHostName ( ) . setIsChangable ( false ) ; }

Target:
private void hostName_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getExternalHostName ( ) . getSelectedItem ( ) ) ) ; if ( vds == null ) { vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; } updateModelFromVds ( vds , null , false , null ) ; getHost ( ) . setIsChangable ( false ) ; }
Source:
protected void lockVmSnapshotsWithWait ( org.ovirt.engine.core.common.businessentities.VM vm ) { snapshotsEngineLock = new org.ovirt.engine.core.utils.lock.EngineLock ( ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > snapshotsExlusiveLockMap = java.util.Collections.singletonMap ( vm.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_SNAPSHOTS , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; snapshotsEngineLock.setExclusiveLocks ( snapshotsExlusiveLockMap ) ; org.ovirt.engine.core.bll.BaseImagesCommand.getLockManager ( ) . acquireLockWait ( snapshotsEngineLock ) ; }

Target:
protected void lockVmSnapshotsWithWait ( org.ovirt.engine.core.common.businessentities.VM vm ) { snapshotsEngineLock = new org.ovirt.engine.core.utils.lock.EngineLock ( ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > snapshotsExlusiveLockMap = java.util.Collections.singletonMap ( vm.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_SNAPSHOTS , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; snapshotsEngineLock.setExclusiveLocks ( snapshotsExlusiveLockMap ) ; org.ovirt.engine.core.bll.BaseImagesCommand.getLockManager ( ) . acquireLockWait ( snapshotsEngineLock ) ; }
Source:
public void testGetEntityNameByIdAndTypeForDataCenter ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = storagePoolDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.STORAGE_POOL_ID ) ; org.junit.Assert.assertNotNull ( storagePool ) ; java.lang.String name = storagePool.getName ( ) ; org.junit.Assert.assertEquals ( name , underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.STORAGE_POOL_ID , VdcObjectType.StoragePool ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForDataCenter ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = storagePoolDao.get ( FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertNotNull ( storagePool ) ; java.lang.String name = storagePool.getName ( ) ; org.junit.Assert.assertEquals ( name , underTest.getEntityNameByIdAndType ( FixturesTool.DATA_CENTER , VdcObjectType.StoragePool ) ) ; }
Source:
public javax.ws.rs.core.Response end ( org.ovirt.engine.api.model.Action action ) { org.ovirt.engine.core.common.action.EndExternalJobParameters parameters = new org.ovirt.engine.core.common.action.EndExternalJobParameters ( guid , ( action.isSetSucceeded ( ) ? action.isSucceeded ( ) : true ) , ( action.isSetForce ( ) ? action.isForce ( ) : false ) ) ; return doAction ( VdcActionType.EndExternalJob , parameters , action ) ; }

Target:
public javax.ws.rs.core.Response end ( org.ovirt.engine.api.model.Action action ) { org.ovirt.engine.core.common.action.EndExternalJobParameters parameters = new org.ovirt.engine.core.common.action.EndExternalJobParameters ( guid , ( action.isSetSucceeded ( ) ? action.isSucceeded ( ) : true ) , ( action.isSetForce ( ) ? action.isForce ( ) : false ) ) ; return doAction ( ActionType.EndExternalJob , parameters , action ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid getNewMasterId ( ) { return ( getNewMaster ( ) ) == null ? org.ovirt.engine.core.compat.Guid.Empty : getNewMaster ( ) . getId ( ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getNewMasterStorageDomainId ( ) { if ( ( newMasterStorageDomainId ) == null ) { newMasterStorageDomain = electNewMaster ( true , org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.getParameters ( ) . isCanChooseInactiveDomainAsMaster ( ) , org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.getParameters ( ) . isCanChooseCurrentMasterAsNewMaster ( ) ) ; newMasterStorageDomainId = ( ( newMasterStorageDomain ) != null ) ? newMasterStorageDomain.getId ( ) : org.ovirt.engine.core.compat.Guid.Empty ; } return newMasterStorageDomainId ; }
Source:
protected void updateDiskQuotas ( java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { org.ovirt.engine.core.common.businessentities.Quota quota = getDiskQuotaMap ( ) . getEntity ( ) . get ( disk.getId ( ) ) ; if ( quota == null ) { quota = getStorageQuota ( ) . getSelectedItem ( ) ; } if ( quota != null ) { ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . setQuotaId ( quota.getId ( ) ) ; } } }

Target:
protected void updateDiskQuotas ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { org.ovirt.engine.core.common.businessentities.Quota quota = getDiskQuotaMap ( ) . getEntity ( ) . get ( disk.getId ( ) ) ; if ( quota == null ) { quota = getStorageQuota ( ) . getSelectedItem ( ) ; } if ( quota != null ) { ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) . setQuotaId ( quota.getId ( ) ) ; } } }
Source:
public void init ( ) { initState ( ) ; setReportBaseUrl ( org.ovirt.engine.ui.uicommonweb.ReportInit.buildUrl ( org.ovirt.engine.ui.uicommonweb.ReportInit.REDIRECT_SERVICE ) ) ; setReportRightClickUrl ( org.ovirt.engine.ui.uicommonweb.ReportInit.buildUrl ( org.ovirt.engine.ui.uicommonweb.ReportInit.RIGHT_CLICK_REDIRECT_SERVICE ) ) ; parseReportsXML ( ) ; }

Target:
public void init ( ) { initState ( ) ; setReportBaseUrl ( org.ovirt.engine.ui.uicommonweb.ReportInit.buildUrl ( org.ovirt.engine.ui.uicommonweb.ReportInit.REDIRECT_SERVICE , org.ovirt.engine.ui.uicommonweb.ReportsUrls.instance ( ) . getReportUrl ( ) ) ) ; setReportRightClickUrl ( org.ovirt.engine.ui.uicommonweb.ReportInit.buildUrl ( org.ovirt.engine.ui.uicommonweb.ReportInit.REDIRECT_SERVICE , org.ovirt.engine.ui.uicommonweb.ReportsUrls.instance ( ) . getRightClickUrl ( ) ) ) ; parseReportsXML ( ) ; }
Source:
org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( ) { java.util.Collection < java.lang.String > removedNetworks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment : removedNetworkAttachments ) { removedNetworks.add ( existingNetworkRelatedToAttachment ( removedAttachment ) . getName ( ) ) ; } final java.util.List < java.lang.String > vmsNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( host.getId ( ) , removedNetworks ) ; final java.util.List < java.lang.String > removedNetworksList = new java.util.ArrayList < > ( removedNetworks ) ; org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator detachNetworkUsedByVmValidator = new org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator ( vmsNames , removedNetworksList ) ; return detachNetworkUsedByVmValidator.validate ( ) ; }

Target:
org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( java.lang.String removedNetworkName ) { final java.util.List < java.lang.String > removedNetworkNames = java.util.Collections.singletonList ( removedNetworkName ) ; final java.util.List < java.lang.String > vmsNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( host.getId ( ) , removedNetworkNames ) ; org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator detachNetworkUsedByVmValidator = new org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator ( vmsNames , removedNetworkNames ) ; return detachNetworkUsedByVmValidator.validate ( ) ; }
Source:
void initTable ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VmTemplate > nameColumn = new org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VmTemplate object ) { return object.getname ( ) ; } } ; getTable ( ) . addColumn ( nameColumn , constants.nameTemplate ( ) ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VmTemplate > object ) { return object.getSecond ( ) . getvds_group_name ( ) ; }
Source:
public void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public void testListWithEveryonePermissions ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpGetEntityExpectations ( VdcQueryType.GetDbUserByUserId , org.ovirt.engine.core.common.queries.GetDbUserByUserIdParameters.class , new java.lang.String [ ] { "UserId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , getUserByIdx ( 1 ) ) ; setUpQueryExpectations ( "" , null , org.ovirt.engine.api.restapi.resource.EVERYONE ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }

Target:
public void testListWithEveryonePermissions ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpGetEntityExpectations ( VdcQueryType.GetDbUserByUserId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , getUserByIdx ( 1 ) ) ; setUpQueryExpectations ( "" , null , org.ovirt.engine.api.restapi.resource.EVERYONE ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }
Source:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.lang.Throwable caught ) { try { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleQueries: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; failureEventHandler ( caught ) ; callback.executed ( f ) ; } finally { org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , state ) ; raiseQueryCompleteEvent ( queryTypeList , state ) ; } }

Target:
public void onSuccess ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > resultObject ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from runMultipleQueries!" ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , resultObject ) ; callback.executed ( f ) ; fireAsyncOperationCompleteEvent ( state ) ; }
Source:
public static void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunAction: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null , state ) ; callback.executed ( f ) ; }

Target:
public void onFailure ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null , state ) ; if ( callback != null ) { callback.executed ( f ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { networkCreatingManager.updateVnics ( ( ( idToUpdate ) == null ? ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) : idToUpdate ) , unitVmModel.getNicsWithLogicalNetworks ( ) . getItems ( ) ) ; } else { networkCreatingManager.getCallback ( ) . queryFailed ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { networkCreatingManager.updateVnics ( ( ( idToUpdate ) == null ? ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) : idToUpdate ) , unitVmModel.getNicsWithLogicalNetworks ( ) . getItems ( ) , unitVmModel.getIsNew ( ) ) ; } else { networkCreatingManager.getCallback ( ) . queryFailed ( ) ; } }
Source:
public void testDisksUsagesWithNullEntry ( ) { java.lang.Object [ ] disksUsages = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.initDisksUsageData ( ) ; disksUsages [ 1 ] = null ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksUsageInXmlRpc ( disksUsages ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.validateDisksUsagesList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVmStatistics ( ) , disksUsages , xml ) ; }

Target:
public void testDisksUsagesWithNullEntry ( ) { java.lang.Object [ ] disksUsages = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.initDisksUsageData ( ) ; disksUsages [ 1 ] = null ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksUsage ( disksUsages ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.validateDisksUsagesList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVmStatistics ( ) , disksUsages , xml ) ; }
Source:
public void removeFunction ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { unusedFunctions.add ( policyUnit ) ; for ( int i = 0 ; i < ( usedFunctions.size ( ) ) ; i ++ ) { if ( usedFunctions.get ( i ) . getFirst ( ) . getId ( ) . equals ( policyUnit.getId ( ) ) ) { usedFunctions.remove ( i ) ; break ; } } refreshCustomProperties ( policyUnit , false ) ; getFunctionsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
public void removeFunction ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { unusedFunctions.add ( policyUnit ) ; for ( int i = 0 ; i < ( usedFunctions.size ( ) ) ; i ++ ) { if ( usedFunctions.get ( i ) . getFirst ( ) . getId ( ) . equals ( policyUnit.getId ( ) ) ) { usedFunctions.remove ( i ) ; break ; } } refreshCustomProperties ( policyUnit , false ) ; getFunctionsChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; }
Source:
public void addISCSIEmptyIqn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( newISCSIConnection ) ; parameters.setVdsId ( Guid.Empty ) ; parameters.setStoragePoolId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . InitializeVds ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void addISCSINonEmptyIqn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( newISCSIConnection ) ; parameters.setVdsId ( Guid.Empty ) ; parameters.setStoragePoolId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . initializeVds ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants , org.ovirt.engine.ui.webadmin.ApplicationDynamicMessages dynamicMessages ) { userNameEditor.setLabel ( constants.loginFormUserNameLabel ( ) ) ; passwordEditor.setLabel ( constants.loginFormPasswordLabel ( ) ) ; profileEditor.setLabel ( constants.loginFormProfileLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }

Target:
private void localize ( ) { userNameEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.login.view.LoginFormView.constants.loginFormUserNameLabel ( ) ) ; passwordEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.login.view.LoginFormView.constants.loginFormPasswordLabel ( ) ) ; profileEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.login.view.LoginFormView.constants.loginFormProfileLabel ( ) ) ; loginButton.setLabel ( org.ovirt.engine.ui.webadmin.section.login.view.LoginFormView.constants.loginButtonLabel ( ) ) ; }
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:
private org.ovirt.engine.core.common.migration.MigrationPolicy findMigrationPolicyById ( org.ovirt.engine.core.compat.Guid id , java.util.List < org.ovirt.engine.core.common.migration.MigrationPolicy > policies ) { for ( org.ovirt.engine.core.common.migration.MigrationPolicy policy : policies ) { if ( java.util.Objects.equals ( policy.getId ( ) , id ) ) { return policy ; } } return null ; }
Source:
protected org.ovirt.engine.api.model.VM populate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { java.util.Set < org.ovirt.engine.api.common.util.DetailHelper.Detail > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( getHttpHeaders ( ) ) ; parent.addInlineDetails ( details , model ) ; addStatistics ( model , entity , uriInfo , httpHeaders ) ; parent.setPayload ( model ) ; setBallooning ( model ) ; setCertificateInfo ( model ) ; return model ; }

Target:
public org.ovirt.engine.api.resource.VmReportedDevicesResource getVmReportedDevicesResource ( ) { return inject ( new org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResource ( guid ) ) ; }
Source:
private boolean validateImageConfig ( java.util.List < java.lang.String > canDoActionMessages , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > domainsMap , org.ovirt.engine.core.common.businessentities.DiskImage image ) { return org.ovirt.engine.core.bll.ImagesHandler.checkImageConfiguration ( domainsMap.get ( imageToDestinationDomainMap.get ( image.getId ( ) ) ) . getStorageStaticData ( ) , image , canDoActionMessages ) ; }

Target:
private boolean validateImageConfig ( java.util.List < java.lang.String > canDoActionMessages , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > domainsMap , org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { return org.ovirt.engine.core.bll.ImagesHandler.checkImageConfiguration ( domainsMap.get ( imageToDestinationDomainMap.get ( image.getId ( ) ) ) . getStorageStaticData ( ) , image , canDoActionMessages ) ; }
Source:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithClusterEntityModel dataCenterWithCluster = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithClusterEntityModel ) ( getDataCenterWithClustersList ( ) . getSelectedItem ( ) ) ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMaximalVmMemSize ( ) ; }

Target:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( getDataCenterWithClustersList ( ) . getSelectedItem ( ) ) ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMaximalVmMemSize ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Quota > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; model.getQuota ( ) . setItems ( quotas ) ; model.getQuota ( ) . setIsEmpty ( quotas.isEmpty ( ) ) ; model.updateControlsAvailability ( ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.filterClustersWithoutArchitecture ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ) ; model.getCluster ( ) . setItems ( clusters ) ; model.getCluster ( ) . setIsEmpty ( clusters.isEmpty ( ) ) ; model.updateControlsAvailability ( ) ; stopProgress ( ) ; }
Source:
protected boolean updateVnicForBackwardCompatibility ( ) { org.ovirt.engine.core.bll.network.VmInterfaceManager nicManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; if ( ! ( validate ( nicManager.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCurrentUser ( ) . getUserId ( ) ) ) ) ) { return false ; } return true ; }

Target:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCurrentUser ( ) . getUserId ( ) ) ) ) ) { return false ; } return true ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , getEntity ( 0 ) ) ; setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , true , true ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private void cacheConfigValues ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { getDefaultConfigurationVersion ( ) ; aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( returnValue != null ) { cachedConfigValuesPreConvert.putAll ( ( ( java.util.HashMap < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > , java.lang.Object > ) ( returnValue ) ) ) ; } return cachedConfigValuesPreConvert ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConfigurationValues , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public java.util.ArrayList < java.util.Map.Entry < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > > getBondingOptionList ( org.ovirt.engine.core.compat.RefObject < java.util.Map.Entry < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > > defaultItem ) { return getBondingOptionListDependingOnNetwork ( defaultItem , false ) ; }
Source:
private void updateActionAvailability ( ) { java.util.ArrayList items = ( ( ( java.util.ArrayList ) ( getSelectedItems ( ) ) ) != null ) ? ( ( java.util.ArrayList ) ( getSelectedItems ( ) ) ) : new java.util.ArrayList ( ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( items.size ( ) ) > 0 ) && ( org.ovirt.engine.core.common.VdcActionUtils.CanExecute ( items , org.ovirt.engine.core.common.businessentities.DbUser.class , VdcActionType.RemoveUser ) ) ) ) ; getAssignTagsCommand ( ) . setIsExecutionAllowed ( ( ( items.size ( ) ) > 0 ) ) ; }

Target:
private void updateActionAvailability ( ) { java.util.ArrayList items = ( ( ( java.util.ArrayList ) ( getSelectedItems ( ) ) ) != null ) ? ( ( java.util.ArrayList ) ( getSelectedItems ( ) ) ) : new java.util.ArrayList ( ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( items.size ( ) ) > 0 ) && ( org.ovirt.engine.core.common.VdcActionUtils.canExecute ( items , org.ovirt.engine.core.common.businessentities.DbUser.class , VdcActionType.RemoveUser ) ) ) ) ; getAssignTagsCommand ( ) . setIsExecutionAllowed ( ( ( items.size ( ) ) > 0 ) ) ; }
Source:
private void asyncResult_Retrieved ( ) { if ( ( getItems ( ) ) != null ) { java.util.Iterator enumerator = getItems ( ) . iterator ( ) ; setIsEmpty ( ( enumerator.hasNext ( ) ? false : true ) ) ; } else { setIsEmpty ( true ) ; } }

Target:
private void asyncResult_Retrieved ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.getItems ( ) ) != null ) { java.util.Iterator enumerator = org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.getItems ( ) . iterator ( ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.setIsEmpty ( ( enumerator.hasNext ( ) ? false : true ) ) ; } else { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.setIsEmpty ( true ) ; } }
Source:
public org.ovirt.engine.ui.webadmin.section.main.presenter.DynamicUrlContentTabProxy create ( com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.RequestTabsHandler > requestTabsEventType , com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.ChangeTabHandler > changeTabEventType , com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.proxy.RevealContentHandler < ? > > slot , java.lang.String label , java.lang.String historyToken , boolean isMainTab , java.lang.String contentUrl , org.ovirt.engine.ui.common.widget.Align align ) { return new org.ovirt.engine.ui.webadmin.section.main.presenter.DynamicUrlContentTabProxy ( placeManager , eventBus , gatekeeper , requestTabsEventType , changeTabEventType , slot , viewProvider , label , java.lang.Float.MAX_VALUE , historyToken , isMainTab , contentUrl , align ) ; }

Target:
public org.ovirt.engine.ui.webadmin.section.main.presenter.DynamicUrlContentTabProxy create ( com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.RequestTabsHandler > requestTabsEventType , com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.ChangeTabHandler > changeTabEventType , com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.proxy.RevealContentHandler < ? > > slot , java.lang.String label , float priority , java.lang.String historyToken , boolean isMainTab , java.lang.String contentUrl , org.ovirt.engine.ui.common.widget.Align align ) { return new org.ovirt.engine.ui.webadmin.section.main.presenter.DynamicUrlContentTabProxy ( placeManager , eventBus , gatekeeper , requestTabsEventType , changeTabEventType , slot , viewProvider , label , priority , historyToken , isMainTab , contentUrl , align ) ; }
Source:
private boolean vmDeviceChanged ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType deviceType , java.lang.String device , boolean deviceEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.UpdateVmCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmId ( ) , deviceType , device ) ; return deviceEnabled == ( vmDevices.isEmpty ( ) ) ; }

Target:
private void addAddtionalParams ( org.ovirt.engine.core.common.action.VmNumaNodeOperationParameters params ) { params.setDedicatedHost ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVds ( ) ) ; params.setNumaTuneMode ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumaTuneMode ( ) ) ; params.setMigrationSupport ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) . getMigrationSupport ( ) ) ; }
Source:
public void testStoragePoolIsNotUp ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_IMAGE_REPOSITORY_NOT_FOUND ) ) . when ( storagePoolValidator ) . isUp ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_IMAGE_REPOSITORY_NOT_FOUND.name ( ) ) ) ; }

Target:
public void testStoragePoolIsNotUp ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_IMAGE_REPOSITORY_NOT_FOUND ) ) . when ( storagePoolValidator ) . existsAndUp ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_IMAGE_REPOSITORY_NOT_FOUND.name ( ) ) ) ; }
Source:
protected boolean performImagesChecks ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getStoragePoolId ( ) , true , false , false , true , org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getImagesList ( ) , true , false ) ) ; }

Target:
protected boolean performImagesChecks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskImagesToCheck = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getImagesList ( ) , true , false ) ; org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( diskImagesToCheck ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) && ( org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getStoragePoolId ( ) , false , false , true , diskImagesToCheck ) ) ; }
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 boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.ui.uicompat.Event ) ) { return false ; } org.ovirt.engine.ui.uicompat.Event < ? > other = ( ( org.ovirt.engine.ui.uicompat.Event < ? > ) ( obj ) ) ; return ( java.util.Objects.equals ( privateName , other.privateName ) ) && ( java.util.Objects.equals ( privateOwnerType , other.privateOwnerType ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.Erratum getErratumForHost ( java.lang.String hostName , java.lang.String erratumId ) { org.ovirt.engine.core.bll.host.provider.foreman.ContentHost contentHost = findContentHost ( hostName ) ; if ( contentHost == null ) { return null ; } return runErratumMethod ( java.lang.String.format ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy.CONTENT_HOST_ERRATUM_ENTRY_POINT , contentHost.getId ( ) , erratumId ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.Erratum getErratumForHost ( java.lang.String hostName , java.lang.String erratumId ) { org.ovirt.engine.core.bll.host.provider.foreman.ContentHost contentHost = findContentHost ( hostName ) ; if ( contentHost == null ) { log.error ( "Failed to find host on provider '{}' by host name '{}' " , getProvider ( ) . getName ( ) , hostName ) ; return null ; } return runErratumMethod ( java.lang.String.format ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy.CONTENT_HOST_ERRATUM_ENTRY_POINT , contentHost.getUuid ( ) , erratumId ) ) ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.ENTITY , Schema.Entities.GROUP ) . mput ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.GroupIdentifiers.NAME , args.get ( "group" ) ) . mput ( Schema.SharedKeys.REMOVE_GROUP , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { if ( ! ( context.containsKey ( ContextKeys.EXIT_STATUS ) ) ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , context.get ( ContextKeys.POSITIONAL ) ) . mput ( Schema.UserKeys.UNLOCK_TIME , java.lang.System.currentTimeMillis ( ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }
Source:
static org.ovirt.engine.api.model.CpuTune stringToCpuTune ( java.lang.String cpuPinning ) { if ( ( cpuPinning == null ) || ( cpuPinning.equals ( "" ) ) ) { return null ; } final org.ovirt.engine.api.model.CpuTune cpuTune = new org.ovirt.engine.api.model.CpuTune ( ) ; for ( java.lang.String strCpu : cpuPinning.split ( "_" ) ) { org.ovirt.engine.api.model.VCpuPin pin = org.ovirt.engine.api.restapi.types.VmMapper.stringToVCpupin ( strCpu ) ; cpuTune.getVCpuPin ( ) . add ( pin ) ; } return cpuTune ; }

Target:
static org.ovirt.engine.api.model.CpuTune stringToCpuTune ( java.lang.String cpuPinning ) { if ( ( cpuPinning == null ) || ( cpuPinning.equals ( "" ) ) ) { return null ; } final org.ovirt.engine.api.model.CpuTune cpuTune = new org.ovirt.engine.api.model.CpuTune ( ) ; for ( java.lang.String strCpu : cpuPinning.split ( "_" ) ) { org.ovirt.engine.api.model.VcpuPin pin = org.ovirt.engine.api.restapi.types.VmMapper.stringToVCpupin ( strCpu ) ; cpuTune.getVcpuPin ( ) . add ( pin ) ; } return cpuTune ; }
Source:
public void testResolveUnknownVariable ( ) { final java.lang.String message = "This is my ${Variable}" ; final java.lang.String expectedResolved = java.lang.String.format ( "This is my %1s" , AuditLogDirector.UNKNOWN_VARIABLE_VALUE ) ; java.util.Map < java.lang.String , java.lang.String > values = java.util.Collections.emptyMap ( ) ; java.lang.String resolvedMessage = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resolveMessage ( message , values ) ; org.junit.Assert.assertEquals ( expectedResolved , resolvedMessage ) ; }

Target:
public void testResolveUnknownVariable ( ) { final java.lang.String message = "This is my ${Variable}" ; final java.lang.String expectedResolved = java.lang.String.format ( "This is my %1s" , AuditLogDirector.UNKNOWN_VARIABLE_VALUE ) ; java.util.Map < java.lang.String , java.lang.String > values = java.util.Collections.emptyMap ( ) ; java.lang.String resolvedMessage = auditLogDirector.resolveMessage ( message , values ) ; org.junit.Assert.assertEquals ( expectedResolved , resolvedMessage ) ; }
Source:
private boolean isBond ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { return java.lang.Boolean.TRUE.equals ( iface.getBonded ( ) ) ; }

Target:
private boolean qosShouldBeApplied ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = getNetworkAttachment ( iface , network ) ; org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = effectiveHostNetworkQos.getQos ( networkAttachment , network ) ; return ( qos != null ) && ( ! ( qos.isEmpty ( ) ) ) ; }