auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterHooks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > glusterHooks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ) ( returnValue ) ) ; setItems ( glusterHooks ) ; } } ) , getEntity ( ) . getId ( ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterHooks ( new org.ovirt.engine.ui.uicommonweb.models.clusters.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > glusterHooks ) { setItems ( glusterHooks ) ; } } ) , getEntity ( ) . getId ( ) ) ; }
Source:
public void testInvalidMemory ( ) { prepareVmToPassCanDoAction ( ) ; vmStatic.setMemSizeMb ( 99999 ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid memory." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_MEMORY_SIZE ) ; }

Target:
public void testCannotDisableVirtioScsi ( ) { prepareVmToPassCanDoAction ( ) ; command.getParameters ( ) . setVirtioScsiEnabled ( false ) ; org.ovirt.engine.core.common.businessentities.Disk disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; disk.setPlugged ( true ) ; mockDiskDaoGetAllForVm ( java.util.Collections.singletonList ( disk ) , true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS ) ; }
Source:
public void shouldAllowUnpinnedNumaNodes ( ) { validVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 ) ) ) ; org.assertj.core.api.Assertions.assertThat ( validator.isVmReadyForUpgrade ( validVM ) ) . isEmpty ( ) ; }

Target:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( UpgradeError.VM_NUMA_PINNED ) ; }
Source:
public void testVmPools ( ) { org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( 100 ) ; org.ovirt.engine.core.searchbackend.ISyntaxChecker curSyntaxChecker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createBackendSyntaxChecker ( "foo" ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = curSyntaxChecker.analyzeSyntaxState ( "Pools: " , true ) ; java.lang.String query = chkr.generateQueryFromSyntaxContainer ( res , true ) ; junit.framework.Assert.assertEquals ( "SELECT * FROM ((SELECT * FROM vm_pools_full_view ) ORDER BY vm_pool_name ASC ) as T1 OFFSET (1 -1) LIMIT 0" , 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 ) ; org.junit.Assert.assertEquals ( exepctedSQLResult , query ) ; }
Source:
public void testWithoutEnoughSparesFullMemory ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "5" ) ; hostedEngine.setVmMemSizeMb ( 7000 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( "A" , result.get ( 0 ) . getName ( ) ) ; }

Target:
public void testWithoutEnoughSparesFullMemory ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "5" ) ; hostedEngine.setVmMemSizeMb ( 7000 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , result.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "A" , result.get ( 0 ) . getName ( ) ) ; }
Source:
public void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
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 , boolean reply ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , null , reply ) ; }

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 , java.lang.String errorMessage ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , null , true , errorMessage ) ; }
Source:
public void canDoActionFailsOnSnapshotNotExists ( ) { org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( spyCommand.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( spyCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void validateFailsOnSnapshotNotExists ( ) { org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( spyCommand.validate ( ) ) ; org.junit.Assert.assertTrue ( spyCommand.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST.toString ( ) ) ) ; }
Source:
private static org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.ParametersProvider < org.ovirt.engine.api.model.WatchDog , org.ovirt.engine.core.common.businessentities.VmWatchdog > getUpdateParams ( ) { return new org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.ParametersProvider < org.ovirt.engine.api.model.WatchDog , org.ovirt.engine.core.common.businessentities.VmWatchdog > ( ) { public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.WatchDog model , org.ovirt.engine.core.common.businessentities.VmWatchdog entity ) { org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setModel ( org.ovirt.engine.core.common.businessentities.VmWatchdogType.getByName ( model.getModel ( ) ) ) ; params.setAction ( org.ovirt.engine.core.common.businessentities.VmWatchdogAction.getByName ( model.getAction ( ) ) ) ; params.setId ( GUIDS [ 1 ] ) ; params.setVm ( true ) ; return params ; } } ; }

Target:
private static org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.ParametersProvider < org.ovirt.engine.api.model.WatchDog , org.ovirt.engine.core.common.businessentities.VmWatchdog > getUpdateParams ( ) { return new org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.ParametersProvider < org.ovirt.engine.api.model.WatchDog , org.ovirt.engine.core.common.businessentities.VmWatchdog > ( ) { public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.WatchDog model , org.ovirt.engine.core.common.businessentities.VmWatchdog entity ) { org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setModel ( org.ovirt.engine.core.common.businessentities.VmWatchdogType.getByName ( model.getModel ( ) ) ) ; params.setAction ( org.ovirt.engine.core.common.businessentities.VmWatchdogAction.getByName ( model.getAction ( ) ) ) ; params.setId ( org.ovirt.engine.api.restapi.resource.BackendWatchdogResourceTest.VM_ID ) ; params.setVm ( true ) ; return params ; } } ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { int storageType = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) ; _result = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getBroker ( ) . getDeviceList ( storageType ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ProceedProxyReturnValue ( ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLUNList ( _result.lunList ) ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { int storageType = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) ; _result = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getBroker ( ) . getDeviceList ( storageType ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLUNList ( _result.lunList ) ) ; }
Source:
private boolean serverExists ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > serversList , org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo glusterServer ) { for ( org.ovirt.engine.core.common.businessentities.VDS server : serversList ) { java.lang.String serverHostnameOrIp = ( server.getHostName ( ) . isEmpty ( ) ) ? server.getManagmentIp ( ) : server.getHostName ( ) ; if ( serverHostnameOrIp.equalsIgnoreCase ( glusterServer.getHostnameOrIp ( ) ) ) { return true ; } } return false ; }

Target:
private boolean serverExists ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo glusterServer ) { return getDbUtils ( ) . serverExists ( org.ovirt.engine.core.bll.gluster.GetAddedGlusterServersQuery.getParameters ( ) . getClusterId ( ) , glusterServer.getHostnameOrIp ( ) ) ; }
Source:
private java.util.List < java.lang.String > getSnapshotsNames ( ) { java.util.List < java.lang.String > snapshotsNames = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getImages ( ) ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getSnapshotDao ( ) . get ( image.getSnapshotId ( ) ) ; if ( snapshot != null ) { snapshotsNames.add ( snapshot.getDescription ( ) ) ; } } return snapshotsNames ; }

Target:
private java.util.List < java.lang.String > getSnapshotsNames ( ) { java.util.List < java.lang.String > snapshotsNames = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : getImages ( ) ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getSnapshotDao ( ) . get ( image.getSnapshotId ( ) ) ; if ( snapshot != null ) { snapshotsNames.add ( snapshot.getDescription ( ) ) ; } } return snapshotsNames ; }
Source:
private void doTestRemoveNotFound ( java.lang.String id ) throws java.lang.Exception { initResource ( resource.parent ) ; resource.id = id ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } resource.id = "1" ; }

Target:
private void doTestRemoveNotFound ( java.lang.String id ) throws java.lang.Exception { initResource ( resource.parent ) ; resource.id = id ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } resource.id = "1" ; }
Source:
public void tearDown ( ) { if ( ( client ) != null ) { try { client.executeCommand ( java.lang.String.format ( "rm -f '%1$s'" , remote ) , null , null , null ) ; } catch ( java.lang.Exception e ) { } try { client.close ( ) ; } catch ( java.lang.Exception e ) { } client = null ; } if ( ( local2 ) != null ) { if ( ! ( local2.delete ( ) ) ) { } local2 = null ; } }

Target:
public void tearDown ( ) { if ( ( client ) != null ) { try { client.executeCommand ( java.lang.String.format ( "rm -f '%1$s'" , remote ) , null , null , null ) ; } catch ( java.lang.Exception ignore ) { } try { client.close ( ) ; } catch ( java.lang.Exception ignore ) { } client = null ; } if ( ( local2 ) != null ) { if ( ! ( local2.delete ( ) ) ) { } local2 = null ; } }
Source:
protected org.ovirt.engine.api.model.OpenStackNetworkProvider postPopulate ( org.ovirt.engine.api.model.OpenStackNetworkProvider model ) { model.setPluginType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.NetworkPluginType.class ) ) ; org.ovirt.engine.api.model.AgentConfiguration agentConfiguration = model.getAgentConfiguration ( ) ; agentConfiguration.setBrokerType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.MessageBrokerType.class ) ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.OpenStackNetworkProvider postPopulate ( org.ovirt.engine.api.model.OpenStackNetworkProvider model ) { model.setType ( OpenStackNetworkProviderType.NEUTRON ) ; model.setPluginType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.NetworkPluginType.class ) ) ; org.ovirt.engine.api.model.AgentConfiguration agentConfiguration = model.getAgentConfiguration ( ) ; agentConfiguration.setBrokerType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.MessageBrokerType.class ) ) ; return model ; }
Source:
public static void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public void processSoftwareCapabilities ( org.ovirt.engine.core.common.businessentities.VDS vds ) { }

Target:
public void processSoftwareCapabilities ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.GlusterServersList , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( vds.getId ( ) ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { vds.setStatus ( VDSStatus.NonOperational ) ; vds.setNonOperationalReason ( NonOperationalReason.GLUSTER_COMMAND_FAILED ) ; vdsNonOperational ( vds , NonOperationalReason.GLUSTER_COMMAND_FAILED ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.UserSession > searchSessions ( ) { return genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getEngineSessionDao ( ) , false ) . stream ( ) . map ( UserSession :: new ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.UserSession > searchSessions ( ) { return genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getEngineSessionDao ( ) , false ) . stream ( ) . peek ( this :: injectSessionInfo ) . map ( UserSession :: new ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.models.ListModel flush ( ) { org.ovirt.engine.ui.uicommonweb.models.ListModel model = driver.flush ( ) ; flush ( model ) ; return model ; }

Target:
private void init ( ) { vnicProfiles = profilesModel.getItems ( ) ; if ( ( vnicProfiles ) == null ) { vnicProfiles = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } vnics.clear ( ) ; realEntryCount = 0 ; java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType > values = vnicsModel.getItems ( ) ; if ( values != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType value : values ) { vnics.add ( value.getNetworkInterface ( ) ) ; } } updateHeaderLabel ( ) ; super . init ( vnicsModel ) ; }
Source:
public void getRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }
Source:
public void testUpdate ( ) { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateWatchdogResourceTest.TEMPLATE_ID } , true , true ) ) ; org.ovirt.engine.api.model.Watchdog wd = resource.update ( getUpdate ( ) ) ; org.junit.Assert.assertTrue ( wd.isSetAction ( ) ) ; }

Target:
public void testUpdate ( ) { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateWatchdogResourceTest.TEMPLATE_ID } , true , true ) ) ; org.ovirt.engine.api.model.Watchdog wd = resource.update ( getUpdate ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( wd.isSetAction ( ) ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getStorageDomainId ( java.lang.String storageDomainName ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > storageDomains = getBackendCollection ( org.ovirt.engine.api.model.StorageDomain.class , VdcQueryType.GetAllStorageDomains , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ; for ( org.ovirt.engine.api.model.StorageDomain storageDomain : storageDomains ) { if ( storageDomain.getstorage_name ( ) . equals ( storageDomainName ) ) { return storageDomain.getId ( ) ; } } return null ; }

Target:
private org.ovirt.engine.core.compat.Guid getStorageDomainId ( java.lang.String storageDomainName ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > storageDomains = getBackendCollection ( org.ovirt.engine.api.model.StorageDomain.class , VdcQueryType.GetAllStorageDomains , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ; for ( org.ovirt.engine.api.model.StorageDomain storageDomain : storageDomains ) { if ( storageDomain.getStorageName ( ) . equals ( storageDomainName ) ) { return storageDomain.getId ( ) ; } } return null ; }
Source:
public static void GetNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.GetAllNetworkQueryParamenters ( dataCenterId ) , aQuery ) ; }

Target:
public static void GetCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { 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.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; getVm ( ) . getStaticData ( ) . setCpuProfileId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( cpuProfileHelper.setAndValidateCpuProfile ( getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getUserId ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; getVm ( ) . getStaticData ( ) . setCpuProfileId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( cpuProfileHelper.setAndValidateCpuProfile ( getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getUserIdIfExternal ( ) ) ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( getEntityList ( ) ) ; org.ovirt.engine.api.model.NetworkLabel model = resource.get ( ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendNetworkLabelResourceTest.LABELS [ 0 ] , model.getId ( ) ) ; verifyLinks ( model ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( getEntityList ( ) ) ; org.ovirt.engine.api.model.NetworkLabel model = resource.get ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendNetworkLabelResourceTest.LABELS [ 0 ] , model.getId ( ) ) ; verifyLinks ( model ) ; }
Source:
protected boolean isValidExportDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getForStoragePool ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStoragePoolId ( ) ) ; if ( ( domain != null ) && ( ( domain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return true ; } return false ; }

Target:
protected boolean isValidExportDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getForStoragePool ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStoragePoolId ( ) ) ; if ( ( domain != null ) && ( ( domain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return true ; } return false ; }
Source:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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 ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
private void _setNode ( ) { _isNode = true ; _vds.setVdsType ( VDSType.oVirtNode ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStaticDao ( ) . update ( _vds.getStaticData ( ) ) ; return null ; } } ) ; }

Target:
private void setNode ( ) { _isNode = true ; _vds.setVdsType ( VDSType.oVirtNode ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStaticDao ( ) . update ( _vds.getStaticData ( ) ) ; return null ; } } ) ; }
Source:
public void commandFailsSlaveVolumeNotUp ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.SetupGlusterGeoRepMountBrokerInternalCommand ( new org.ovirt.engine.core.common.action.gluster.SetUpMountBrokerParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , new java.util.HashSet ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) , null , null ) , null ) ) ; org.mockito.Mockito.doReturn ( volume ) . when ( command ) . getSlaveVolume ( ) ; org.mockito.Mockito.doReturn ( GlusterStatus.DOWN ) . when ( volume ) . getStatus ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }

Target:
public void commandFailsSlaveVolumeNotUp ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.SetupGlusterGeoRepMountBrokerInternalCommand ( new org.ovirt.engine.core.common.action.gluster.SetUpMountBrokerParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , new java.util.HashSet ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) , null , null ) , null ) ) ; org.mockito.Mockito.doReturn ( volume ) . when ( command ) . getSlaveVolume ( ) ; org.mockito.Mockito.doReturn ( GlusterStatus.DOWN ) . when ( volume ) . getStatus ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( command.validate ( ) ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getBroker ( ) . getStorageDomainInfo ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.StorageDomainStatic , org.ovirt.engine.core.common.businessentities.SANState > pairSdStatic = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.BuildStorageStaticFromXmlRpcStruct ( _result.mStorageInfo ) ; pairSdStatic.getFirst ( ) . setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( pairSdStatic ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getBroker ( ) . getStorageDomainInfo ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.StorageDomainStatic , org.ovirt.engine.core.common.businessentities.SANState > pairSdStatic = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.BuildStorageStaticFromXmlRpcStruct ( _result.mStorageInfo ) ; pairSdStatic.getFirst ( ) . setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( pairSdStatic ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setTitle ( ( object.isBoot ( ) ? getDefaultTitle ( ) : null ) ) ; return object.isBoot ( ) ? getDefaultImage ( ) : null ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { java.lang.String value = "" ; if ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) ; java.util.ArrayList < java.lang.String > quotaNamesArr = diskImage.getQuotaNames ( ) ; if ( quotaNamesArr != null ) { value = org.ovirt.engine.core.compat.StringHelper.join ( ", " , quotaNamesArr.toArray ( ) ) ; } } return value ; }
Source:
private org.ovirt.engine.core.common.businessentities.VolumeFormat getVolumeFormatForDomain ( ) { if ( ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getVolumeFormat ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ) ) { return org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ; } org.ovirt.engine.core.common.businessentities.StorageDomainStatic destDomain = org.ovirt.engine.core.bll.CopyImageGroupCommand.getStorageDomainStaticDAO ( ) . get ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( destDomain.getStorageType ( ) . isBlockDomain ( ) ) && ( ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { return org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ; } else { return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; } }

Target:
private org.ovirt.engine.core.common.businessentities.storage.VolumeFormat getVolumeFormatForDomain ( ) { if ( ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getVolumeFormat ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.COW ) ) { return org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.COW ; } org.ovirt.engine.core.common.businessentities.StorageDomainStatic destDomain = org.ovirt.engine.core.bll.CopyImageGroupCommand.getStorageDomainStaticDAO ( ) . get ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( destDomain.getStorageType ( ) . isBlockDomain ( ) ) && ( ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Sparse ) ) ) { return org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.COW ; } else { return org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.RAW ; } }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.LunDisk > filterDiskBasedOnLuns ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.Disk > listOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.LunDisk > lunDisks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LunDisk > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : listOfDisks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.LUN ) ) { lunDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( disk ) ) ) ; } } return lunDisks ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.storage.LunDisk > filterDiskBasedOnLuns ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.Disk > listOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LunDisk > lunDisks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LunDisk > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : listOfDisks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { lunDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( disk ) ) ) ; } } return lunDisks ; }
Source:
public void UpdateItemsAvailability ( ) { }

Target:
public void UpdateItemsAvailability ( ) { if ( ! ( org.ovirt.engine.ui.frontend.Frontend.getQueryStartedEvent ( ) . getListeners ( ) . contains ( this ) ) ) org.ovirt.engine.ui.frontend.Frontend.getQueryStartedEvent ( ) . addListener ( this ) ; if ( ! ( org.ovirt.engine.ui.frontend.Frontend.getQueryCompleteEvent ( ) . getListeners ( ) . contains ( this ) ) ) org.ovirt.engine.ui.frontend.Frontend.getQueryCompleteEvent ( ) . addListener ( this ) ; }
Source:
private void removeMemoryVolumesOfSnapshot ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( snapshot.getMemoryVolume ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { log.errorFormat ( "Failed to remove memory volumes of snapshot {0} ({1})" , snapshot.getDescription ( ) , snapshot.getId ( ) ) ; } }

Target:
private void removeMemoryVolumesOfSnapshot ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( snapshot.getMemoryVolume ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { log.errorFormat ( "Failed to remove memory volumes of snapshot {0} ({1})" , snapshot.getDescription ( ) , snapshot.getId ( ) ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaVdsConsumptionParameters ( ) { return java.util.Collections.< org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > singletonList ( new org.ovirt.engine.core.bll.quota.QuotaSanityParameter ( getQuotaId ( ) , null ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaVdsConsumptionParameters ( ) { org.ovirt.engine.core.compat.Guid quotaId = org.ovirt.engine.core.bll.AddVmPoolCommand.getQuotaManager ( ) . getDefaultQuotaIfNull ( org.ovirt.engine.core.bll.AddVmPoolCommand.getParameters ( ) . getVmStaticData ( ) . getQuotaId ( ) , org.ovirt.engine.core.bll.AddVmPoolCommand.getStoragePoolId ( ) ) ; return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.quota.QuotaSanityParameter ( quotaId , null ) ) ; }
Source:
private void initStoragePool ( ) { storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setCompatibilityVersion ( Version.v3_1 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( command.getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; }

Target:
private void initStoragePool ( ) { storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setCompatibilityVersion ( Version.v3_5 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( command.getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; }
Source:
private void clearAddressOnInterfaceChange ( ) { if ( ( getOldDisk ( ) . getDiskInterface ( ) ) != ( getNewDisk ( ) . getDiskInterface ( ) ) ) { org.ovirt.engine.core.common.businessentities.VmDeviceId deviceId = new org.ovirt.engine.core.common.businessentities.VmDeviceId ( getOldDisk ( ) . getId ( ) , getVmId ( ) ) ; getVmDeviceDao ( ) . clearDeviceAddress ( getVmDeviceDao ( ) . get ( deviceId ) . getDeviceId ( ) ) ; } }

Target:
private void updateDeviceProperties ( ) { if ( shouldUpdateReadOnly ( ) ) { vmDeviceForVm.setIsReadOnly ( getNewDisk ( ) . getReadOnly ( ) ) ; getVmDeviceDao ( ) . update ( vmDeviceForVm ) ; } if ( ( getOldDisk ( ) . getDiskInterface ( ) ) != ( getNewDisk ( ) . getDiskInterface ( ) ) ) { getVmDeviceDao ( ) . clearDeviceAddress ( getOldDisk ( ) . getId ( ) ) ; } }
Source:
public static void Init ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > allPools = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool pool : allPools ) { if ( ( pool.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational ) ) { org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.poolStatusChanged ( pool.getId ( ) , StoragePoolStatus.NotOperational ) ; } } }

Target:
public static void init ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > allPools = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool pool : allPools ) { if ( ( pool.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational ) ) { org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.poolStatusChanged ( pool.getId ( ) , StoragePoolStatus.NotOperational ) ; } } }
Source:
public int hashCode ( ) { int hash = ( this . name.hashCode ( ) ) * 7 ; hash += ( this . value.hashCode ( ) ) * 7 ; hash += ( this . id.hashCode ( ) ) * 7 ; return hash ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( id ) == null ? 0 : id.hashCode ( ) ) ; result = ( prime * result ) + ( ( name ) == null ? 0 : name.hashCode ( ) ) ; result = ( prime * result ) + ( ( value ) == null ? 0 : value.hashCode ( ) ) ; return result ; }
Source:
private void overrideInjector ( org.ovirt.engine.core.di.Injector mockedInjector ) { try { java.lang.reflect.Field holdingMember = org.ovirt.engine.core.di.Injector.class . getDeclaredField ( "injector" ) ; holdingMember.setAccessible ( true ) ; holdingMember.set ( org.ovirt.engine.core.di.Injector.class , mockedInjector ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public < U extends T > javax.enterprise.inject.Instance < U > select ( javax.enterprise.util.TypeLiteral < U > typeLiteral , java.lang.annotation.Annotation ... annotations ) { return null ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( java.util.Objects.hashCode ( entityId ) ) ; result = ( prime * result ) + ( java.util.Objects.hashCode ( entityType ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( entityId , entityType ) ; }
Source:
private void mockFencedHost ( ) { fencedHost = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( fencedHost.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCECD_HOST_ID ) ; org.mockito.Mockito.when ( fencedHost.getVdsGroupId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_CLUSTER_ID ) ; org.mockito.Mockito.when ( fencedHost.getStoragePoolId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_DATACENTER_ID ) ; org.mockito.Mockito.when ( fencedHost.getHostName ( ) ) . thenReturn ( "fencedHost" ) ; org.mockito.Mockito.when ( fencedHost.getFenceAgents ( ) ) . thenReturn ( java.util.Arrays.asList ( createFenceAgent ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCECD_HOST_ID , "ipmilan" ) ) ) ; }

Target:
private void mockFencedHost ( ) { fencedHost = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( fencedHost.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCECD_HOST_ID ) ; org.mockito.Mockito.when ( fencedHost.getClusterId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_CLUSTER_ID ) ; org.mockito.Mockito.when ( fencedHost.getStoragePoolId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_DATACENTER_ID ) ; org.mockito.Mockito.when ( fencedHost.getHostName ( ) ) . thenReturn ( "fencedHost" ) ; org.mockito.Mockito.when ( fencedHost.getFenceAgents ( ) ) . thenReturn ( java.util.Arrays.asList ( createFenceAgent ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCECD_HOST_ID , "ipmilan" ) ) ) ; }
Source:
private void verifyRelationWithHostNetworkQos ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment entity ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos hostNetworkQos = entity.getHostNetworkQos ( ) ; if ( ( hostNetworkQos != null ) && ( ! ( java.util.Objects.equals ( hostNetworkQos.getId ( ) , entity.getId ( ) ) ) ) ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Overridden HostNetworkQos using id %s which does not related to given entity id %s" , hostNetworkQos.getId ( ) , entity.getId ( ) ) ) ; } }

Target:
private void verifyRelationWithHostNetworkQos ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment entity ) { org.ovirt.engine.core.common.businessentities.network.AnonymousHostNetworkQos hostNetworkQos = entity.getHostNetworkQos ( ) ; if ( ( hostNetworkQos != null ) && ( ! ( java.util.Objects.equals ( hostNetworkQos.getId ( ) , entity.getId ( ) ) ) ) ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Overridden HostNetworkQos using id %s which does not related to given entity id %s" , hostNetworkQos.getId ( ) , entity.getId ( ) ) ) ; } }