auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void reportNonOperationReason ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , java.lang.String compatibleVersions , java.lang.String vdsSupportedVersions ) { java.util.Map < java.lang.String , java.lang.String > customLogValues = new java.util.HashMap < > ( ) ; customLogValues.put ( "CompatibilityVersion" , compatibleVersions ) ; customLogValues.put ( "VdsSupportedVersions" , vdsSupportedVersions ) ; org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVdsId ( ) , reason , customLogValues ) ; runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getContext ( ) ) ) ; }

Target:
private void reportNonOperationReason ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVdsId ( ) , reason , customLogValues ) ; runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getContext ( ) ) ) ; }
Source:
public void testPositiveValidateWithNoDisks ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . isEmpty ( ) ) ; }

Target:
public void testPositiveValidateWithNoDisks ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . isEmpty ( ) ) ; }
Source:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vmTemplate.setId ( new org.ovirt.engine.core.compat.Guid ( section.Attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { if ( node.InnerText.equals ( java.lang.String.valueOf ( OsRepository.OLD_OTHER_ID ) ) ) { node.InnerText = java.lang.String.valueOf ( OsRepository.DEFAULT_OS ) ; } _vmTemplate.setOsId ( osRepository.getOsIdByUniqueName ( node.InnerText ) ) ; } }

Target:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vmTemplate.setId ( new org.ovirt.engine.core.compat.Guid ( section.Attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { _vmTemplate.setOsId ( osRepository.getOsIdByUniqueName ( node.InnerText ) ) ; } }
Source:
public void testErrorHandling ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setSucceeded ( false ) ; value.setExceptionObject ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( "unknown host" ) ) ; org.mockito.Mockito.when ( updater.getResourceManager ( ) ) . thenReturn ( resourceManager ) ; org.mockito.Mockito.when ( updater.getVdsEventListener ( ) ) . thenReturn ( vdsEventlistener ) ; org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSCommandType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( value ) ; updater.refreshVdsStats ( ) ; }

Target:
public void testErrorHandling ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setSucceeded ( false ) ; value.setExceptionObject ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( "unknown host" ) ) ; org.mockito.Mockito.when ( updater.getVdsEventListener ( ) ) . thenReturn ( vdsEventlistener ) ; org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSCommandType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( value ) ; updater.refreshVdsStats ( ) ; }
Source:
private static boolean isCompatible ( java.lang.Class < ? > [ ] expected , java.lang.Class < ? > [ ] actual ) { if ( ( expected.length ) != ( actual.length ) ) { return false ; } for ( int i = 0 ; i < ( expected.length ) ; i ++ ) { if ( ! ( actual [ i ] . isAssignableFrom ( expected [ i ] ) ) ) { return false ; } } return true ; }

Target:
public static boolean isCompatible ( java.lang.Class < ? > [ ] expected , java.lang.Class < ? > [ ] actual ) { if ( ( expected.length ) != ( actual.length ) ) { return false ; } for ( int i = 0 ; i < ( expected.length ) ; i ++ ) { if ( ! ( actual [ i ] . isAssignableFrom ( expected [ i ] ) ) ) { return false ; } } return true ; }
Source:
protected void onSaveMAC ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nicToSave ) { nicToSave.setMacAddress ( ( getMAC ( ) . getIsChangable ( ) ? ( getMAC ( ) . getEntity ( ) ) == null ? null : ( ( java.lang.String ) ( getMAC ( ) . getEntity ( ) ) ) . toLowerCase ( ) : getDefaultMacAddress ( ) ) ) ; }

Target:
protected void onSaveMAC ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nicToSave ) { nicToSave.setMacAddress ( ( getMAC ( ) . getIsChangable ( ) ? ( getMAC ( ) . getEntity ( ) ) == null ? null : getMAC ( ) . getEntity ( ) . toLowerCase ( ) : getDefaultMacAddress ( ) ) ) ; }
Source:
public < T > java.util.List < T > executeReadList ( final java.lang.String procedureName , final org.springframework.jdbc.core.RowMapper < T > mapper , final org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource ) { java.util.Map < java.lang.String , java.lang.Object > resultsMap = executeImpl ( procedureName , parameterSource , createCallForRead ( procedureName , mapper , parameterSource ) ) ; return ( ( java.util.List < T > ) ( resultsMap.get ( BaseDAODbFacade.RETURN_VALUE_PARAMETER ) ) ) ; }

Target:
public < T > java.util.List < T > executeReadList ( final java.lang.String procedureName , final org.springframework.jdbc.core.RowMapper < T > mapper , final org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource ) { java.util.Map < java.lang.String , java.lang.Object > resultsMap = executeImpl ( procedureName , parameterSource , createCallForRead ( procedureName , mapper , parameterSource ) , mapper ) ; return ( ( java.util.List < T > ) ( resultsMap.get ( BaseDAODbFacade.RETURN_VALUE_PARAMETER ) ) ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnSetupNetworks" ) ) { onSetupNetworks ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( "OnSetupNetworks" . equals ( command.getName ( ) ) ) { onSetupNetworks ( ) ; } else if ( "Cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.storage_domains getStorageDomain ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.common.businessentities.StorageDomainType type , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.storage_domains dom = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; dom.setId ( id ) ; dom.setstorage_pool_id ( poolId ) ; dom.setstorage_domain_type ( type ) ; dom.setstorage_type ( storageType ) ; dom.setstorage_domain_shared_status ( StorageDomainSharedStatus.Unattached ) ; return dom ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain getStorageDomain ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.common.businessentities.StorageDomainType type , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.StorageDomain dom = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; dom.setId ( id ) ; dom.setstorage_pool_id ( poolId ) ; dom.setstorage_domain_type ( type ) ; dom.setstorage_type ( storageType ) ; dom.setstorage_domain_shared_status ( StorageDomainSharedStatus.Unattached ) ; return dom ; }
Source:
public void allow36HostWithoutDeployingHostedEngine ( ) { org.mockito.Mockito.when ( hostedEngineHelper.isVmManaged ( ) ) . thenReturn ( false ) ; mockCluster ( Version.v3_6 ) ; org.mockito.Mockito.when ( host.getClusterId ( ) ) . thenReturn ( Guid.Empty ) ; org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration heConfig = new org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration ( HostedEngineDeployConfiguration.Action.NONE ) ; org.junit.Assert.assertThat ( validator.supportsDeployingHostedEngine ( heConfig ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void allow36HostWithoutDeployingHostedEngine ( ) { mockCluster ( Version.v3_6 ) ; org.mockito.Mockito.when ( host.getClusterId ( ) ) . thenReturn ( Guid.Empty ) ; org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration heConfig = new org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration ( HostedEngineDeployConfiguration.Action.NONE ) ; org.junit.Assert.assertThat ( validator.supportsDeployingHostedEngine ( heConfig ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from logoff." ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , result ) ; if ( ( org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoginHandler ( ) ) != null ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoginHandler ( ) . onLogout ( ) ; } }

Target:
public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from logoff." ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , result ) ; if ( ( getLoginHandler ( ) ) != null ) { getLoginHandler ( ) . onLogout ( ) ; } }
Source:
protected static java.lang.String getMessageOrNull ( org.ovirt.engine.core.common.AuditLogType logType ) { final java.lang.String key = logType.name ( ) ; try { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resourceBundle.getString ( key ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( "Key '{}' is not translated in '{}'" , key , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getResourceBundleName ( ) ) ; return null ; } }

Target:
private static java.lang.String getMessageOrNull ( org.ovirt.engine.core.common.AuditLogType logType ) { final java.lang.String key = logType.name ( ) ; try { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resourceBundle.getString ( key ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( "Key '{}' is not translated in '{}'" , key , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getResourceBundleName ( ) ) ; return null ; } }
Source:
protected boolean canDoAction ( ) { boolean returnValue = super . canDoAction ( ) ; org.ovirt.engine.core.common.businessentities.vm_pools oldPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDAO ( ) . get ( org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getVmPool ( ) . getvm_pool_id ( ) ) ; if ( returnValue && ( oldPool == null ) ) { addCanDoActionMessage ( VdcBllMessages.VM_POOL_CANNOT_UPDATE_POOL_NOT_FOUND ) ; returnValue = false ; } else if ( returnValue && ( ( org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) < 0 ) ) { addCanDoActionMessage ( VdcBllMessages.VM_POOL_CANNOT_DECREASE_VMS_FROM_POOL ) ; returnValue = false ; } return returnValue ; }

Target:
protected boolean canDoAction ( ) { boolean returnValue = super . canDoAction ( ) ; org.ovirt.engine.core.common.businessentities.vm_pools oldPool = org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getVmPoolDAO ( ) . get ( org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getVmPool ( ) . getvm_pool_id ( ) ) ; if ( returnValue && ( oldPool == null ) ) { addCanDoActionMessage ( VdcBllMessages.VM_POOL_CANNOT_UPDATE_POOL_NOT_FOUND ) ; returnValue = false ; } else if ( returnValue && ( ( org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) < 0 ) ) { addCanDoActionMessage ( VdcBllMessages.VM_POOL_CANNOT_DECREASE_VMS_FROM_POOL ) ; returnValue = false ; } return returnValue ; }
Source:
public void setup ( ) { org.mockito.Mockito.when ( tagDao.getAllForParent ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.mockito.Mockito.doReturn ( tagDao ) . when ( tagsDirector ) . getTagDao ( ) ; org.mockito.Mockito.doNothing ( ) . when ( tagsDirector ) . updateTagInBackend ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.Tags.class ) ) ; tagsDirector.init ( ) ; }

Target:
public void setup ( ) { tagsDirector.init ( ) ; }
Source:
protected void moveOrCopyAllImageGroups ( ) { moveOrCopyAllImageGroups ( getVm ( ) . getId ( ) , org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getVm ( ) . getDiskMap ( ) . values ( ) , false , false ) ) ; copyAllMemoryImages ( getVm ( ) . getId ( ) ) ; }

Target:
protected void moveOrCopyAllImageGroups ( ) { moveOrCopyAllImageGroups ( getVm ( ) . getId ( ) , org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getVm ( ) . getDiskMap ( ) . values ( ) , false , false , true ) ) ; copyAllMemoryImages ( getVm ( ) . getId ( ) ) ; }
Source:
protected boolean performImagesChecks ( org.ovirt.engine.core.compat.Guid spId ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , spId , getStorageDomainId ( ) . getValue ( ) , false , true , false , false , false , true , java.util.Collections.< org.ovirt.engine.core.common.businessentities.Disk > emptyList ( ) ) ; }

Target:
protected boolean performImagesChecks ( org.ovirt.engine.core.compat.Guid spId ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , spId , true , false , false , false , java.util.Collections.< org.ovirt.engine.core.common.businessentities.DiskImage > emptyList ( ) ) ; }
Source:
public void setScope ( java.lang.String scope ) { if ( ( ( scopeAsList ) == null ) && ( ! ( org.ovirt.engine.core.sso.utils.SsoUtils.strippedScopeAsList ( org.ovirt.engine.core.sso.utils.SsoUtils.scopeAsList ( scope ) ) . isEmpty ( ) ) ) ) { this . scope = scope ; this . scopeAsList = ( org.apache.commons.lang.StringUtils.isEmpty ( scope ) ) ? java.util.Collections.< java.lang.String > emptyList ( ) : org.ovirt.engine.core.sso.utils.SsoUtils.scopeAsList ( scope ) ; } }

Target:
public void setScope ( java.lang.String scope ) { if ( ( ( scopeAsList ) == null ) && ( ! ( org.ovirt.engine.core.sso.utils.SsoUtils.strippedScopeAsList ( org.ovirt.engine.core.sso.utils.SsoUtils.scopeAsList ( scope ) ) . isEmpty ( ) ) ) ) { this . scope = scope ; this . scopeAsList = org.ovirt.engine.core.sso.utils.SsoUtils.scopeAsList ( scope ) ; } }
Source:
protected void initProviderList ( ) { startProgress ( null ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllNetworkProviders ( 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 ) { stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > ) ( returnValue ) ) ; providers.add ( 0 , null ) ; getProviders ( ) . setItems ( providers ) ; } } ) ) ; }

Target:
protected void initProviderList ( ) { startProgress ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllNetworkProviders ( 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 ) { stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > ) ( returnValue ) ) ; providers.add ( 0 , null ) ; getProviders ( ) . setItems ( providers ) ; } } ) ) ; }
Source:
protected java.util.Set < java.lang.String > getExcludeUsers ( ) { java.util.Set < java.lang.String > excludeUsers = new java.util.HashSet < java.lang.String > ( ) ; if ( ( getExcludeItems ( ) ) != null ) { for ( java.lang.Object item : getExcludeItems ( ) ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser a = ( ( org.ovirt.engine.core.common.businessentities.aaa.DbUser ) ( item ) ) ; excludeUsers.add ( a.getExternalId ( ) ) ; } } return excludeUsers ; }

Target:
protected java.util.Set < java.lang.String > getExcludeUsers ( ) { java.util.Set < java.lang.String > excludeUsers = new java.util.HashSet < java.lang.String > ( ) ; if ( ( getExcludeItems ( ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.aaa.DbUser item : getExcludeItems ( ) ) { excludeUsers.add ( item.getExternalId ( ) ) ; } } return excludeUsers ; }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.common.scheduling.VmOverheadCalculator vmOverheadCalculator , java.lang.String diskDescription ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( vmOverheadCalculator.getSnapshotMemorySizeInBytes ( vm ) ) ; image.setVolumeType ( org.ovirt.engine.core.bll.memory.MemoryUtils.storageTypeToMemoryVolumeType ( storageType ) ) ; image.setVolumeFormat ( VolumeFormat.RAW ) ; image.setContentType ( DiskContentType.MEMORY_DUMP_VOLUME ) ; image.setDiskDescription ( diskDescription ) ; return image ; }

Target:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.common.scheduling.VmOverheadCalculator vmOverheadCalculator , java.lang.String diskDescription ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( vmOverheadCalculator.getSnapshotMemorySizeInBytes ( vm ) ) ; image.setVolumeType ( org.ovirt.engine.core.bll.memory.MemoryUtils.storageTypeToMemoryVolumeType ( storageType ) ) ; image.setVolumeFormat ( VolumeFormat.RAW ) ; image.setContentType ( DiskContentType.MEMORY_DUMP_VOLUME ) ; image.setDiskDescription ( diskDescription ) ; return image ; }
Source:
protected boolean isStorageDomainTypeCorrect ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain ) { if ( ( ( ( storageDomain.getstorage_domain_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) && ( ( storageDomain.getstorage_domain_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) && ( ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) . getstorage_pool_type ( ) ) != ( storageDomain.getstorage_type ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ERROR_CANNOT_ATTACH_STORAGE_DOMAIN_STORAGE_TYPE_NOT_MATCH ) ; return false ; } return true ; }

Target:
protected boolean isStorageDomainTypeCorrect ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( ( ( ( storageDomain.getstorage_domain_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) && ( ( storageDomain.getstorage_domain_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) && ( ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) . getstorage_pool_type ( ) ) != ( storageDomain.getstorage_type ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ERROR_CANNOT_ATTACH_STORAGE_DOMAIN_STORAGE_TYPE_NOT_MATCH ) ; return false ; } return true ; }
Source:
public double getDiskSize ( ) { if ( ( diskSize ) == 0 ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : getDiskMap ( ) . values ( ) ) { if ( ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) == ( disk.getDiskStorageType ( ) ) ) { diskSize += ( ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) . getSize ( ) ) / ( java.lang.Double.valueOf ( ( ( 1024 * 1024 ) * 1024 ) ) ) ; } } } return diskSize ; }

Target:
public double getDiskSize ( ) { if ( ( diskSize ) == 0 ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : getDiskMap ( ) . values ( ) ) { if ( ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) == ( disk.getDiskStorageType ( ) ) ) { diskSize += ( disk.getSize ( ) ) / ( java.lang.Double.valueOf ( ( ( 1024 * 1024 ) * 1024 ) ) ) ; } } } return diskSize ; }
Source:
private void setNetworkToDcValues ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.DcNetworkParams dcNetParams = getSetupModel ( ) . getNetDcParams ( getName ( ) ) ; getEntity ( ) . setvlan_id ( dcNetParams.getVlanId ( ) ) ; getEntity ( ) . setMtu ( dcNetParams.getMtu ( ) ) ; getEntity ( ) . setVmNetwork ( dcNetParams.isVmNetwork ( ) ) ; }

Target:
private void setNetworkToDcValues ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.DcNetworkParams dcNetParams = getSetupModel ( ) . getNetDcParams ( getName ( ) ) ; if ( dcNetParams != null ) { getEntity ( ) . setvlan_id ( dcNetParams.getVlanId ( ) ) ; getEntity ( ) . setMtu ( dcNetParams.getMtu ( ) ) ; getEntity ( ) . setVmNetwork ( dcNetParams.isVmNetwork ( ) ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.common.PermissionSubject ( ( ( org.ovirt.engine.core.bll.AddQuotaCommand.getStoragePoolId ( ) ) == null ? null : org.ovirt.engine.core.bll.AddQuotaCommand.getStoragePoolId ( ) . getValue ( ) ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , org.ovirt.engine.core.bll.AddQuotaCommand.getActionType ( ) . getActionGroup ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.common.PermissionSubject ( ( ( getStoragePoolId ( ) ) == null ? null : getStoragePoolId ( ) . getValue ( ) ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , getActionType ( ) . getActionGroup ( ) ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { if ( ! ( getParameters ( ) . isShouldRemainIllegalOnFailedExecution ( ) ) ) { addDiskImageToDb ( newDiskImage , getCompensationContext ( ) ) ; } else { addDiskImageToDb ( newDiskImage , null ) ; getCompensationContext ( ) . snapshotEntityStatus ( newDiskImage.getImage ( ) , ImageStatus.ILLEGAL ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { if ( ! ( getParameters ( ) . isShouldRemainIllegalOnFailedExecution ( ) ) ) { addDiskImageToDb ( newDiskImage , getCompensationContext ( ) , java.lang.Boolean.TRUE ) ; } else { addDiskImageToDb ( newDiskImage , null , java.lang.Boolean.TRUE ) ; getCompensationContext ( ) . snapshotEntityStatus ( newDiskImage.getImage ( ) , ImageStatus.ILLEGAL ) ; } return null ; }
Source:
public void testList ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetSnapshotVmConfiguration ( org.ovirt.engine.api.restapi.resource.BackendSnapshotsResourceTest.SNAPSHOT_IDS [ 0 ] ) ; setUpGetSnapshotVmConfiguration ( org.ovirt.engine.api.restapi.resource.BackendSnapshotsResourceTest.SNAPSHOT_IDS [ 1 ] ) ; collection.setUriInfo ( uriInfo ) ; control.replay ( ) ; verifyCollection ( getCollection ( ) ) ; }

Target:
public void testList ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetSnapshotVmConfiguration ( org.ovirt.engine.api.restapi.resource.BackendSnapshotsResourceTest.SNAPSHOT_IDS [ 0 ] ) ; setUpGetSnapshotVmConfiguration ( org.ovirt.engine.api.restapi.resource.BackendSnapshotsResourceTest.SNAPSHOT_IDS [ 1 ] ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }
Source:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setHibernationVolHandle ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "StopVmCommandBase::EndVmCommand: Vm is null - not performing full EndAction" ) ; } org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }

Target:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setHibernationVolHandle ( null ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "StopVmCommandBase::EndVmCommand: Vm is null - not performing full EndAction" ) ; } org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }
Source:
public void updateNonExistingConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getId ( ) ) ) . thenReturn ( null ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; }

Target:
public void updateNonExistingConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; }
Source:
public java.util.Set < org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType > getDeviceTypesWithProperties ( org.ovirt.engine.core.compat.Version version ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.deviceCustomProperties ( version ) ) ) { return java.util.Collections.emptySet ( ) ; } java.util.EnumMap < org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType , java.util.Map < java.lang.String , java.lang.String > > map = deviceProperties.get ( version ) ; if ( map.isEmpty ( ) ) { return java.util.Collections.emptySet ( ) ; } else { return java.util.Collections.unmodifiableSet ( map.keySet ( ) ) ; } }

Target:
public java.util.Set < org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType > getDeviceTypesWithProperties ( org.ovirt.engine.core.compat.Version version ) { java.util.EnumMap < org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType , java.util.Map < java.lang.String , java.lang.String > > map = deviceProperties.get ( version ) ; if ( map.isEmpty ( ) ) { return java.util.Collections.emptySet ( ) ; } else { return java.util.Collections.unmodifiableSet ( map.keySet ( ) ) ; } }
Source:
private void assertGetLunsThatBreakDiscardAfterDeleteSupportContainsExpectedLuns ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.LUNs > expectedLunsThatBreakDiscardAfterDeleteSupport ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsThatBreakDiscardAfterDeleteSupport = discardHelper.getLunsThatBreakDiscardAfterDeleteSupport ( luns , storageDomain.getId ( ) ) ; org.junit.Assert.assertTrue ( org.apache.commons.collections.CollectionUtils.isEqualCollection ( lunsThatBreakDiscardAfterDeleteSupport , expectedLunsThatBreakDiscardAfterDeleteSupport ) ) ; }

Target:
private void assertGetLunsThatBreakDiscardAfterDeleteSupportContainsExpectedLuns ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.LUNs > expectedLunsThatBreakDiscardAfterDeleteSupport ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsThatBreakDiscardAfterDeleteSupport = discardHelper.getLunsThatBreakDiscardAfterDeleteSupport ( luns , storageDomain ) ; org.junit.Assert.assertTrue ( org.apache.commons.collections.CollectionUtils.isEqualCollection ( lunsThatBreakDiscardAfterDeleteSupport , expectedLunsThatBreakDiscardAfterDeleteSupport ) ) ; }
Source:
public static java.lang.String startPasswordDialog ( java.lang.String user , java.lang.String msg ) throws java.io.IOException { org.ovirt.engine.core.config.EngineConfigLogic.log.debug ( "starting password dialog." ) ; java.lang.String prompt = null ; if ( user != null ) { prompt = ( ( msg + " for " ) + user ) + ": " ; } else { prompt = msg + ": " ; } return new java.lang.String ( org.ovirt.engine.core.config.EngineConfigLogic.console.readPassword ( prompt ) ) ; }

Target:
public static java.lang.String startPasswordDialog ( java.lang.String user , java.lang.String msg ) throws java.io.IOException { org.ovirt.engine.core.config.EngineConfigLogic.log.debug ( "starting password dialog." ) ; java.lang.String prompt = null ; if ( user != null ) { prompt = ( ( msg + " for " ) + user ) + ": " ; } else { prompt = msg + ": " ; } return org.ovirt.engine.core.config.EngineConfigLogic.console.readPassword ( prompt ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { context.host = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( returnValue ) ) ; timer = new com.google.gwt.user.client.Timer ( ) { @ java.lang.Override public void run ( ) { prepare4 ( ) ; } } ; timer.scheduleRepeating ( org.ovirt.engine.ui.uicommonweb.models.hosts.AddStorageDomainRM.WaitInterval ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { context.host = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( returnValue ) ) ; timer = new com.google.gwt.user.client.Timer ( ) { @ java.lang.Override public void run ( ) { prepare4 ( ) ; } } ; timer.scheduleRepeating ( org.ovirt.engine.ui.uicommonweb.models.hosts.AddStorageDomainRM.WaitInterval ) ; }
Source:
protected void initWidget ( com.google.gwt.user.client.ui.Widget wrapperWidget ) { super . initWidget ( wrapperWidget ) ; contentWidgetContainer.setWidget ( contentWidget ) ; contentWidget.asWidget ( ) . setWidth ( "100%" ) ; com.google.gwt.dom.client.Element contentWidgetElement = getContentWidgetElement ( ) ; if ( ( ( contentWidgetElement.getId ( ) ) == null ) || ( contentWidgetElement.getId ( ) . isEmpty ( ) ) ) { contentWidgetElement.setId ( com.google.gwt.user.client.DOM.createUniqueId ( ) ) ; } updateLabelElementId ( contentWidgetElement.getId ( ) ) ; }

Target:
protected void initWidget ( com.google.gwt.user.client.ui.Widget wrapperWidget ) { super . initWidget ( wrapperWidget ) ; contentWidgetContainer.setWidget ( contentWidget ) ; contentWidget.asWidget ( ) . setWidth ( "100%" ) ; com.google.gwt.dom.client.Element contentWidgetElement = getContentWidgetElement ( ) ; if ( ( ( contentWidgetElement.getId ( ) ) == null ) || ( contentWidgetElement.getId ( ) . isEmpty ( ) ) ) { contentWidgetElement.setId ( com.google.gwt.user.client.DOM.createUniqueId ( ) ) ; } updateLabelElementId ( getContentWidgetElement ( ) . getId ( ) ) ; }
Source:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network_cluster > clustersFromDB = dbFacade.getNetworkClusterDAO ( ) . getAllForCluster ( cluster ) ; org.ovirt.engine.core.common.businessentities.network_cluster clusterFromDB = clustersFromDB.get ( 0 ) ; org.junit.Assert.assertNotNull ( clusterFromDB ) ; new_net.setCluster ( clusterFromDB ) ; new_net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; dao.save ( new_net ) ; org.ovirt.engine.core.common.businessentities.network result = dao.getByName ( new_net.getname ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_net , result ) ; }

Target:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network_cluster > clustersFromDB = dbFacade.getNetworkClusterDAO ( ) . getAllForCluster ( cluster ) ; org.ovirt.engine.core.common.businessentities.network_cluster clusterFromDB = clustersFromDB.get ( 0 ) ; org.junit.Assert.assertNotNull ( clusterFromDB ) ; new_net.setCluster ( clusterFromDB ) ; new_net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; dao.save ( new_net ) ; org.ovirt.engine.core.common.businessentities.Network result = dao.getByName ( new_net.getname ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_net , result ) ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { if ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksStatusesVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) . equals ( Guid.Empty ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksStatusesVDSCommand.setReturnValue ( null ) ; } else { setVDSReturnValue ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMGetAllTasksStatuses , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksStatusesVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ) ) ; } }

Target:
protected void ExecuteIrsBrokerCommand ( ) { setVDSReturnValue ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMGetAllTasksStatuses , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksStatusesVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ) ) ; }
Source:
public boolean match ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster source ) { if ( ( ( source.getDataCenter ( ) ) == null ) || ( ( source.getCluster ( ) ) == null ) ) { return false ; } return ( source.getDataCenter ( ) . getId ( ) . equals ( dataCenterId ) ) && ( source.getCluster ( ) . getId ( ) . equals ( clusterId ) ) ; }

Target:
public boolean match ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster source ) { return ( ( ( ( source.getDataCenter ( ) ) != null ) && ( ( source.getCluster ( ) ) != null ) ) && ( source.getDataCenter ( ) . getId ( ) . equals ( dataCenterId ) ) ) && ( source.getCluster ( ) . getId ( ) . equals ( clusterId ) ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel prepareStorageForEdit ( org.ovirt.engine.core.common.businessentities.StorageDomain storage , org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model ) { final org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel storageTypeModel = getStorageModelByStorage ( storage ) ; storageTypeModel.setContainer ( model ) ; storageTypeModel.setRole ( storage.getStorageDomainType ( ) ) ; storageTypeModel.prepareForEdit ( storage ) ; return storageTypeModel ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel prepareStorageForEdit ( org.ovirt.engine.core.common.businessentities.StorageDomain storage , org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model ) { final org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel storageTypeModel = getStorageModelByStorage ( storage ) ; if ( storageTypeModel != null ) { storageTypeModel.setContainer ( model ) ; storageTypeModel.setRole ( storage.getStorageDomainType ( ) ) ; storageTypeModel.prepareForEdit ( storage ) ; } return storageTypeModel ; }
Source:
protected static void handleCustomPropertiesError ( java.util.List < org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.ValidationError > validationErrors , java.util.ArrayList < java.lang.String > message ) { java.lang.String invalidSyntaxMsg = VdcBllMessages.ACTION_TYPE_FAILED_INVALID_CUSTOM_VM_PROPERTIES_INVALID_SYNTAX.name ( ) ; java.util.List < java.lang.String > errorMessages = org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.getInstance ( ) . generateErrorMessages ( validationErrors , invalidSyntaxMsg , org.ovirt.engine.core.bll.VmHandler.failureReasonsToVdcBllMessagesMap , org.ovirt.engine.core.bll.VmHandler.failureReasonsToFormatMessages ) ; message.addAll ( errorMessages ) ; }

Target:
public static void handleCustomPropertiesError ( java.util.List < org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.ValidationError > validationErrors , java.util.List < java.lang.String > message ) { java.lang.String invalidSyntaxMsg = VdcBllMessages.ACTION_TYPE_FAILED_INVALID_CUSTOM_VM_PROPERTIES_INVALID_SYNTAX.name ( ) ; java.util.List < java.lang.String > errorMessages = org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.getInstance ( ) . generateErrorMessages ( validationErrors , invalidSyntaxMsg , org.ovirt.engine.core.bll.VmHandler.failureReasonsToVdcBllMessagesMap , org.ovirt.engine.core.bll.VmHandler.failureReasonsToFormatMessages ) ; message.addAll ( errorMessages ) ; }
Source:
private void edit ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getSelectedItem ( ) ) ) ; if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.frontend.AsyncQuery getVmInitQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; getVmInitQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { vmInitLoaded ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( result ) ) ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getTemplateById ( getVmInitQuery , template.getId ( ) ) ; }

Target:
private void edit ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getSelectedItem ( ) ) ) ; if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.frontend.AsyncQuery getVmInitQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; getVmInitQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { vmInitLoaded ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( result ) ) ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getTemplateById ( getVmInitQuery , template.getId ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; dataCenterGuideModel.clusters = clusters ; dataCenterGuideModel.UpdateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; dataCenterGuideModel.clusters = clusters ; dataCenterGuideModel.UpdateOptionsNonLocalFS ( ) ; }
Source:
public void nameIsAlreadyUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ) ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( clusterDao , dataCenterDao , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CLUSTER_CANNOT_DO_ACTION_NAME_IN_USE ) ) ; }

Target:
public void nameIsAlreadyUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ) ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CLUSTER_CANNOT_DO_ACTION_NAME_IN_USE ) ) ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Tag model = org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 1 , false ) ; model.setId ( org.ovirt.engine.api.restapi.resource.BackendTagResourceTest.NEW_PARENT_ID.toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Tag model = org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 1 , false ) ; model.setId ( org.ovirt.engine.api.restapi.resource.BackendTagResourceTest.NEW_PARENT_ID.toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public void bufferBelowCapacity ( ) { org.junit.Assert.assertNull ( tested.add ( "A" ) ) ; org.junit.Assert.assertNull ( tested.add ( "B" ) ) ; org.junit.Assert.assertArrayEquals ( testedListToArray ( ) , new java.lang.String [ ] { "A" , "B" } ) ; org.junit.Assert.assertEquals ( tested.head ( ) , 0 ) ; org.junit.Assert.assertEquals ( tested.size ( ) , 2 ) ; org.junit.Assert.assertFalse ( tested.isEmpty ( ) ) ; org.junit.Assert.assertFalse ( tested.isFull ( ) ) ; }

Target:
public void bufferBelowCapacity ( ) { org.junit.Assert.assertNull ( tested.add ( "A" ) ) ; org.junit.Assert.assertNull ( tested.add ( "B" ) ) ; org.junit.Assert.assertArrayEquals ( testedListToArray ( ) , new java.lang.String [ ] { "A" , "B" } ) ; org.junit.Assert.assertEquals ( 0 , tested.head ( ) ) ; org.junit.Assert.assertEquals ( 2 , tested.size ( ) ) ; org.junit.Assert.assertFalse ( tested.isEmpty ( ) ) ; org.junit.Assert.assertFalse ( tested.isFull ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.IpConfiguration createIpConfigurationFromVdsNetworkInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address iPv4Address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; iPv4Address.setAddress ( nic.getAddress ( ) ) ; iPv4Address.setNetmask ( nic.getSubnet ( ) ) ; iPv4Address.setGateway ( nic.getGateway ( ) ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; ipConfiguration.setBootProtocol ( nic.getBootProtocol ( ) ) ; ipConfiguration.setIPv4Addresses ( java.util.Collections.singletonList ( iPv4Address ) ) ; return ipConfiguration ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.IpConfiguration createIpConfigurationFromVdsNetworkInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address iPv4Address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; iPv4Address.setAddress ( nic.getAddress ( ) ) ; iPv4Address.setNetmask ( nic.getSubnet ( ) ) ; iPv4Address.setGateway ( nic.getGateway ( ) ) ; iPv4Address.setBootProtocol ( nic.getBootProtocol ( ) ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; ipConfiguration.setIPv4Addresses ( java.util.Collections.singletonList ( iPv4Address ) ) ; return ipConfiguration ; }