auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void setUpFactory ( org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand ... commands ) { org.mockito.stubbing.OngoingStubbing stubbing = org.mockito.Mockito.when ( commandFactory.createWrappedCommand ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.bll.context.CommandContext.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.ActionType.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) ; for ( org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand command : commands ) { stubbing = stubbing.thenReturn ( command ) ; } }

Target:
protected void setUpFactory ( org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand ... commands ) { org.mockito.stubbing.OngoingStubbing stubbing = org.mockito.Mockito.when ( commandFactory.createWrappedCommand ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.bll.context.CommandContext.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.ActionType.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.ActionParametersBase.class ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) ; for ( org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand command : commands ) { stubbing = stubbing.thenReturn ( command ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult isStorageDomainTypeFitsPoolIfMixed ( ) { boolean isBlockDomain = storageDomainStatic.getStorageType ( ) . isBlockDomain ( ) ; if ( ! ( isMixedTypesAllowedInDC ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageType > storageTypesOnPool = getStoragePoolDao ( ) . getStorageTypesInPool ( storagePool.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageType storageType : storageTypesOnPool ) { if ( ( storageType.isBlockDomain ( ) ) != isBlockDomain ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ; } } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isStorageDomainTypeFitsPoolIfMixed ( ) { boolean isBlockDomain = storageDomainStatic.getStorageType ( ) . isBlockDomain ( ) ; if ( ! ( isMixedTypesAllowedInDC ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.StorageType > storageTypesOnPool = getStoragePoolDao ( ) . getStorageTypesInPool ( storagePool.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType : storageTypesOnPool ) { if ( ( storageType.isBlockDomain ( ) ) != isBlockDomain ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ; } } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void updateChangeability ( org.ovirt.engine.core.common.queries.ConfigurationValues feature , org.ovirt.engine.core.compat.Version version ) { boolean featureSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( feature , version.getValue ( ) ) ) ) ; setIsChangable ( featureSupported ) ; setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . optionNotSupportedClusterVersionTooOld ( version.getValue ( ) ) ) ; }

Target:
public void updateChangeability ( org.ovirt.engine.core.common.queries.ConfigurationValues feature , org.ovirt.engine.core.compat.Version version ) { boolean featureSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( feature , version.getValue ( ) ) ) ) ; setIsChangeable ( featureSupported ) ; setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . optionNotSupportedClusterVersionTooOld ( version.getValue ( ) ) ) ; }
Source:
private java.lang.Object [ ] initDisksUsageData ( ) { java.lang.Object [ ] disksUsage = new java.lang.Object [ 2 ] ; disksUsage [ 0 ] = getDiskUsageAsMap ( "11704201216" , "FAT32" , "c:\\" , "9516027904" ) ; disksUsage [ 1 ] = getDiskUsageAsMap ( "133543936" , "CDFS" , "d:\\" , "133543936" ) ; return disksUsage ; }

Target:
private static java.lang.Object [ ] initDisksUsageData ( ) { java.lang.Object [ ] disksUsage = new java.lang.Object [ 2 ] ; disksUsage [ 0 ] = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getDiskUsageAsMap ( "11704201216" , "FAT32" , "c:\\" , "9516027904" ) ; disksUsage [ 1 ] = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getDiskUsageAsMap ( "133543936" , "CDFS" , "d:\\" , "133543936" ) ; return disksUsage ; }
Source:
public void EnsureAsyncSearchStopped ( ) { getTimer ( ) . stop ( ) ; if ( ( ( getAsyncResult ( ) ) != null ) && ( ! ( getAsyncResult ( ) . getId ( ) . equals ( NGuid.Empty ) ) ) ) { setAsyncResult ( null ) ; } }

Target:
public void stopRefresh ( ) { getTimer ( ) . stop ( ) ; }
Source:
public void canDoActionDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }

Target:
public void canDoActionDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { testFilter = new org.ovirt.engine.ui.frontend.server.gwt.GwtCachingFilter ( ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( GwtCachingFilter.CACHE_INIT_PARAM ) ) . thenReturn ( ".*\\.cache\\..*|.*\\/theme(-resource)?\\/.*|.*\\.(css|gif|png|favicon|js|ttf|woff|woff2)(\\?.*)?" ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( GwtCachingFilter.NO_CACHE_INIT_PARAM ) ) . thenReturn ( ".*WebAdmin\\.html|.*\\.nocache\\..*|.*\\/plugin\\/.*" ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( GwtCachingFilter.NO_STORE_INIT_PARAM ) ) . thenReturn ( ".*GenericApiGWTService" ) ; testFilter.init ( mockConfig ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { testFilter = new org.ovirt.engine.ui.frontend.server.caching.CachingFilter ( ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( CachingFilter.CACHE_INIT_PARAM ) ) . thenReturn ( ".*\\.cache\\..*|.*\\/theme(-resource)?\\/.*|.*\\.(css|gif|png|favicon|js|ttf|woff|woff2)(\\?.*)?" ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( CachingFilter.NO_CACHE_INIT_PARAM ) ) . thenReturn ( ".*WebAdmin\\.html|.*\\.nocache\\..*|.*\\/plugin\\/.*" ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( CachingFilter.NO_STORE_INIT_PARAM ) ) . thenReturn ( ".*GenericApiGWTService" ) ; testFilter.init ( mockConfig ) ; }
Source:
public static void GetLocalFSPath ( 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.RhevhLocalFSPath , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetStorageDomainList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel createModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior ) { final org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setcompatibility_version ( Version.v3_5 ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ( behavior ) { @ java.lang.Override public org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > getIsSingleQxlEnabled ( ) { return new org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > ( true ) ; } @ java.lang.Override public org.ovirt.engine.core.common.businessentities.VDSGroup getSelectedCluster ( ) { return cluster ; } } ; model.initialize ( null ) ; return model ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel createModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior ) { final org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setCompatibilityVersion ( Version.v3_5 ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ( behavior ) { @ java.lang.Override public org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > getIsSingleQxlEnabled ( ) { return new org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > ( true ) ; } @ java.lang.Override public org.ovirt.engine.core.common.businessentities.VDSGroup getSelectedCluster ( ) { return cluster ; } } ; model.initialize ( null ) ; return model ; }
Source:
protected void executeVdsBrokerCommand ( ) { infoReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetStatsVDSCommand.getBroker ( ) . getVdsStats ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetStatsVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVDSStatisticsData ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStatsVDSCommand.getVds ( ) , infoReturn.info ) ; multipathHealthHandler.handleMultipathHealthReport ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStatsVDSCommand.getVds ( ) , infoReturn.info ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.checkTimeDrift ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStatsVDSCommand.getVds ( ) , infoReturn.info ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { infoReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetStatsVDSCommand.getBroker ( ) . getVdsStats ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetStatsVDSCommand.proceedProxyReturnValue ( ) ; vdsBrokerObjectsBuilder.updateVDSStatisticsData ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStatsVDSCommand.getVds ( ) , infoReturn.info ) ; multipathHealthHandler.handleMultipathHealthReport ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStatsVDSCommand.getVds ( ) , infoReturn.info ) ; vdsBrokerObjectsBuilder.checkTimeDrift ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStatsVDSCommand.getVds ( ) , infoReturn.info ) ; }
Source:
public java.lang.Void runInTransaction ( ) { vmDevice.setIsPlugged ( ( ( getParameters ( ) . getAction ( ) ) == ( org.ovirt.engine.core.common.action.PlugAction.PLUG ) ? true : false ) ) ; getVmDeviceDao ( ) . update ( vmDevice ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { vmDevice.setIsPlugged ( ( ( getParameters ( ) . getAction ( ) ) == ( org.ovirt.engine.core.common.action.PlugAction.PLUG ) ? true : false ) ) ; getVmDeviceDao ( ) . update ( vmDevice ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateBootOrderInVmDeviceAndStoreToDB ( getVm ( ) . getStaticData ( ) ) ; return null ; }
Source:
private boolean userHasPermissions ( org.ovirt.engine.core.domains.DomainsConfigurationEntry adUserNameEntry , org.ovirt.engine.core.domains.DomainsConfigurationEntry adUseridEntry ) { try { java.util.Set < java.util.Map.Entry < java.lang.String , java.lang.String > > userNameValues = adUserNameEntry.getValues ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > currUserEntry : userNameValues ) { java.lang.String currDomain = currUserEntry.getKey ( ) ; java.lang.String currUser = currUserEntry.getValue ( ) ; if ( daoImpl.getUserHasPermissions ( currUser , currDomain ) ) { return true ; } } } catch ( java.sql.SQLException e ) { org.ovirt.engine.core.domains.ManageDomains.log.error ( e ) ; } return false ; }

Target:
private org.ovirt.engine.core.domains.ManageDomainsResult updatePermissionsTable ( java.lang.String userName , java.lang.String domainName , java.lang.String adUserId ) { try { daoImpl.updatePermissionsTable ( adUserId , userName , domainName ) ; return OK_RESULT ; } catch ( java.sql.SQLException e ) { return new org.ovirt.engine.core.domains.ManageDomainsResult ( ManageDomainsResultEnum.FAILURE_WHILE_APPLYING_CHANGES_IN_DATABASE , e.getMessage ( ) ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.StoragePool createNewStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.createBasicPool ( ) ; pool.setIsLocal ( false ) ; pool.setcompatibility_version ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.VERSION_1_1 ) ; return pool ; }

Target:
private void addNonDefaultClusterToPool ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup defaultCluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; defaultCluster.setCompatibilityVersion ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.VERSION_1_1 ) ; defaultCluster.setId ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.NON_DEFAULT_VDS_GROUP_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = new java.util.ArrayList < > ( ) ; clusters.add ( defaultCluster ) ; org.mockito.Mockito.when ( vdsGroupDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( clusters ) ; }
Source:
public java.lang.String getMethodName ( org.ovirt.api.metamodel.concepts.Name name ) { java.lang.String result = javaNames.getJavaMemberStyleName ( name ) ; if ( result.endsWith ( "_" ) ) { result = "do" + ( words.capitalize ( result.substring ( 0 , ( ( result.length ( ) ) - 1 ) ) ) ) ; } return result ; }

Target:
public java.lang.String getMethodName ( org.ovirt.api.metamodel.concepts.Name name ) { java.lang.String result = javaNames.getJavaMemberStyleName ( name ) ; if ( javaReservedWords.contains ( result ) ) { result = "do" + ( words.capitalize ( result ) ) ; } return result ; }
Source:
public org.ovirt.engine.api.model.Tag get ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Tags > tags = getBackendCollection ( org.ovirt.engine.core.common.businessentities.Tags.class , VdcQueryType.GetTagsByVmId , new org.ovirt.engine.core.common.queries.GetTagsByVmIdParameters ( vmId.toString ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : tags ) { if ( tag.gettag_id ( ) . equals ( guid ) ) { return addLinks ( populate ( map ( tag , null ) , tag ) ) ; } } return notFound ( ) ; }

Target:
public org.ovirt.engine.api.model.Tag get ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Tags > tags = getBackendCollection ( org.ovirt.engine.core.common.businessentities.Tags.class , VdcQueryType.GetTagsByVmId , new org.ovirt.engine.core.common.queries.GetTagsByVmIdParameters ( vmId.toString ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : tags ) { if ( tag.getTagId ( ) . equals ( guid ) ) { return addLinks ( populate ( map ( tag , null ) , tag ) ) ; } } return notFound ( ) ; }
Source:
public void notHostedEngineVM ( ) { vm.setOrigin ( OriginType.OVIRT ) ; org.assertj.core.api.Assertions.assertThatThrownBy ( ( ) -> new org.ovirt.engine.core.utils.ovf.HostedEngineOvfWriter ( vm , images , version , emulatedMachine , cpuId , osRepository ) ) . isInstanceOf ( java.lang.IllegalArgumentException.class ) . hasMessageContaining ( "Hosted Engine" ) ; }

Target:
public void notHostedEngineVM ( ) { vm.setOrigin ( OriginType.OVIRT ) ; org.assertj.core.api.Assertions.assertThatThrownBy ( ( ) -> new org.ovirt.engine.core.utils.ovf.HostedEngineOvfWriter ( vm , images , luns , version , emulatedMachine , cpuId , osRepository ) ) . isInstanceOf ( java.lang.IllegalArgumentException.class ) . hasMessageContaining ( "Hosted Engine" ) ; }
Source:
private boolean isTemplateInDestStorageDomain ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid sourceDomainId ) { org.ovirt.engine.core.compat.Guid templateId = getDiskImageByImageId ( imageId ) . getImageTemplateId ( ) ; if ( ! ( Guid.Empty.equals ( templateId ) ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage templateImage = org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getDiskImageDao ( ) . get ( templateId ) ; if ( ! ( templateImage.getStorageIds ( ) . contains ( sourceDomainId ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN ) ; } } return true ; }

Target:
private boolean isTemplateInDestStorageDomain ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid sourceDomainId ) { org.ovirt.engine.core.compat.Guid templateId = getDiskImageByImageId ( imageId ) . getImageTemplateId ( ) ; if ( ! ( Guid.Empty.equals ( templateId ) ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage templateImage = org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getDiskImageDao ( ) . get ( templateId ) ; if ( ! ( templateImage.getStorageIds ( ) . contains ( sourceDomainId ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN ) ; } } return true ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success , java.lang.Object taskReturn , boolean replay ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , taskReturn , null , replay ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success , boolean reply , java.lang.String errorMessage ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , null , reply , errorMessage ) ; }
Source:
public void testAddLunDiskMissingId ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setId ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddLunDiskMissingId" , "id" ) ; } }

Target:
public void testAddIscsiLunDiskIncompleteParametersConnectionAddress ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setAddress ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddIscsiLunDiskIncompleteParametersConnectionAddress" , "address" ) ; } }
Source:
public void test32BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVdsGroupCompatibilityVersion ( Version.v3_3 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_32_BIT ) + 1 ) ) ; mockOsRepository ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , VdcBllMessages.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }

Target:
public void test32BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVdsGroupCompatibilityVersion ( Version.v3_3 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_32_BIT ) + 1 ) ) ; mockOsRepository ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }
Source:
protected void executeCommand ( ) { try { addVmToDb ( ) ; processImages ( ) ; org.ovirt.engine.core.bll.VmHandler.addVmInitToDB ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.ImportVmCommandBase.getMacPool ( ) . freeMacs ( macsAdded ) ; throw e ; } org.ovirt.engine.core.bll.ImportVmCommandBase.setSucceeded ( true ) ; }

Target:
protected boolean validate ( ) { macPool = org.ovirt.engine.core.bll.ImportVmCommandBase.getMacPool ( ) ; if ( ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY ) ; } return true ; }
Source:
protected void setUpGetGraphicsExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetGraphicsDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } }

Target:
protected void setUpGetGraphicsMultipleExpectations ( int times ) throws java.lang.Exception { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > > vmDevices = new java.util.HashMap < > ( ) ; for ( int i = 0 ; i < times ; i ++ ) { vmDevices.put ( GUIDS [ i ] , java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } setUpGetEntityExpectations ( VdcQueryType.GetGraphicsDevicesMultiple , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , vmDevices ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.Permissions list ( ) { java.util.Set < org.ovirt.engine.core.common.businessentities.Permissions > permissions = new java.util.TreeSet < org.ovirt.engine.core.common.businessentities.Permissions > ( new org.ovirt.engine.api.restapi.resource.BackendAssignedPermissionsResource.PermissionsComparator ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > directPermissions = getBackendCollection ( queryType , queryParams ) ; permissions.addAll ( directPermissions ) ; if ( queryType.equals ( VdcQueryType.GetPermissionsForObject ) ) { permissions.addAll ( getInheritedPermissions ( ) ) ; } return mapCollection ( permissions ) ; }

Target:
public org.ovirt.engine.api.model.Permissions list ( ) { java.util.Set < org.ovirt.engine.api.model.Permission > permissions = new java.util.TreeSet ( new org.ovirt.engine.api.restapi.resource.BackendAssignedPermissionsResource.PermissionsComparator ( ) ) ; java.util.List < org.ovirt.engine.api.model.Permission > directPermissions = getBackendCollection ( queryType , queryParams ) ; permissions.addAll ( directPermissions ) ; if ( queryType.equals ( VdcQueryType.GetPermissionsForObject ) ) { permissions.addAll ( getInheritedPermissions ( ) ) ; } return mapCollection ( permissions ) ; }
Source:
protected int getNeededDiskSize ( org.ovirt.engine.core.compat.Guid storageDomainId ) { int result = 0 ; for ( org.ovirt.engine.core.common.businessentities.DiskImage img : getDiskImagesFromConfiguration ( ) ) { if ( ( img.getImageStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.ImageStatus.ILLEGAL ) ) { if ( img.getStorageIds ( ) . get ( 0 ) . equals ( storageDomainId ) ) { result = result + ( ( int ) ( java.lang.Math.ceil ( img.getActualSize ( ) ) ) ) ; } } } return result ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getAllImageSnapshots ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { return org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots ( diskImage.getImageId ( ) , diskImage.getImageTemplateId ( ) ) ; }
Source:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { setUpEntityQueryExpectations ( times , null ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpInterfaces ( ) , failure ) ; control.replay ( ) ; }
Source:
public void testGetStorageConnectionNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingStorageConnection ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.STORAGE_CONNECTION_ID.toString ( ) } , null ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetStorageConnectionNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingStorageConnection ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.STORAGE_CONNECTION_ID.toString ( ) } , null ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: get ) ) ; }
Source:
public void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
public void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.GetProviderCertificateChainText , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { setIsFingerprintVerified ( false ) ; fetchFingerprint ( ( ( java.lang.String ) ( getGlusterHostAddress ( ) . getEntity ( ) ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { setIsFingerprintVerified ( false ) ; if ( ( ( getGlusterHostAddress ( ) . getEntity ( ) ) == null ) || ( ( ( ( java.lang.String ) ( getGlusterHostAddress ( ) . getEntity ( ) ) ) . trim ( ) . length ( ) ) == 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( "" ) ; return ; } fetchFingerprint ( ( ( java.lang.String ) ( getGlusterHostAddress ( ) . getEntity ( ) ) ) ) ; }
Source:
private void updateActionAvailability ( ) { java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > > selectedItems = ( ( getSelectedItems ( ) ) != null ) ? getSelectedItems ( ) : new java.util.ArrayList ( ) ; getSetupNetworksCommand ( ) . setIsExecutionAllowed ( ( ( ( selectedItems.size ( ) ) == 1 ) && ( ( selectedItems.get ( 0 ) . getSecond ( ) . getvds_group_compatibility_version ( ) . compareTo ( Version.v3_1 ) ) >= 0 ) ) ) ; }

Target:
private void updateActionAvailability ( ) { java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > > selectedItems = ( ( getSelectedItems ( ) ) != null ) ? getSelectedItems ( ) : new java.util.ArrayList ( ) ; getSetupNetworksCommand ( ) . setIsExecutionAllowed ( ( ( ( selectedItems.size ( ) ) == 1 ) && ( ( selectedItems.get ( 0 ) . getSecond ( ) . getVdsGroupCompatibilityVersion ( ) . compareTo ( Version.v3_1 ) ) >= 0 ) ) ) ; }
Source:
private void updatePmTypeList ( java.util.List < java.lang.String > pmTypes , org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > model ) { java.lang.String pmType = model.getSelectedItem ( ) ; model.setItems ( pmTypes ) ; if ( pmTypes.contains ( pmType ) ) { model.setSelectedItem ( pmType ) ; } }

Target:
private void updatePmTypeList ( java.util.List < java.lang.String > pmTypes ) { getFenceAgentListModel ( ) . setPmTypes ( pmTypes ) ; }
Source:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.UnLockVmTemplate ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full endAction" ) ; } }

Target:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.unlockVmTemplate ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full endAction" ) ; } }
Source:
private java.lang.String readEventLogValue ( org.ovirt.engine.core.utils.ovf.xml.XmlNode content , java.lang.String name ) { java.lang.StringBuilder fullNameSB = new java.lang.StringBuilder ( org.ovirt.engine.core.utils.ovf.OvfVmReader.EXPORT_ONLY_PREFIX ) ; fullNameSB.append ( name ) ; org.ovirt.engine.core.utils.ovf.xml.XmlNode node = content.SelectSingleNode ( fullNameSB.toString ( ) ) ; if ( node != null ) { return node.innerText ; } return null ; }

Target:
private java.lang.String readEventLogValue ( org.ovirt.engine.core.utils.ovf.xml.XmlNode content , java.lang.String name ) { java.lang.StringBuilder fullNameSB = new java.lang.StringBuilder ( org.ovirt.engine.core.utils.ovf.OvfVmReader.EXPORT_ONLY_PREFIX ) ; fullNameSB.append ( name ) ; org.ovirt.engine.core.utils.ovf.xml.XmlNode node = selectSingleNode ( content , fullNameSB.toString ( ) ) ; if ( node != null ) { return node.innerText ; } return null ; }
Source:
public void setDisplayNetwork ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model , boolean value ) { if ( ! ( isMultiDisplay ( ) ) ) { if ( ( getDisplayNetwork ( ) ) != null ) { getDisplayNetwork ( ) . setDisplayNetwork ( ( ! value ) ) ; } } model.setDisplayNetwork ( value ) ; }

Target:
public void setDisplayNetwork ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model , boolean value ) { if ( ! ( isMultiCluster ( ) ) ) { if ( ( getDisplayNetwork ( ) ) != null ) { getDisplayNetwork ( ) . setDisplayNetwork ( ( ! value ) ) ; } } model.setDisplayNetwork ( value ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileInfo populateBrickNames ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileInfo profileInfo ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails > brickProfiles = profileInfo.getBrickProfileDetails ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails brickProfileDetails : brickProfiles ) { brickProfileDetails.setIdentity ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQuery.getGlusterBrickDao ( ) . getById ( brickProfileDetails.getBrickId ( ) ) . getQualifiedName ( ) ) ; } return profileInfo ; }

Target:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileInfo populateBrickNames ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileInfo profileInfo ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails > brickProfiles = profileInfo.getBrickProfileDetails ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails brickProfileDetails : brickProfiles ) { brickProfileDetails.setIdentity ( glusterBrickDao.getById ( brickProfileDetails.getBrickId ( ) ) . getQualifiedName ( ) ) ; } return profileInfo ; }
Source:
public void testListCrash ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; collection.setUriInfo ( uriInfo ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; }
Source:
private void proxyUp ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > model ) { if ( ( listModel.getItems ( ) ) == null ) { return ; } java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > list = new java.util.ArrayList ( listModel.getItems ( ) ) ; int selectedItemIndex = list.indexOf ( model ) ; if ( selectedItemIndex > 0 ) { list.remove ( selectedItemIndex ) ; list.add ( ( selectedItemIndex - 1 ) , model ) ; listModel.setItems ( list ) ; listModel.setSelectedItem ( model ) ; } }

Target:
private void proxyUp ( org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel model ) { if ( ( listModel.getItems ( ) ) == null ) { return ; } java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel > list = new java.util.ArrayList ( listModel.getItems ( ) ) ; int selectedItemIndex = list.indexOf ( model ) ; if ( selectedItemIndex > 0 ) { list.remove ( selectedItemIndex ) ; list.add ( ( selectedItemIndex - 1 ) , model ) ; listModel.setItems ( list ) ; listModel.setSelectedItem ( model ) ; } }
Source:
private boolean isConsoleEditEnabled ( ) { return ( ( getSelectedItem ( ) ) != null ) && ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getSelectedItem ( ) ) ) . isRunningOrPaused ( ) ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = super . validate ( value ) ; if ( ! ( result.getSuccess ( ) ) ) { result.getReasons ( ) . add ( getSuffixCauseToClonedNameCollisionMessage ( ( ( java.lang.String ) ( value ) ) ) ) ; } return result ; }
Source:
private void preview ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = ( ( org.ovirt.engine.core.common.businessentities.Snapshot ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.TryBackToAllSnapshotsOfVm , new org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters ( vm.getId ( ) , snapshot.getId ( ) ) , null , null ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { model.stopProgress ( ) ; cancel ( ) ; }
Source:
public void initCdImage ( ) { updateUserCdImage ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getModel ( ) . getDataCenter ( ) . getSelectedItem ( ) ) ) . getId ( ) ) ; }

Target:
public void initCdImage ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( getModel ( ) . getDataCenterWithClustersList ( ) . getSelectedItem ( ) ) ) ; if ( ( dataCenterWithCluster == null ) || ( ( dataCenterWithCluster.getDataCenter ( ) ) == null ) ) { return ; } updateUserCdImage ( dataCenterWithCluster.getDataCenter ( ) . getId ( ) ) ; }
Source:
private < K , I > java.util.Map < K , I > group ( org.ovirt.engine.core.common.utils.MapNetworkAttachments.CalculateKey < I , K > calculateKey , java.util.List < I > instances ) { java.util.Map < K , I > result = new java.util.HashMap < > ( instances.size ( ) ) ; for ( I instance : instances ) { result.put ( calculateKey.keyFrom ( instance ) , instance ) ; } return result ; }

Target:
private < K , I > java.util.Map < K , I > group ( org.ovirt.engine.core.common.utils.MapNetworkAttachments.CalculateKey < I , K > calculateKey , java.util.Collection < I > instances ) { java.util.Map < K , I > result = new java.util.HashMap < > ( instances.size ( ) ) ; for ( I instance : instances ) { result.put ( calculateKey.keyFrom ( instance ) , instance ) ; } return result ; }
Source:
private void testValidSql ( java.lang.String dynamicQuery , java.lang.String exepctedSQLResult ) { org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( 20 ) ; org.ovirt.engine.core.searchbackend.ISyntaxChecker curSyntaxChecker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createBackendSyntaxChecker ( "foo" ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = curSyntaxChecker.analyzeSyntaxState ( dynamicQuery , true ) ; org.junit.Assert.assertTrue ( ( "Invalid syntax: " + dynamicQuery ) , res.getvalid ( ) ) ; java.lang.String query = chkr.generateQueryFromSyntaxContainer ( res , true ) ; org.junit.Assert.assertEquals ( exepctedSQLResult , query ) ; }

Target:
private void testValidSql ( java.lang.String dynamicQuery , java.lang.String exepctedSQLResult ) { org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( 20 ) ; org.ovirt.engine.core.searchbackend.ISyntaxChecker curSyntaxChecker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createBackendSyntaxChecker ( "foo" ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = curSyntaxChecker.analyzeSyntaxState ( dynamicQuery , true ) ; org.junit.Assert.assertTrue ( ( "Invalid syntax: " + dynamicQuery ) , res.getvalid ( ) ) ; java.lang.String query = chkr.generateQueryFromSyntaxContainer ( res , true ) ; java.lang.System.out.println ( query ) ; org.junit.Assert.assertEquals ( exepctedSQLResult , query ) ; }
Source:
protected void setReadOnlyTemplateWithVersion ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion templateCouple ) { getModel ( ) . getTemplateWithVersion ( ) . setItems ( java.util.Collections.singleton ( templateCouple ) ) ; getModel ( ) . getTemplateWithVersion ( ) . setSelectedItem ( templateCouple ) ; getModel ( ) . getTemplateWithVersion ( ) . setIsChangable ( false ) ; }

Target:
protected void setReadOnlyTemplateWithVersion ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion templateCouple ) { getModel ( ) . getTemplateWithVersion ( ) . setItems ( java.util.Collections.singleton ( templateCouple ) ) ; getModel ( ) . getTemplateWithVersion ( ) . setSelectedItem ( templateCouple ) ; getModel ( ) . getTemplateWithVersion ( ) . setIsChangeable ( false ) ; }
Source:
protected boolean getIsNodeEnabled ( org.ovirt.engine.core.common.businessentities.DiskImage disk ) { if ( ( listModel.getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.Quota ) { return true ; } return disk.getstorage_ids ( ) . contains ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( listModel.getEntity ( ) ) ) . getImageId ( ) ) ; }

Target:
protected boolean getIsNodeEnabled ( org.ovirt.engine.core.common.businessentities.DiskImage disk ) { if ( ( listModel.getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.Quota ) { return true ; } return disk.getstorage_ids ( ) . contains ( ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( listModel.getEntity ( ) ) ) . getId ( ) ) ; }
Source:
public void diskPluggedToVmsCheckSnapshotsFail ( ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > vmsInfo = prepareForCheckingIfDiskPluggedToVmsThatAreNotDown ( ) ; vmsInfo.get ( 1 ) . getFirst ( ) . setStatus ( VMStatus.Up ) ; vmsInfo.get ( 1 ) . getSecond ( ) . setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( validator.isDiskPluggedToVmsThatAreNotDown ( true , vmsInfo ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) ; }

Target:
public void diskPluggedToVmsCheckSnapshotsFail ( ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > vmsInfo = prepareForCheckingIfDiskPluggedToVmsThatAreNotDown ( ) ; vmsInfo.get ( 1 ) . getFirst ( ) . setStatus ( VMStatus.Up ) ; vmsInfo.get ( 1 ) . getSecond ( ) . setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( validator.isDiskPluggedToVmsThatAreNotDown ( true , vmsInfo ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) ; }
Source:
private void assertGetDiscardAfterDeleteLegalForNewBlockStorageDomainPredicate ( boolean allLunsSupportDiscard ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidatorTest.injectorRule.bind ( org.ovirt.engine.core.bll.storage.utils.BlockStorageDiscardFunctionalityHelper.class , discardFunctionalityHelper ) ; org.mockito.Mockito.when ( discardFunctionalityHelper.allLunsSupportDiscard ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( allLunsSupportDiscard ) ; org.junit.Assert.assertEquals ( validator.getDiscardAfterDeleteLegalForNewBlockStorageDomainPredicate ( java.util.Collections.emptyList ( ) ) . get ( ) , allLunsSupportDiscard ) ; }

Target:
private void assertGetDiscardAfterDeleteLegalForNewBlockStorageDomainPredicate ( boolean allLunsSupportDiscard ) { org.mockito.Mockito.when ( discardFunctionalityHelper.allLunsSupportDiscard ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( allLunsSupportDiscard ) ; org.junit.jupiter.api.Assertions.assertEquals ( validator.getDiscardAfterDeleteLegalForNewBlockStorageDomainPredicate ( java.util.Collections.emptyList ( ) ) . get ( ) , allLunsSupportDiscard ) ; }