auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void fillImagesBySnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : vm.getDiskMap ( ) . values ( ) ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; diskImage.getSnapshots ( ) . addAll ( org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots ( diskImage.getImageId ( ) ) ) ; } } }

Target:
public static void fillImagesBySnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : vm.getDiskMap ( ) . values ( ) ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; diskImage.getSnapshots ( ) . addAll ( org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots ( diskImage.getImageId ( ) ) ) ; } } }
Source:
private void mockSpiceSupportMatrix ( ) { java.util.Map < java.lang.Integer , java.util.Map < org.ovirt.engine.core.compat.Version , java.lang.Boolean > > supportMatrix = new java.util.HashMap < > ( ) ; java.util.HashMap < org.ovirt.engine.core.compat.Version , java.lang.Boolean > chunk = new java.util.HashMap < > ( ) ; chunk.put ( Version.v3_1 , true ) ; supportMatrix.put ( 0 , chunk ) ; org.mockito.Mockito.when ( osRepository.getSpiceSupportMatrix ( ) ) . thenReturn ( supportMatrix ) ; }

Target:
public void canDoActionChecksIfHotPlugDiskSnapshotIsSupported ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; cretaeVirtIODisk ( ) ; initStorageDomain ( ) ; command.getParameters ( ) . setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command.canDoAction ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.times ( 1 ) ) . isHotPlugDiskSnapshotSupported ( ) ; }
Source:
public void start ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < > ( ) ; for ( java.lang.Object item : org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.StartVds , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
private void refreshCapabilities ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < > ( ) ; for ( java.lang.Object item : org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RefreshHost , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
private static void interfaceHasSiblingVlanInterfaces ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; return ! ( siblingVlanInterfaces.isEmpty ( ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllSiblingVlanInterfaces , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.GetVmTemplatesDisksParameters ( templateId ) , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImageLineModel findBecomeNonBoot ( org.ovirt.engine.core.common.businessentities.Disk bootDisk ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImageLineModel model : getItems ( ) ) { org.ovirt.engine.core.common.businessentities.Disk disk = model.getDiskModel ( ) . getEntity ( ) . getDisk ( ) ; if ( disk.getId ( ) . equals ( bootDisk.getId ( ) ) ) { if ( disk.isBoot ( ) ) { return null ; } else { return model ; } } } return null ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImageLineModel findBecomeNonBoot ( org.ovirt.engine.core.common.businessentities.storage.Disk bootDisk ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImageLineModel model : getItems ( ) ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = model.getDiskModel ( ) . getEntity ( ) . getDisk ( ) ; if ( disk.getId ( ) . equals ( bootDisk.getId ( ) ) ) { if ( disk.isBoot ( ) ) { return null ; } else { return model ; } } } return null ; }
Source:
private void onRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameterList = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Provider provider : providers ) { parameterList.add ( new org.ovirt.engine.core.common.action.ProviderParameters ( provider ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.RemoveProvider , parameterList ) ; cancel ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { sourceListModel.getSearchCommand ( ) . execute ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalComputeResource > computeResources = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalComputeResource > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalComputeResourceListModel = getExternalComputeResource ( ) ; externalComputeResourceListModel.setItems ( computeResources ) ; externalComputeResourceListModel.setIsChangable ( true ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.Provider > providersListModel = getProviders ( ) ; providersListModel.setItems ( providers ) ; providersListModel.setIsChangable ( true ) ; providersListModel.setSelectedItem ( providers.get ( 0 ) ) ; getIsDiscorveredHosts ( ) . setEntity ( null ) ; getIsDiscorveredHosts ( ) . setEntity ( true ) ; }
Source:
private void scanAlignment ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameterList = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( getSelectedItems ( ) ) ) ) { parameterList.add ( new org.ovirt.engine.core.common.action.GetDiskAlignmentParameters ( disk.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.GetDiskAlignment , parameterList , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , this ) ; }

Target:
private void remove ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.RemoveDiskModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.RemoveDiskModel ( ) ; setWindow ( model ) ; model.initialize ( getEntity ( ) , getSelectedItems ( ) , this ) ; }
Source:
private void mtuValidTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , int mtu , boolean featureSupported ) { mockConfigRule.mockConfigValue ( ConfigValues.MTUOverrideSupported , dataCenter.getCompatibilityVersion ( ) , featureSupported ) ; org.mockito.Mockito.when ( network.getMtu ( ) ) . thenReturn ( mtu ) ; org.junit.Assert.assertThat ( validator.mtuValid ( ) , matcher ) ; }

Target:
public void mtuValid ( ) { org.junit.Assert.assertThat ( validator.mtuValid ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public void getEngineSshPublicKey ( 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.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetEngineSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 1 , 0 ) ; setUpGetBallooningExpectations ( 1 ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; mockUniqueOsNames ( ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 1 , 0 ) ; setUpGetBallooningExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
public void checkShowLocks ( ) { org.junit.Assert.assertTrue ( org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLock ( lockLock1 ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLock ( lockLock2 ) ) ; org.junit.Assert.assertTrue ( ( ( lockMager.showAllLocks ( ) . size ( ) ) == 2 ) ) ; org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . clear ( ) ; org.junit.Assert.assertTrue ( lockMager.showAllLocks ( ) . isEmpty ( ) ) ; }

Target:
public void checkShowLocks ( ) { org.junit.Assert.assertTrue ( org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLock ( lockLock1 ) . getFirst ( ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLock ( lockLock2 ) . getFirst ( ) ) ; org.junit.Assert.assertTrue ( ( ( lockMager.showAllLocks ( ) . size ( ) ) == 2 ) ) ; org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . clear ( ) ; org.junit.Assert.assertTrue ( lockMager.showAllLocks ( ) . isEmpty ( ) ) ; }
Source:
public java.lang.Object getConfigValue ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue , java.lang.String version , org.ovirt.engine.ui.frontend.IAsyncConverter converter ) { if ( converter == null ) { return null ; } org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat ( configValue , version ) ; return converter.Convert ( cachedConfigValuesPreConvert.get ( key ) , null ) ; }

Target:
public java.lang.Object getConfigValue ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue , java.lang.String version , org.ovirt.engine.ui.frontend.IAsyncConverter converter ) { if ( converter == null ) { return null ; } org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat ( configValue , version ) ; return converter.convert ( cachedConfigValuesPreConvert.get ( key ) , null ) ; }
Source:
private void addManagementNetworksToPool ( org.ovirt.engine.core.compat.Guid ... managementNetworkIds ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > managementNetworks = new java.util.ArrayList ( managementNetworkIds.length ) ; for ( org.ovirt.engine.core.compat.Guid managementNetworkId : managementNetworkIds ) { managementNetworks.add ( createNetwork ( managementNetworkId ) ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( managementNetworkId ) ) . thenReturn ( true ) ; } org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( managementNetworks ) ; }

Target:
private void addManagementNetworksToPool ( int numberOfNetworks ) { for ( int i = 0 ; i < numberOfNetworks ; i ++ ) { final org.ovirt.engine.core.compat.Guid managementNetworkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; allDcNetworks.add ( createNetwork ( managementNetworkId ) ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( managementNetworkId ) ) . thenReturn ( true ) ; } org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( allDcNetworks ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; java.util.HashMap < java.lang.String , java.lang.String > timeZones = ( ( java.util.HashMap < java.lang.String , java.lang.String > ) ( returnValue ) ) ; cachedTimeZones.put ( timezoneType , timeZones.entrySet ( ) ) ; behavior.PostUpdateTimeZone ( selectedTimeZone ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; java.util.Map < java.lang.String , java.lang.String > timezones = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( returnValue ) ) ; timezones.put ( null , "" ) ; cachedTimeZones.put ( timezoneType , timezones.entrySet ( ) ) ; behavior.PostUpdateTimeZone ( selectedTimeZone ) ; }
Source:
public static void GetDataCenterListByName ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void GetSpiceUsbAutoShare ( 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMetadataDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( org.ovirt.engine.core.bll.memory.MemoryUtils.METADATA_SIZE_IN_BYTES ) ; image.setVolumeType ( VolumeType.Preallocated ) ; image.setVolumeFormat ( VolumeFormat.RAW ) ; image.setContentType ( DiskContentType.MEMORY_METADATA_VOLUME ) ; return image ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMetadataDisk ( java.lang.String diskDescription ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( org.ovirt.engine.core.bll.memory.MemoryUtils.METADATA_SIZE_IN_BYTES ) ; image.setVolumeType ( VolumeType.Preallocated ) ; image.setVolumeFormat ( VolumeFormat.RAW ) ; image.setContentType ( DiskContentType.MEMORY_METADATA_VOLUME ) ; image.setDiskDescription ( diskDescription ) ; return image ; }
Source:
private void cancelTasks ( ) { if ( hasTasks ( ) ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , org.ovirt.engine.core.bll.CommandBase.this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , org.ovirt.engine.core.bll.CommandBase.this . getClass ( ) . getName ( ) ) ; } } } ) ; } }

Target:
private void cancelTasks ( ) { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.cancelTasks ( this ) ; }
Source:
public void shouldElectActiveSharedBeforeLocalDataDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( StorageDomainStatus.Active , "local domain name" , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( StorageDomainStatus.Active , "shared domain name" , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Arrays.asList ( localDomain , sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.junit.Assert.assertEquals ( sharedDomain , cmd.electNewMaster ( ) ) ; }

Target:
public void shouldElectActiveSharedBeforeLocalDataDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( StorageDomainStatus.Active , "local domain name" , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( StorageDomainStatus.Active , "shared domain name" , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Arrays.asList ( localDomain , sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.junit.Assert.assertEquals ( sharedDomain , cmd.electNewMaster ( ) ) ; }
Source:
protected void addExternallyManagedVm ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.AddVmFromScratch , new org.ovirt.engine.core.common.action.AddVmParameters ( vmStatic ) , createAddExternalVmContext ( vmStatic ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { log.debug ( "Failed adding Externally managed VM '{}'" , vmStatic.getName ( ) ) ; return ; } resourceManager.getVmManager ( vmStatic.getId ( ) ) . update ( vmStatic ) ; }

Target:
protected void addExternallyManagedVm ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( ActionType.AddVmFromScratch , new org.ovirt.engine.core.common.action.AddVmParameters ( vmStatic ) , createAddExternalVmContext ( vmStatic ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { log.debug ( "Failed adding Externally managed VM '{}'" , vmStatic.getName ( ) ) ; return ; } resourceManager.getVmManager ( vmStatic.getId ( ) ) . update ( vmStatic ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc validateStorageDomain ( java.lang.String sdUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.validateStorageDomain ( sdUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotPlugNic ( java.util.Map info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotplugNic ( info ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected java.lang.String createRequestToken ( ) { java.lang.String requestToken = super . createRequestToken ( ) ; org.ovirt.engine.ui.uicommonweb.models.EntityModel model = modelProvider.getModel ( ) . getActiveDetailModel ( ) ; if ( ( ( model instanceof org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel ) || ( model instanceof org.ovirt.engine.ui.uicommonweb.models.pools.PoolInterfaceListModel ) ) || ( model instanceof org.ovirt.engine.ui.uicommonweb.models.pools.PoolDiskListModel ) ) { requestToken += org.ovirt.engine.ui.userportal.place.ApplicationPlaces.POOL_SUFFIX ; } return requestToken ; }

Target:
protected java.lang.String createRequestToken ( ) { java.lang.String requestToken = super . createRequestToken ( ) ; org.ovirt.engine.ui.uicommonweb.models.EntityModel model = modelProvider.getModel ( ) . getActiveDetailModel ( ) ; if ( ( ( model instanceof org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel ) || ( model instanceof org.ovirt.engine.ui.uicommonweb.models.pools.PoolInterfaceListModel ) ) || ( model instanceof org.ovirt.engine.ui.uicommonweb.models.pools.PoolDiskListModel ) ) { requestToken += org.ovirt.engine.ui.uicommonweb.place.UserPortalApplicationPlaces.POOL_SUFFIX ; } return requestToken ; }
Source:
public boolean equals ( java.lang.Object other ) { if ( other == ( this ) ) { return true ; } else if ( other instanceof org.ovirt.engine.api.restapi.types.MappingLocator.ClassPairKey ) { org.ovirt.engine.api.restapi.types.MappingLocator.ClassPairKey key = ( ( org.ovirt.engine.api.restapi.types.MappingLocator.ClassPairKey ) ( other ) ) ; return ( ( to ) == ( key.to ) ) && ( ( from ) == ( key.from ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.api.restapi.types.MappingLocator.ClassPairKey ) ) { return false ; } org.ovirt.engine.api.restapi.types.MappingLocator.ClassPairKey other = ( ( org.ovirt.engine.api.restapi.types.MappingLocator.ClassPairKey ) ( obj ) ) ; return ( java.util.Objects.equals ( to , other.to ) ) && ( java.util.Objects.equals ( from , other.from ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > createDiskDummiesForSpaceValidations ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > dummies = new java.util.ArrayList ( disksList.size ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > emptyStorageIds = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : disksList ) { image.setStorageIds ( emptyStorageIds ) ; dummies.add ( org.ovirt.engine.core.bll.ImagesHandler.createDiskImageWithExcessData ( image , org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getStorageDomainId ( ) ) ) ; } return dummies ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > createDiskDummiesForSpaceValidations ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > dummies = new java.util.ArrayList ( disksList.size ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > emptyStorageIds = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : disksList ) { image.setStorageIds ( emptyStorageIds ) ; dummies.add ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.createDiskImageWithExcessData ( image , org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getStorageDomainId ( ) ) ) ; } return dummies ; }
Source:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static void getRedirectServletReportsPage ( 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.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
void initBootSequenceBox ( ) { bootSequenceBox = new com.google.gwt.user.client.ui.ListBox ( false ) ; bootSequenceBox.setWidth ( "100%" ) ; bootSequenceBox.setHeight ( "60px" ) ; com.google.gwt.user.client.ui.VerticalPanel boxPanel = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; boxPanel.setWidth ( "100%" ) ; boxPanel.add ( bootSequenceBox ) ; bootSequencePanel.add ( boxPanel ) ; }

Target:
void initBootSequenceBox ( ) { bootSequenceBox = new com.google.gwt.user.client.ui.ListBox ( false ) ; bootSequenceBox.setWidth ( "370px" ) ; bootSequenceBox.setHeight ( "60px" ) ; com.google.gwt.user.client.ui.VerticalPanel boxPanel = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; boxPanel.setWidth ( "100%" ) ; boxPanel.add ( bootSequenceBox ) ; bootSequencePanel.add ( boxPanel ) ; localizeBootSequenceButtons ( ) ; }
Source:
public java.lang.Object runInTransaction ( ) { HandleVdsInformation ( ) ; vm.setRunOnVds ( getVdsId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vm.getDynamicData ( ) ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { HandleVdsInformation ( ) ; vm.setRunOnVds ( getVdsId ( ) ) ; if ( getParameters ( ) . isClearHibernationVolumes ( ) ) { vm.setHibernationVolHandle ( StringUtils.EMPTY ) ; } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vm.getDynamicData ( ) ) ; return null ; }
Source:
public void testDoGet_ServeFaviconNotFound ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockBrandingManager.getBrandingRootPath ( ) ) . thenReturn ( new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/utils/branding" ) . getFile ( ) ) ) ; org.mockito.Mockito.when ( mockBrandingManager.getCascadingResource ( "favicon" ) ) . thenReturn ( null ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . sendError ( HttpServletResponse.SC_NOT_FOUND ) ; }

Target:
public void testDoGet_ServeFaviconNotFound ( ) throws java.io.IOException , java.net.URISyntaxException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockBrandingManager.getBrandingRootPath ( ) ) . thenReturn ( new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/utils/branding" ) . toURI ( ) . getPath ( ) ) ) ; org.mockito.Mockito.when ( mockBrandingManager.getCascadingResource ( "favicon" ) ) . thenReturn ( null ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . sendError ( HttpServletResponse.SC_NOT_FOUND ) ; }
Source:
public void canDoActionFailedWrongPlugStatus ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeDiskWrongPlug ( false ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.HOT_UNPLUG_DISK_IS_NOT_PLUGGED.toString ( ) ) ) ; }

Target:
public void validateFailedWrongPlugStatus ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeDiskWrongPlug ( false ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.HOT_UNPLUG_DISK_IS_NOT_PLUGGED.toString ( ) ) ) ; }
Source:
private void testUpdateInterface ( org.ovirt.engine.core.compat.Guid interface_id ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = dao.get ( interface_id ) ; iface.setName ( iface.getName ( ) . toUpperCase ( ) ) ; iface.setQos ( newQos ) ; dao.updateInterfaceForVds ( iface ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ifaced = dao.get ( interface_id ) ; org.junit.Assert.assertEquals ( iface.getName ( ) , ifaced.getName ( ) ) ; org.junit.Assert.assertEquals ( iface.getQos ( ) , ifaced.getQos ( ) ) ; verifyIpv6Properties ( iface , ifaced ) ; }

Target:
private void testUpdateInterface ( org.ovirt.engine.core.compat.Guid interface_id ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = dao.get ( interface_id ) ; iface.setName ( iface.getName ( ) . toUpperCase ( ) ) ; iface.setQos ( newQos ) ; dao.updateInterfaceForVds ( iface ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ifaced = dao.get ( interface_id ) ; org.junit.jupiter.api.Assertions.assertEquals ( iface.getName ( ) , ifaced.getName ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( iface.getQos ( ) , ifaced.getQos ( ) ) ; verifyIpv6Properties ( iface , ifaced ) ; }
Source:
protected void setUpGetPayloadExpectations ( int times ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , payload ) ; } }

Target:
private void setUpGetBallooningExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , true ) ; } }
Source:
protected boolean removeVmLease ( org.ovirt.engine.core.compat.Guid leaseStorageDomainId , org.ovirt.engine.core.compat.Guid vmId ) { if ( leaseStorageDomainId == null ) { return true ; } return runVdsCommand ( VDSCommandType.RemoveVmLease , new org.ovirt.engine.core.common.vdscommands.VmLeaseVDSParameters ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getStoragePoolId ( ) , leaseStorageDomainId , vmId ) ) . getSucceeded ( ) ; }

Target:
protected boolean removeVmLease ( org.ovirt.engine.core.compat.Guid leaseStorageDomainId , org.ovirt.engine.core.compat.Guid vmId ) { if ( leaseStorageDomainId == null ) { return true ; } return runInternalActionWithTasksContext ( VdcActionType.RemoveVmLease , new org.ovirt.engine.core.common.action.VmLeaseParameters ( getStoragePoolId ( ) , leaseStorageDomainId , vmId ) ) . getSucceeded ( ) ; }
Source:
private void setUpVolumeCreationExpectations ( boolean force ) { setUpCreationExpectations ( ActionType.CreateGlusterVolume , org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters.class , new java.lang.String [ ] { "Volume.Name" , "Volume.VolumeType" , "Force" } , new java.lang.Object [ ] { "testVol1" , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.DISTRIBUTE , force } , true , true , org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.volumeId , VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.volumeId } , getEntity ( 1 ) ) ; }

Target:
private void setUpVolumeCreationExpectations ( boolean force ) { setUpCreationExpectations ( ActionType.CreateGlusterVolume , org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters.class , new java.lang.String [ ] { "Volume.Name" , "Volume.VolumeType" , "Force" } , new java.lang.Object [ ] { "testVol1" , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.DISTRIBUTE , force } , true , true , org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.volumeId , QueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.volumeId } , getEntity ( 1 ) ) ; }
Source:
private java.util.List < java.lang.String > createLocaleKeys ( ) { java.util.List < java.lang.String > keys = new java.util.ArrayList < java.lang.String > ( ) ; keys.add ( "de_DE" ) ; keys.add ( "en_US" ) ; keys.add ( "es_ES" ) ; keys.add ( "fr_FR" ) ; keys.add ( "ja_JP" ) ; keys.add ( "ko_KR" ) ; keys.add ( "pt_BR" ) ; keys.add ( "zh_CN" ) ; return keys ; }

Target:
private java.util.List < java.lang.String > createLocaleKeys ( ) { java.util.List < java.lang.String > keys = new java.util.ArrayList < java.lang.String > ( ) ; keys.add ( "de_DE" ) ; keys.add ( "en_US" ) ; keys.add ( "es_ES" ) ; keys.add ( "fr_FR" ) ; keys.add ( "it_IT" ) ; keys.add ( "ja_JP" ) ; keys.add ( "ko_KR" ) ; keys.add ( "pt_BR" ) ; keys.add ( "zh_CN" ) ; return keys ; }
Source:
private java.lang.String offerHostId ( org.ovirt.engine.core.compat.Guid vdsGroupId ) { int i = 0 ; for ( org.ovirt.engine.core.common.businessentities.VDS host : dbFacade.getVdsDao ( ) . getAllForVdsGroup ( vdsGroupId ) ) { if ( ( host.getHighlyAvailableScore ( ) ) > 0 ) { i ++ ; } } return java.lang.String.valueOf ( ( i + 1 ) ) ; }

Target:
protected java.lang.String fromDeployAction ( org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration.Action deployAction ) { switch ( deployAction ) { case DEPLOY : return org.ovirt.ovirt_host_deploy.constants.Const.HOSTED_ENGINE_ACTION_DEPLOY ; case UNDEPLOY : return org.ovirt.ovirt_host_deploy.constants.Const.HOSTED_ENGINE_ACTION_REMOVE ; } return org.ovirt.ovirt_host_deploy.constants.Const.HOSTED_ENGINE_ACTION_NONE ; }
Source:
public void ClearTasks ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.CommandAsyncTask > CurrentActionTypeTasks = getCurrentTasks ( ) ; for ( org.ovirt.engine.core.bll.CommandAsyncTask task : CurrentActionTypeTasks ) { if ( ( task.getLastTaskStatus ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.finished ) ) { task.clearAsyncTask ( ) ; } } } }

Target:
public void ClearTasks ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.CommandAsyncTask > CurrentActionTypeTasks = getCurrentTasks ( ) ; for ( org.ovirt.engine.core.bll.CommandAsyncTask task : CurrentActionTypeTasks ) { if ( ( task.getLastTaskStatus ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.finished ) ) { task.clearAsyncTask ( ) ; _listTasks.remove ( task.getVdsmTaskId ( ) ) ; } } } }
Source:
protected org.ovirt.engine.core.common.businessentities.DbUser getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DbUser entity = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; entity.setuser_id ( GUIDS [ index ] ) ; entity.setname ( NAMES [ index ] ) ; entity.setgroups ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.GROUPS ) ; entity.setdomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.DbUser getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DbUser entity = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setFirstName ( NAMES [ index ] ) ; entity.setGroupNames ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.GROUPS ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; return entity ; }
Source:
public void testValidateDefaultFlagIsNotChangedWhenFlagChanged ( ) throws java.lang.Exception { final org.ovirt.engine.core.common.businessentities.MacPool macPool1 = new org.ovirt.engine.core.common.businessentities.MacPool ( ) ; final org.ovirt.engine.core.common.businessentities.MacPool macPool2 = new org.ovirt.engine.core.common.businessentities.MacPool ( ) ; macPool2.setDefaultPool ( ( ! ( macPool1.isDefaultPool ( ) ) ) ) ; org.junit.Assert.assertThat ( org.ovirt.engine.core.bll.UpdateMacPoolCommand.validateDefaultFlagIsNotChanged ( macPool1 , macPool2 ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_CHANGING_DEFAULT_MAC_POOL_IS_NOT_SUPPORTED ) ) ; }

Target:
public void testValidateDefaultFlagIsNotChangedWhenFlagChanged ( ) throws java.lang.Exception { final org.ovirt.engine.core.common.businessentities.MacPool macPool1 = new org.ovirt.engine.core.common.businessentities.MacPool ( ) ; final org.ovirt.engine.core.common.businessentities.MacPool macPool2 = new org.ovirt.engine.core.common.businessentities.MacPool ( ) ; macPool2.setDefaultPool ( ( ! ( macPool1.isDefaultPool ( ) ) ) ) ; org.junit.Assert.assertThat ( org.ovirt.engine.core.bll.UpdateMacPoolCommand.validateDefaultFlagIsNotChanged ( macPool1 , macPool2 ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_CHANGING_DEFAULT_MAC_POOL_IS_NOT_SUPPORTED ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn addVmLease ( java.lang.String leaseUUID , java.lang.String sdUUID ) { java.util.HashMap < java.lang.String , java.lang.Object > leaseDict = new java.util.HashMap < > ( ) ; leaseDict.put ( "lease_id" , leaseUUID ) ; leaseDict.put ( "sd_id" , sdUUID ) ; org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Lease.create" ) . withParameter ( "lease" , leaseDict ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.VmLeaseTaskInfoReturn addVmLease ( java.lang.String leaseUUID , java.lang.String sdUUID ) { java.util.HashMap < java.lang.String , java.lang.Object > leaseDict = new java.util.HashMap < > ( ) ; leaseDict.put ( "lease_id" , leaseUUID ) ; leaseDict.put ( "sd_id" , sdUUID ) ; org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Lease.create" ) . withParameter ( "lease" , leaseDict ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.VmLeaseTaskInfoReturn ( response ) ; }
Source:
public void testStorageDomainVmLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; vm.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_ID ) ; vm.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; vm.getStorageDomain ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; vm = org.ovirt.engine.api.common.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , vm ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_VM_HREF , vm.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_HREF , vm.getStorageDomain ( ) . getHref ( ) ) ; }

Target:
public void testStorageDomainVmLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; vm.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_ID ) ; vm.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; vm.getStorageDomain ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; vm = org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , vm ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_VM_HREF , vm.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_HREF , vm.getStorageDomain ( ) . getHref ( ) ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( sshPublicKey ) == null ? 0 : sshPublicKey.hashCode ( ) ) ; result = ( prime * result ) + ( ( loginName ) == null ? 0 : loginName.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( sshPublicKeyId ) == null ? 0 : sshPublicKeyId.hashCode ( ) ) ; result = ( prime * result ) + ( ( sshPublicKey ) == null ? 0 : sshPublicKey.hashCode ( ) ) ; result = ( prime * result ) + ( ( loginName ) == null ? 0 : loginName.hashCode ( ) ) ; return result ; }
Source:
public void testGetDefaultQuotaForDCWithDefaultQuotaWithNoReuse ( ) throws java.lang.Exception { org.mockito.Mockito.when ( quotaDAO.getDefaultQuotaByStoragePoolId ( storagePoolUUID ) ) . thenReturn ( mockGeneralStorageQuota ( ) ) ; org.ovirt.engine.core.common.businessentities.Quota quotaUnlimited = quotaHelper.getUnlimitedQuota ( mockStoragePool ( ) , true , false ) . getFirst ( ) ; assertQuotaUnlimited ( quotaUnlimited ) ; assertQuotaUnlimitedName ( quotaUnlimited ) ; }

Target:
public void testGetDefaultQuotaToDCWithoutDefaultQuotaWithNoReuse ( ) throws java.lang.Exception { java.lang.String defaultQuotaName = quotaHelper.getDefaultQuotaName ( storagePool.getname ( ) ) ; org.mockito.Mockito.when ( quotaHelper.generateDefaultQuotaName ( storagePool ) ) . thenReturn ( defaultQuotaName ) ; org.ovirt.engine.core.common.businessentities.Quota quotaUnlimited = quotaHelper.getUnlimitedQuota ( mockStoragePool ( ) , true , false ) . getFirst ( ) ; assertQuotaUnlimited ( quotaUnlimited ) ; assertQuotaUnlimitedName ( quotaUnlimited ) ; }