auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected static int getNumOfPrestartedVmsInPool ( org.ovirt.engine.core.compat.NGuid poolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsInPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . getAllForVmPool ( poolId ) ; int numOfPrestartedVmsInPool = 0 ; if ( vmsInPool != null ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsInPool ) { if ( ( vm.isStartingOrUp ( ) ) && ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( vm.getId ( ) ) ) ) ++ numOfPrestartedVmsInPool ; } } return numOfPrestartedVmsInPool ; }

Target:
protected static int getNumOfPrestartedVmsInPool ( org.ovirt.engine.core.compat.Guid poolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsInPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . getAllForVmPool ( poolId ) ; int numOfPrestartedVmsInPool = 0 ; if ( vmsInPool != null ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsInPool ) { if ( ( vm.isStartingOrUp ( ) ) && ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( vm.getId ( ) ) ) ) ++ numOfPrestartedVmsInPool ; } } return numOfPrestartedVmsInPool ; }
Source:
private void initNetworkModels ( ) { java.util.Map < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > networkModels = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Network network : allNetworks ) { networkModels.put ( network.getname ( ) , new org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ( network , this ) ) ; } setNetworks ( networkModels ) ; }

Target:
private void initNetworkModels ( ) { java.util.Map < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > networkModels = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allNetworks ) { networkModels.put ( network.getname ( ) , new org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ( network , this ) ) ; } setNetworks ( networkModels ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.network.VmNetworkStatistics stats ) { return createIdParameterMapper ( stats.getId ( ) ) . addValue ( "rx_drop" , stats.getReceiveDropRate ( ) ) . addValue ( "rx_rate" , stats.getReceiveRate ( ) ) . addValue ( "tx_drop" , stats.getTransmitDropRate ( ) ) . addValue ( "tx_rate" , stats.getTransmitRate ( ) ) . addValue ( "iface_status" , stats.getStatus ( ) ) . addValue ( "vm_id" , stats.getVmId ( ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.network.VmNetworkStatistics stats ) { return super . createFullParametersMapper ( stats ) . addValue ( "vm_id" , stats.getVmId ( ) ) ; }
Source:
public void newNetworkQoS ( ) { if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NewNetworkQoSModel newNetworkQoSModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.NewNetworkQoSModel ( this , getEntity ( ) ) ; setWindow ( newNetworkQoSModel ) ; newNetworkQoSModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) ) ; newNetworkQoSModel.getDataCenters ( ) . setSelectedItem ( getEntity ( ) ) ; }

Target:
public void newNetworkQoS ( ) { if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NewNetworkQoSModel newNetworkQoSModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.NewNetworkQoSModel ( this , getEntity ( ) ) ; setWindow ( newNetworkQoSModel ) ; newNetworkQoSModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) , getEntity ( ) ) ; }
Source:
private void initManualWidgets ( ) { nicTypeEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer ( ) ) ; pluggedEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "cardStatus" ) ; unpluggedEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "cardStatus" ) ; linkedEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "linkState" ) ; unlinkedEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "linkState" ) ; enableManualMacCheckbox = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }

Target:
private void initManualWidgets ( ) { nicTypeEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer ( ) ) ; pluggedEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "cardStatus" ) ; unpluggedEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "cardStatus" ) ; linkedEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "linkState" ) ; unlinkedEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "linkState" ) ; enableManualMacCheckbox = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }
Source:
public java.lang.Void extendDisk ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk , final int newSize ) { return execute ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) { proxy.extendVolume ( cinderDisk.getImageId ( ) . toString ( ) , newSize ) ; return null ; } } ) ; }

Target:
public java.lang.Void extendDisk ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk , final int newSize ) { return execute ( ( ) -> { proxy.extendVolume ( cinderDisk.getImageId ( ) . toString ( ) , newSize ) ; return null ; } ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private void queryLabels ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getNetworkLabelsByDataCenterId ( getEntity ( ) . getStoragePoolId ( ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { dcLabels = ( ( java.util.SortedSet < java.lang.String > ) ( returnValue ) ) ; initNicModels ( ) ; stopProgress ( ) ; } } ) ) ; }

Target:
private void queryLabels ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNetworkLabelsByDataCenterId ( getEntity ( ) . getStoragePoolId ( ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { dcLabels = ( ( java.util.SortedSet < java.lang.String > ) ( returnValue ) ) ; initNicModels ( ) ; stopProgress ( ) ; } } ) ) ; }
Source:
public void testSwitchStorageDomainType ( ) { org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void testSwitchStorageDomainType ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
protected boolean canAddVm ( ) { boolean exists = ( ( java.lang.Boolean ) ( getBackend ( ) . runInternalQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmWithSameNameExistParameters ( getVm ( ) . getVmName ( ) ) ) . getReturnValue ( ) ) ) ; if ( exists ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_IMPORT_VM_NAME_EXISTS ) ; } return ! exists ; }

Target:
protected boolean canAddVm ( ) { boolean exists = ( ( java.lang.Boolean ) ( getBackend ( ) . runInternalQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmWithSameNameExistParameters ( getVm ( ) . getName ( ) ) ) . getReturnValue ( ) ) ) ; if ( exists ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_IMPORT_VM_NAME_EXISTS ) ; } return ! exists ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareSharedStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { final org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( status , "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.Collections.singletonList ( sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return sharedDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareSharedStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { final org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( status , "shared domain name" , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return sharedDomain ; }
Source:
private void updateVfsConfigWithNumOfVfsData ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig hostNicVfsConfig , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > deviceList ) { if ( nic == null ) { nic = getNicById ( hostNicVfsConfig.getNicId ( ) ) ; } org.ovirt.engine.core.common.businessentities.HostDevice pciDevice = getPciDeviceByNic ( nic , deviceList ) ; hostNicVfsConfig.setMaxNumOfVfs ( getMaxNumOfVfs ( pciDevice ) ) ; hostNicVfsConfig.setNumOfVfs ( getNumOfVfs ( nic.getName ( ) , pciDevice , deviceList ) ) ; }

Target:
private void updateVfsConfigWithNumOfVfsData ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig hostNicVfsConfig , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > deviceList ) { if ( nic == null ) { nic = getNicById ( hostNicVfsConfig.getNicId ( ) ) ; } org.ovirt.engine.core.common.businessentities.HostDevice pciDevice = getPciDeviceByNic ( nic , deviceList ) ; hostNicVfsConfig.setMaxNumOfVfs ( getMaxNumOfVfs ( pciDevice ) ) ; hostNicVfsConfig.setNumOfVfs ( getNumOfVfs ( pciDevice , deviceList ) ) ; }
Source:
private void initializeOsRepository ( int osId , org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface ) { java.util.ArrayList < java.lang.String > supportedDiskInterfaces = new java.util.ArrayList < > ( ) ; supportedDiskInterfaces.add ( diskInterface.name ( ) ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( 1 , null ) ) . thenReturn ( supportedDiskInterfaces ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( 2 , null ) ) . thenReturn ( new java.util.ArrayList < > ( ) ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }

Target:
private void initializeOsRepository ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface ) { java.util.ArrayList < java.lang.String > supportedDiskInterfaces = new java.util.ArrayList < > ( ) ; supportedDiskInterfaces.add ( diskInterface.name ( ) ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( 1 , null ) ) . thenReturn ( supportedDiskInterfaces ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( 2 , null ) ) . thenReturn ( new java.util.ArrayList < > ( ) ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.StoragePool dc ) { setEnumTitle ( dc.getstatus ( ) ) ; switch ( dc.getstatus ( ) ) { case Contend : return getApplicationResources ( ) . waitImage ( ) ; case Maintenance : return getApplicationResources ( ) . maintenanceImage ( ) ; case NotOperational : case NonResponsive : case Uninitialized : return getApplicationResources ( ) . downImage ( ) ; case Up : return getApplicationResources ( ) . upImage ( ) ; default : break ; } return null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.StoragePool dc ) { setEnumTitle ( dc.getStatus ( ) ) ; switch ( dc.getStatus ( ) ) { case Contend : return getApplicationResources ( ) . waitImage ( ) ; case Maintenance : return getApplicationResources ( ) . maintenanceImage ( ) ; case NotOperational : case NonResponsive : case Uninitialized : return getApplicationResources ( ) . downImage ( ) ; case Up : return getApplicationResources ( ) . upImage ( ) ; default : break ; } return null ; }
Source:
protected boolean canDoAction ( ) { boolean retVal = true ; java.util.List < java.lang.String > canDoActionMessages = getReturnValue ( ) . getCanDoActionMessages ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > domainsMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; retVal = canDoAction_beforeCloneVm ( domainsMap ) ; if ( retVal && ( getParameters ( ) . isImportAsNewEntity ( ) ) ) { initImportClonedVm ( ) ; } return retVal && ( canDoAction_afterCloneVm ( canDoActionMessages , domainsMap ) ) ; }

Target:
protected boolean canDoAction ( ) { boolean retVal = true ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > domainsMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; retVal = canDoAction_beforeCloneVm ( domainsMap ) ; if ( retVal && ( getParameters ( ) . isImportAsNewEntity ( ) ) ) { initImportClonedVm ( ) ; } return retVal && ( canDoAction_afterCloneVm ( domainsMap ) ) ; }
Source:
private void mockVmValidator ( ) { org.ovirt.engine.core.bll.validator.VmValidator vmValidator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.VmValidator ( vm ) ) ; org.mockito.Mockito.doReturn ( vmValidator ) . when ( command ) . createVmValidator ( vm ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( vmValidator ) . getDiskDao ( ) ; org.mockito.Mockito.doReturn ( getNoVirtioScsiDiskElement ( ) ) . when ( diskVmElementDao ) . get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmDeviceId.class ) ) ; org.mockito.Mockito.doReturn ( diskVmElementDao ) . when ( vmValidator ) . getDiskVmElementDao ( ) ; }

Target:
private void mockVmValidator ( ) { org.ovirt.engine.core.bll.validator.VmValidator vmValidator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.VmValidator ( vm ) ) ; org.mockito.Mockito.doReturn ( vmValidator ) . when ( command ) . createVmValidator ( vm ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( vmValidator ) . getDiskDao ( ) ; org.mockito.Mockito.doReturn ( getNoVirtioScsiDiskElement ( ) ) . when ( diskVmElementDao ) . get ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.doReturn ( diskVmElementDao ) . when ( vmValidator ) . getDiskVmElementDao ( ) ; }
Source:
public void testNullDisksUsages ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics vmStatistics = getVmStatistics ( ) ; java.lang.Object [ ] disksUsages = null ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksUsageInXmlRpc ( disksUsages ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMStatisticsData ( vmStatistics , xml ) ; org.junit.Assert.assertEquals ( null , vmStatistics.getDisksUsage ( ) ) ; }

Target:
public void testNullDisksUsages ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics vmStatistics = getVmStatistics ( ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksUsageInXmlRpc ( null ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMStatisticsData ( vmStatistics , xml ) ; org.junit.Assert.assertEquals ( null , vmStatistics.getDisksUsage ( ) ) ; }
Source:
protected boolean isStorageDomainNotInPool ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain ) { boolean returnValue = false ; if ( storageDomain != null ) { returnValue = getDbFacade ( ) . getStoragePoolIsoMapDao ( ) . getAllForStorage ( storageDomain.getId ( ) ) . isEmpty ( ) ; if ( ! returnValue ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ; } } return returnValue ; }

Target:
protected boolean isStorageDomainNotInPool ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean returnValue = false ; if ( storageDomain != null ) { returnValue = getDbFacade ( ) . getStoragePoolIsoMapDao ( ) . getAllForStorage ( storageDomain.getId ( ) ) . isEmpty ( ) ; if ( ! returnValue ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ; } } return returnValue ; }
Source:
public final java.lang.String [ ] getCompletion ( java.lang.String wordPart ) { java.lang.String [ ] retval = new java.lang.String [ 0 ] ; if ( mVerbCompletion.containsKey ( wordPart.toUpperCase ( ) ) ) { java.util.List < java.lang.String > curList = mVerbCompletion.get ( wordPart.toUpperCase ( ) ) ; retval = new java.lang.String [ curList.size ( ) ] ; retval = curList.toArray ( new java.lang.String [ ] { } ) ; } return retval ; }

Target:
public final java.lang.String [ ] getCompletion ( java.lang.String wordPart ) { java.lang.String [ ] retval = new java.lang.String [ 0 ] ; if ( mVerbCompletion.containsKey ( wordPart.toUpperCase ( ) ) ) { java.util.List < java.lang.String > curList = mVerbCompletion.get ( wordPart.toUpperCase ( ) ) ; retval = curList.toArray ( new java.lang.String [ curList.size ( ) ] ) ; } return retval ; }
Source:
private org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabelEditor < java.util.Date > getInstanceOfDateEditor ( ) { return new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabelEditor < java.util.Date > ( new com.google.gwt.text.shared.AbstractRenderer < java.util.Date > ( ) { @ java.lang.Override public java.lang.String render ( java.util.Date entity ) { if ( entity == null ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.VolumeRebalanceStatusPopupView.constants.unAvailablePropertyLabel ( ) ; } return renderer.render ( entity ) ; } } ) ; }

Target:
private org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabelEditor < java.util.Date > getInstanceOfDateEditor ( ) { return new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabelEditor ( new com.google.gwt.text.shared.AbstractRenderer < java.util.Date > ( ) { @ java.lang.Override public java.lang.String render ( java.util.Date entity ) { if ( entity == null ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.VolumeRebalanceStatusPopupView.constants.unAvailablePropertyLabel ( ) ; } return renderer.render ( entity ) ; } } ) ; }
Source:
public final void onBootstrap ( ) { java.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger ( "" ) ; initLocalStorageLogHandler ( rootLogger ) ; java.util.logging.Logger remoteLogger = java.util.logging.Logger.getLogger ( "remote" ) ; remoteLogger.addHandler ( new com.google.gwt.logging.client.SimpleRemoteLogHandler ( ) ) ; initUncaughtExceptionHandler ( rootLogger , remoteLogger ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { performBootstrap ( ) ; } } ) ; }

Target:
public final void onBootstrap ( ) { initUncaughtExceptionHandler ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { performBootstrap ( ) ; } } ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Cluster postPopulate ( org.ovirt.engine.core.common.businessentities.Cluster model ) { org.ovirt.engine.api.model.ErrorHandling errorHandling = new org.ovirt.engine.api.model.ErrorHandling ( ) ; errorHandling.setOnError ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.MigrateOnError.class ) . value ( ) ) ; model.setErrorHandling ( errorHandling ) ; model.getSerialNumber ( ) . setPolicy ( SerialNumberPolicy.CUSTOM.value ( ) ) ; model.getRequiredRngSources ( ) . getRequiredRngSources ( ) . clear ( ) ; model.getRequiredRngSources ( ) . getRequiredRngSources ( ) . add ( RngSource.RANDOM.name ( ) ) ; return model ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Cluster postPopulate ( org.ovirt.engine.core.common.businessentities.Cluster model ) { org.ovirt.engine.api.model.ErrorHandling errorHandling = new org.ovirt.engine.api.model.ErrorHandling ( ) ; errorHandling.setOnError ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.MigrateOnError.class ) ) ; model.setErrorHandling ( errorHandling ) ; model.getSerialNumber ( ) . setPolicy ( SerialNumberPolicy.CUSTOM ) ; model.getRequiredRngSources ( ) . getRequiredRngSources ( ) . clear ( ) ; model.getRequiredRngSources ( ) . getRequiredRngSources ( ) . add ( RngSource.RANDOM ) ; return model ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( T obj ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource map = createIdParameterMapper ( obj.getId ( ) ) . addValue ( "name" , obj.getName ( ) ) . addValue ( "qos_id" , obj.getQosId ( ) ) . addValue ( "description" , obj.getDescription ( ) ) ; return map ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( T obj ) { return createIdParameterMapper ( obj.getId ( ) ) . addValue ( "name" , obj.getName ( ) ) . addValue ( "qos_id" , obj.getQosId ( ) ) . addValue ( "description" , obj.getDescription ( ) ) ; }
Source:
private void endVmRelatedOps ( ) { setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) ) ; updateVmInSpm ( ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } }

Target:
private void endVmRelatedOps ( ) { setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } }
Source:
public boolean validateQuotaNameIsUnique ( org.ovirt.engine.core.common.businessentities.Quota quota ) { org.ovirt.engine.core.common.businessentities.Quota quotaByName = quotaDao.getQuotaByQuotaName ( quota.getQuotaName ( ) , quota.getStoragePoolId ( ) ) ; if ( ( quotaByName != null ) && ( ! ( quotaByName.getId ( ) . equals ( quota.getId ( ) ) ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ; return false ; } return true ; }

Target:
private boolean validateQuotaNameIsUnique ( org.ovirt.engine.core.common.businessentities.Quota quota ) { org.ovirt.engine.core.common.businessentities.Quota quotaByName = quotaDao.getQuotaByQuotaName ( quota.getQuotaName ( ) , quota.getStoragePoolId ( ) ) ; if ( ( quotaByName != null ) && ( ! ( quotaByName.getId ( ) . equals ( quota.getId ( ) ) ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ; return false ; } return true ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVdsDynamicDao ( ) ; staticDao = dbFacade.getVdsStaticDao ( ) ; statisticsDao = dbFacade.getVdsStatisticsDao ( ) ; existingVds = staticDao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.setHostName ( "farkle.redhat.com" ) ; newStaticVds.setClusterId ( existingVds.getClusterId ( ) ) ; newStaticVds.setProtocol ( VdsProtocol.STOMP ) ; newDynamicVds = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVdsDynamicDao ( ) ; staticDao = dbFacade.getVdsStaticDao ( ) ; statisticsDao = dbFacade.getVdsStatisticsDao ( ) ; existingVds = staticDao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.setHostName ( "farkle.redhat.com" ) ; newStaticVds.setClusterId ( existingVds.getClusterId ( ) ) ; newDynamicVds = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; }
Source:
public void updateRepository_MIGRATION_FROM ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs data ) { initMocks ( data , true ) ; org.junit.Assume.assumeNotNull ( data.dbVm ( ) , data.vdsmVm ( ) ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) . getVmDynamic ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) ) ; org.junit.Assert.assertTrue ( vmAnalyzer.isClientIpChanged ( ) ) ; org.mockito.Mockito.verify ( resourceManager , org.mockito.Mockito.never ( ) ) . internalSetVmStatus ( data.dbVm ( ) , VMStatus.MigratingTo ) ; }

Target:
public void updateRepository_MIGRATION_FROM ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs data ) { initMocks ( data , true ) ; org.junit.Assume.assumeNotNull ( data.dbVm ( ) , data.vdsmVm ( ) ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) . getVmDynamic ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) ) ; org.mockito.Mockito.verify ( resourceManager , org.mockito.Mockito.never ( ) ) . internalSetVmStatus ( data.dbVm ( ) , VMStatus.MigratingTo ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.storage.ImageStatus getSnapshotStatus ( final org.ovirt.engine.core.compat.Guid id ) { return execute ( new java.util.concurrent.Callable < org.ovirt.engine.core.common.businessentities.storage.ImageStatus > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.storage.ImageStatus call ( ) { com.woorea.openstack.cinder.model.Snapshot snapshot = proxy.getSnapshotById ( id.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.CinderVolumeStatus cinderVolumeStatus = org.ovirt.engine.core.common.businessentities.storage.CinderVolumeStatus.forValue ( snapshot.getStatus ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.cinder.CinderBroker.mapCinderVolumeStatusToImageStatus ( cinderVolumeStatus ) ; } } ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.ImageStatus getSnapshotStatus ( final org.ovirt.engine.core.compat.Guid id ) { return execute ( ( ) -> { com.woorea.openstack.cinder.model.Snapshot snapshot = proxy.getSnapshotById ( id.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.CinderVolumeStatus cinderVolumeStatus = org.ovirt.engine.core.common.businessentities.storage.CinderVolumeStatus.forValue ( snapshot.getStatus ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.cinder.CinderBroker.mapCinderVolumeStatusToImageStatus ( cinderVolumeStatus ) ; } ) ; }
Source:
protected void addVmPayload ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmPayload ( ) ; if ( payload != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmId ( ) ) , VmDeviceGeneralType.DISK , payload.getDeviceType ( ) , payload.getSpecParams ( ) , true , true , null ) ; } }

Target:
protected void addVmPayload ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmPayload ( ) ; if ( payload != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmId ( ) ) , VmDeviceGeneralType.DISK , payload.getDeviceType ( ) , payload.getSpecParams ( ) , true , true , null , false ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( disks ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; setItems ( disks ) ; }
Source:
private void postDoUpdateManagedFieldsFrom ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { if ( isNextRunConfigurationExists ( ) ) { deactivate ( ) ; getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( isVmDeviceExists ( vmBase.getManagedDeviceMap ( ) , VmDeviceType.SOUND.getName ( ) ) ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( isVmDeviceExists ( vmBase.getManagedDeviceMap ( ) , VmDeviceType.CONSOLE.getName ( ) ) ) ; activate ( ) ; } updateWatchdog ( vmBase ) ; }

Target:
private void postDoUpdateManagedFieldsFrom ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { if ( isNextRunConfigurationExists ( ) ) { deactivate ( ) ; getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( isVmDeviceExists ( vmBase.getManagedDeviceMap ( ) , VmDeviceType.SOUND.getName ( ) ) ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( isVmDeviceExists ( vmBase.getManagedDeviceMap ( ) , VmDeviceType.CONSOLE.getName ( ) ) ) ; activate ( ) ; } updateWatchdog ( vmBase , true ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getAllForStoragePoolAndStatus ( org.ovirt.engine.core.compat.Guid storagePool , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { return getCallsHandler ( ) . executeReadList ( "getVdsByStoragePoolIdWithStatus" , org.ovirt.engine.core.dao.VdsDAODbFacadeImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , storagePool ) . addValue ( "status" , status.getValue ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getAllForStoragePoolAndStatus ( org.ovirt.engine.core.compat.Guid storagePool , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { return getCallsHandler ( ) . executeReadList ( "getVdsByStoragePoolIdWithStatus" , org.ovirt.engine.core.dao.VdsDAODbFacadeImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , storagePool ) . addValue ( "status" , ( status != null ? status.getValue ( ) : null ) ) ) ; }
Source:
public void createStatusForIp ( ) { org.ovirt.engine.core.common.businessentities.VdsKdumpStatus newVdsKdumpStatus = new org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ( ) ; newVdsKdumpStatus.setStatus ( KdumpFlowStatus.DUMPING ) ; newVdsKdumpStatus.setAddress ( "[\"10.35.110.10\", 1111]" ) ; dbFacade.getVdsKdumpStatusDao ( ) . updateForIp ( "10.35.110.10" , newVdsKdumpStatus ) ; newVdsKdumpStatus.setVdsId ( FixturesTool.VDS_RHEL6_NFS_SPM ) ; org.ovirt.engine.core.common.businessentities.VdsKdumpStatus found = dbFacade.getVdsKdumpStatusDao ( ) . get ( newVdsKdumpStatus.getVdsId ( ) ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( newVdsKdumpStatus , found ) ; }

Target:
public void createStatusForIp ( ) { org.ovirt.engine.core.common.businessentities.VdsKdumpStatus newVdsKdumpStatus = new org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ( ) ; newVdsKdumpStatus.setStatus ( KdumpFlowStatus.DUMPING ) ; newVdsKdumpStatus.setAddress ( "[\"10.35.110.10\", 1111]" ) ; dao.updateForIp ( "10.35.110.10" , newVdsKdumpStatus ) ; newVdsKdumpStatus.setVdsId ( FixturesTool.VDS_RHEL6_NFS_SPM ) ; org.ovirt.engine.core.common.businessentities.VdsKdumpStatus found = dao.get ( newVdsKdumpStatus.getVdsId ( ) ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( newVdsKdumpStatus , found ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId2 , 0 ) ) ; prepareMocks ( cmd ) ; mockBackend ( true , null ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . startSubStep ( ) ; org.mockito.Mockito.verify ( cmd ) . handleTaskReturn ( asyncTaskToBeReturned ) ; org.mockito.Mockito.verify ( cmd ) . updateBricksWithTaskID ( asyncTaskToBeReturned ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId2 , 0 ) ) ; prepareMocks ( cmd ) ; mockBackend ( true , null ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . startSubStep ( ) ; org.mockito.Mockito.verify ( cmd ) . handleTaskReturn ( asyncTaskToBeReturned ) ; org.mockito.Mockito.verify ( cmd ) . updateBricksWithTaskID ( asyncTaskToBeReturned ) ; org.junit.Assert.assertEquals ( AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
private void alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String reason ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( getVdsId ( ) ) ; alert.addCustomValue ( "Reason" , reason ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.Alert ( alert , logType , auditLogDirector ) ; }

Target:
private void alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String reason ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( getVdsId ( ) ) ; alert.addCustomValue ( "Reason" , reason ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.alert ( alert , logType , auditLogDirector ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { domain.setId ( domain.getStoragePoolId ( ) ) ; } java.util.Collections.sort ( domains , new org.ovirt.engine.ui.uicommonweb.Linq.StorageDomainByPoolNameComparator ( ) ) ; setItems ( domains ) ; setIsEmpty ( ( ( getItems ( ) . size ( ) ) == 0 ) ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = returnValue.getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { domain.setId ( domain.getStoragePoolId ( ) ) ; } java.util.Collections.sort ( domains , new org.ovirt.engine.ui.uicommonweb.Linq.StorageDomainByPoolNameComparator ( ) ) ; setItems ( domains ) ; setIsEmpty ( ( ( getItems ( ) . size ( ) ) == 0 ) ) ; }
Source:
public static void InitDictionaries ( ) { org.ovirt.engine.core.bll.CpuFlagsManagerHandler.log.info ( "Start initializing dictionaries" ) ; org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.clear ( ) ; for ( org.ovirt.engine.core.compat.Version ver : org.ovirt.engine.core.common.config.Config.< java.util.HashSet < org.ovirt.engine.core.compat.Version > > GetValue ( ConfigValues.SupportedClusterLevels ) ) { org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.put ( ver , new org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager ( ver ) ) ; } org.ovirt.engine.core.bll.CpuFlagsManagerHandler.log.info ( "Finished initializing dictionaries" ) ; }

Target:
public static void InitDictionaries ( ) { org.ovirt.engine.core.bll.CpuFlagsManagerHandler.log.info ( "Start initializing dictionaries" ) ; org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.clear ( ) ; for ( org.ovirt.engine.core.compat.Version ver : org.ovirt.engine.core.common.config.Config.< java.util.HashSet < org.ovirt.engine.core.compat.Version > > getValue ( ConfigValues.SupportedClusterLevels ) ) { org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.put ( ver , new org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager ( ver ) ) ; } org.ovirt.engine.core.bll.CpuFlagsManagerHandler.log.info ( "Finished initializing dictionaries" ) ; }
Source:
protected boolean validate ( org.ovirt.engine.core.bll.ValidationResult validationResult ) { if ( ! ( validationResult.isValid ( ) ) ) { addCanDoActionMessage ( validationResult.getMessage ( ) ) ; if ( ( validationResult.getVariableReplacements ( ) ) != null ) { for ( java.lang.String variableReplacement : validationResult.getVariableReplacements ( ) ) { addCanDoActionMessage ( variableReplacement ) ; } } } return validationResult.isValid ( ) ; }

Target:
protected boolean validate ( org.ovirt.engine.core.bll.ValidationResult validationResult ) { if ( ! ( validationResult.isValid ( ) ) ) { addCanDoActionMessage ( validationResult.getMessage ( ) ) ; for ( java.lang.String variableReplacement : validationResult.getVariableReplacements ( ) ) { addCanDoActionMessage ( variableReplacement ) ; } } return validationResult.isValid ( ) ; }
Source:
public static void getRoleList ( 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public void getRoleList ( 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public boolean isBackedByHudepages ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { if ( ( ( vm.getCustomProperties ( ) ) == null ) || ( vm.getCustomProperties ( ) . isEmpty ( ) ) ) { return false ; } java.lang.String hugePage = getHugePageSize ( vm ) ; if ( hugePage == null ) { return false ; } try { java.lang.Integer.parseInt ( hugePage ) ; return true ; } catch ( java.lang.NumberFormatException e ) { return false ; } }

Target:
public boolean isBackedByHudepages ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { if ( ( ( vm.getCustomProperties ( ) ) == null ) || ( vm.getCustomProperties ( ) . isEmpty ( ) ) ) { return false ; } java.lang.String hugePage = getHugePageSize ( vm ) ; if ( hugePage == null ) { return false ; } try { return ( java.lang.Integer.parseInt ( hugePage ) ) > 0 ; } catch ( java.lang.NumberFormatException e ) { return false ; } }
Source:
private static void reportInvalidInterfacesForNetwork ( java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > interfaces , org.ovirt.engine.core.common.businessentities.Network network , org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( interfaces.size ( ) ) != 1 ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVdsId ( vds.getId ( ) ) ; logable.AddCustomValue ( "NetworkName" , network.getName ( ) ) ; logable.AddCustomValue ( "Interfaces" , org.apache.commons.lang.StringUtils.join ( org.ovirt.engine.core.common.businessentities.Entities.objectNames ( interfaces ) , "," ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.BRIDGED_NETWORK_OVER_MULTIPLE_INTERFACES ) ; } }

Target:
private static void reportInvalidInterfacesForNetwork ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces , org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( interfaces.size ( ) ) != 1 ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVdsId ( vds.getId ( ) ) ; logable.AddCustomValue ( "NetworkName" , network.getName ( ) ) ; logable.AddCustomValue ( "Interfaces" , org.apache.commons.lang.StringUtils.join ( org.ovirt.engine.core.common.businessentities.Entities.objectNames ( interfaces ) , "," ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.BRIDGED_NETWORK_OVER_MULTIPLE_INTERFACES ) ; } }
Source:
public void validateDomainNotWithinThreshold ( ) { setupForStorageTests ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator , org.mockito.Mockito.never ( ) ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void validateDomainNotWithinThreshold ( ) { setupForStorageTests ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator , org.mockito.Mockito.never ( ) ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase createAuditLog ( final org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( iface.getVmId ( ) . getValue ( ) ) ; logable.addCustomValue ( "MACAddr" , iface.getMacAddress ( ) ) ; logable.addCustomValue ( "IfaceName" , iface.getName ( ) ) ; return logable ; }

Target:
private org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase createAuditLog ( final org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( iface.getVmId ( ) ) ; logable.addCustomValue ( "MACAddr" , iface.getMacAddress ( ) ) ; logable.addCustomValue ( "IfaceName" , iface.getName ( ) ) ; return logable ; }