auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void testLogReturnLogsWhenLogLevelActiveAndExpandReturnButNullReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) , null ) ; org.mockito.Mockito.verify ( log ) . debug ( org.mockito.ArgumentMatchers.eq ( LoggedUtils.EXIT_LOG_VOID ) , new java.lang.Object [ ] { org.mockito.ArgumentMatchers.anyObject ( ) , org.mockito.ArgumentMatchers.eq ( "" ) } ) ; }

Target:
public void testLogReturnLogsWhenLogLevelActiveAndExpandReturnButNullReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) , null ) ; org.mockito.Mockito.verify ( log ) . debug ( org.mockito.ArgumentMatchers.eq ( LoggedUtils.EXIT_LOG_VOID ) , new java.lang.Object [ ] { org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.eq ( "" ) } ) ; }
Source:
private org.ovirt.engine.core.common.action.AddDiskParameters buildAddDiskParameters ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.AddDiskParameters parameters = new org.ovirt.engine.core.common.action.AddDiskParameters ( org.ovirt.engine.core.compat.Guid.Empty , disk ) ; parameters.setStorageDomainId ( getStorageDomainId ( ) ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.HibernateVmCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.HibernateVmCommand.getParameters ( ) ) ; parameters.setShouldBeLogged ( false ) ; return parameters ; }

Target:
private org.ovirt.engine.core.common.action.AddDiskParameters buildAddDiskParameters ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.AddDiskParameters parameters = new org.ovirt.engine.core.common.action.AddDiskParameters ( disk ) ; parameters.setStorageDomainId ( getStorageDomainId ( ) ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.HibernateVmCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.HibernateVmCommand.getParameters ( ) ) ; parameters.setShouldBeLogged ( false ) ; return parameters ; }
Source:
public void dontSyncNetworkAlreadyInSync ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( nic ) ) ; validateAndAssertNoChanges ( helper ) ; }

Target:
public void dontSyncNetworkAlreadyInSync ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( nic ) ) ; validateAndAssertNoChanges ( helper ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.Set < java.lang.String > primaryDevices = getNonPlaceholderDeviceNames ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.HostDeviceView > hostDeviceList = hostDeviceDao.getVmExtendedHostDevicesByVmId ( org.ovirt.engine.core.bll.GetExtendedVmHostDevicesByVmIdQuery.getParameters ( ) . getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.HostDeviceView > result = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.HostDeviceView deviceView : hostDeviceList ) { if ( primaryDevices.contains ( deviceView.getDeviceName ( ) ) ) { result.add ( deviceView ) ; } } org.ovirt.engine.core.bll.GetExtendedVmHostDevicesByVmIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDeviceView > hostDeviceList = hostDeviceDao.getVmExtendedHostDevicesByVmId ( org.ovirt.engine.core.bll.GetExtendedVmHostDevicesByVmIdQuery.getParameters ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.GetExtendedVmHostDevicesByVmIdQuery.getQueryReturnValue ( ) . setReturnValue ( hostDeviceList ) ; }
Source:
public void notEnoughSpace ( ) { org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings settings = new org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings ( ) ; settings.diskSpaceFree = 4 ; settings.diskSpaceUsed = 6 ; settings.spaceThresholdGB = 5 ; settings.spaceThresholdPct = 10 ; org.ovirt.engine.core.common.businessentities.storage_domains domain = setupForSpaceTest ( settings ) ; org.junit.Assert.assertFalse ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.isWithinThresholds ( domain ) ) ; }

Target:
public void notEnoughSpace ( ) { org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings settings = new org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings ( ) ; settings.diskSpaceFree = 4 ; settings.diskSpaceUsed = 6 ; settings.spaceThresholdGB = 5 ; org.ovirt.engine.core.common.businessentities.storage_domains domain = setupForSpaceTest ( settings ) ; org.junit.Assert.assertFalse ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.isWithinThresholds ( domain ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage createNotVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.IDE ) ; disk.setactive ( true ) ; disk.setvm_guid ( vmId ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.powermock.api.mockito.PowerMockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; return disk ; }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage createNotVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.IDE ) ; disk.setactive ( true ) ; disk.setvm_guid ( vmId ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; return disk ; }
Source:
public void validatePass ( ) { org.mockito.Mockito.when ( hostedEngineHelper.getStorageDomain ( ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sd = mockGetExistingDomain ( true ) ; int i = new java.util.Random ( ) . nextInt ( SUPPORTED_DOMAIN_TYPES.length ) ; sd.setStorageType ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES [ i ] ) ; sd.setId ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommandTest.HE_SD_ID ) ; cmd.init ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validatePass ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = mockGetExistingDomain ( true ) ; int i = new java.util.Random ( ) . nextInt ( SUPPORTED_DOMAIN_TYPES.length ) ; sd.setStorageType ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES [ i ] ) ; sd.setId ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommandTest.HE_SD_ID ) ; cmd.init ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
protected void initStoragePoolId ( ) { if ( ( ( org.ovirt.engine.core.bll.RemoveImageCommand.getStoragePoolId ( ) ) == null ) || ( Guid.Empty.equals ( org.ovirt.engine.core.bll.RemoveImageCommand.getStoragePoolId ( ) ) ) ) { setStoragePoolId ( ( ( ( org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImage ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImage ( ) . getstorage_pool_id ( ) ) != null ) ? org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImage ( ) . getstorage_pool_id ( ) . getValue ( ) : org.ovirt.engine.core.compat.Guid.Empty ) ) ; } }

Target:
protected void initStoragePoolId ( ) { if ( ( ( org.ovirt.engine.core.bll.RemoveImageCommand.getStoragePoolId ( ) ) == null ) || ( Guid.Empty.equals ( org.ovirt.engine.core.bll.RemoveImageCommand.getStoragePoolId ( ) ) ) ) { setStoragePoolId ( ( ( ( org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImage ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImage ( ) . getStoragePoolId ( ) ) != null ) ? org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImage ( ) . getStoragePoolId ( ) . getValue ( ) : org.ovirt.engine.core.compat.Guid.Empty ) ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , java.util.Map < java.lang.String , java.lang.Object > parameters ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > list = new java.util.ArrayList < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { list.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > ( host.getId ( ) , 1 ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > list = new java.util.ArrayList < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { list.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > ( host.getId ( ) , 1 ) ) ; } return list ; }
Source:
public void testGetAllStaticByStoragePool ( ) { org.ovirt.engine.core.compat.NGuid spID = dbFacade.getVdsGroupDao ( ) . get ( newVmStatic.getvds_group_id ( ) ) . getstorage_pool_id ( ) ; org.junit.Assert.assertNotNull ( spID.getValue ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllByStoragePoolId ( spID.getValue ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }

Target:
public void testGetAllStaticByStoragePool ( ) { org.ovirt.engine.core.compat.NGuid spID = dbFacade.getVdsGroupDao ( ) . get ( newVmStatic.getvds_group_id ( ) ) . getStoragePoolId ( ) ; org.junit.Assert.assertNotNull ( spID.getValue ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllByStoragePoolId ( spID.getValue ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VM createVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic dynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.common.businessentities.VmStatic stat = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; stat.setVmtGuid ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; stat.setName ( "testVm" ) ; stat.setPriority ( 1 ) ; vm.setStaticData ( stat ) ; vm.setDynamicData ( dynamic ) ; vm.setSingleQxlPci ( false ) ; return vm ; }

Target:
protected static org.ovirt.engine.core.common.businessentities.VM createVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic dynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.common.businessentities.VmStatic stat = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; stat.setVmtGuid ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; stat.setName ( "testVm" ) ; stat.setPriority ( 1 ) ; vm.setStaticData ( stat ) ; vm.setDynamicData ( dynamic ) ; vm.setSingleQxlPci ( false ) ; return vm ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.provider.storage.LibvirtSecretValidator libvirtSecretValidator = new org.ovirt.engine.core.bll.provider.storage.LibvirtSecretValidator ( getParameters ( ) . getLibvirtSecret ( ) ) ; return ( ( ( validate ( libvirtSecretValidator.uuidNotEmpty ( ) ) ) && ( validate ( libvirtSecretValidator.uuidNotExist ( ) ) ) ) && ( validate ( libvirtSecretValidator.valueNotEmpty ( ) ) ) ) && ( validate ( libvirtSecretValidator.providerExist ( ) ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.provider.storage.LibvirtSecretValidator libvirtSecretValidator = new org.ovirt.engine.core.bll.provider.storage.LibvirtSecretValidator ( getParameters ( ) . getLibvirtSecret ( ) ) ; return ( ( ( validate ( libvirtSecretValidator.uuidNotEmpty ( ) ) ) && ( validate ( libvirtSecretValidator.uuidNotExist ( ) ) ) ) && ( validate ( libvirtSecretValidator.valueNotEmpty ( ) ) ) ) && ( validate ( libvirtSecretValidator.providerExist ( ) ) ) ; }
Source:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByNameAndDataCenter ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 , FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( result.getDnsResolverConfiguration ( ) . getId ( ) , FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ; dao.remove ( result.getId ( ) ) ; org.junit.Assert.assertNull ( dao.getByNameAndDataCenter ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 , FixturesTool.DATA_CENTER ) ) ; org.junit.Assert.assertNull ( dnsResolverConfigurationDao.get ( FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ) ; }

Target:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByNameAndDataCenter ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 , FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE , result.getDnsResolverConfiguration ( ) . getId ( ) ) ; dao.remove ( result.getId ( ) ) ; org.junit.Assert.assertNull ( dao.getByNameAndDataCenter ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 , FixturesTool.DATA_CENTER ) ) ; org.junit.Assert.assertNull ( dnsResolverConfigurationDao.get ( FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ) ; }
Source:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }
Source:
public javax.ws.rs.core.Response remove ( ) { org.ovirt.engine.api.model.StorageDomain storageDomain = get ( ) ; if ( storageDomain.getStorage ( ) . getType ( ) . equals ( StorageType.LOCALFS.value ( ) ) ) { org.ovirt.engine.core.common.action.RemoveStorageDomainParameters params = new org.ovirt.engine.core.common.action.RemoveStorageDomainParameters ( guid ) ; params.setDoFormat ( true ) ; return performAction ( VdcActionType.RemoveStorageDomain , params ) ; } else { org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters params = new org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters ( guid , dataCenterId ) ; return performAction ( VdcActionType.DetachStorageDomainFromPool , params ) ; } }

Target:
public javax.ws.rs.core.Response remove ( ) { org.ovirt.engine.api.model.StorageDomain storageDomain = get ( ) ; if ( storageDomain.getStorage ( ) . getType ( ) . equals ( StorageType.LOCALFS ) ) { org.ovirt.engine.core.common.action.RemoveStorageDomainParameters params = new org.ovirt.engine.core.common.action.RemoveStorageDomainParameters ( guid ) ; params.setDoFormat ( true ) ; return performAction ( VdcActionType.RemoveStorageDomain , params ) ; } else { org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters params = new org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters ( guid , dataCenterId ) ; return performAction ( VdcActionType.DetachStorageDomainFromPool , params ) ; } }
Source:
public void setUp ( ) { initializeOsRepository ( 1 , DiskInterface.VirtIO ) ; disk = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createDiskImage ( ) ; disk.setDiskAlias ( "disk1" ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk , vmDeviceUtils ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( validator ) . getVmDao ( ) ; }

Target:
public void setUp ( ) { initializeOsRepository ( DiskInterface.VirtIO ) ; disk = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createDiskImage ( ) ; disk.setDiskAlias ( "disk1" ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk , vmDeviceUtils ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( validator ) . getVmDao ( ) ; }
Source:
private boolean Register ( org.ovirt.engine.core.common.businessentities.VDS vdsByUniqueId , org.ovirt.engine.core.compat.Guid vdsGroupId , boolean IsPending ) { boolean returnValue = true ; log.debugFormat ( "RegisterVdsQuery::Register - Entering" ) ; if ( vdsByUniqueId == null ) { returnValue = registerNewHost ( vdsGroupId , IsPending ) ; } else { returnValue = updateExistingHost ( vdsByUniqueId , IsPending ) ; } log.debugFormat ( "RegisterVdsQuery::Register - Leaving with value {0}" , returnValue ) ; return returnValue ; }

Target:
private boolean Register ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.compat.Guid vdsGroupId , boolean IsPending ) { boolean returnValue = true ; log.debugFormat ( "RegisterVdsQuery::Register - Entering" ) ; if ( vds == null ) { returnValue = registerNewHost ( vdsGroupId , IsPending ) ; } else { returnValue = updateExistingHost ( vds , IsPending ) ; } log.debugFormat ( "RegisterVdsQuery::Register - Leaving with value {0}" , returnValue ) ; return returnValue ; }
Source:
protected org.ovirt.engine.api.model.Host deprecatedPopulate ( org.ovirt.engine.api.model.Host model , org.ovirt.engine.core.common.businessentities.VDS entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity ) ; } addCertificateInfo ( model ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.Host deprecatedPopulate ( org.ovirt.engine.api.model.Host model , org.ovirt.engine.core.common.businessentities.VDS entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity ) ; } return model ; }
Source:
private void ReturnVm ( ) { org.ovirt.engine.core.common.businessentities.VM entity = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getItem ( ) . getEntity ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.ShutdownVm , new org.ovirt.engine.core.common.action.ShutdownVmParameters ( entity.getId ( ) , false ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { } } , null ) ; }

Target:
private void ReturnVm ( ) { org.ovirt.engine.core.common.businessentities.VM entity = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getItem ( ) . getEntity ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.ShutdownVm , new org.ovirt.engine.core.common.action.ShutdownVmParameters ( entity.getId ( ) , false ) , null , null ) ; }
Source:
public void testGetVmTemplatesIdsForOvfUpdateOneTemplate ( ) { vmAndTemplatesGenerationsDao.updateOvfGenerations ( java.util.Collections.singletonList ( FixturesTool.VM_TEMPLATE_RHEL5 ) , java.util.Collections.singletonList ( java.lang.Long.valueOf ( 0 ) ) , java.util.Arrays.asList ( "a" ) ) ; java.util.List < org.ovirt.engine.core.compat.Guid > guids = vmAndTemplatesGenerationsDao.getVmTemplatesIdsForOvfUpdate ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER ) ; org.junit.Assert.assertEquals ( "one template should need ovf update" , 1 , guids.size ( ) ) ; org.junit.Assert.assertEquals ( "wrong template returned as in need for ovf update" , guids.get ( 0 ) , FixturesTool.VM_TEMPLATE_RHEL5 ) ; }

Target:
public void testGetVmTemplatesIdsForOvfUpdateOneTemplate ( ) { vmAndTemplatesGenerationsDao.updateOvfGenerations ( java.util.Collections.singletonList ( FixturesTool.VM_TEMPLATE_RHEL5 ) , java.util.Collections.singletonList ( java.lang.Long.valueOf ( 0 ) ) , java.util.Arrays.asList ( "a" ) ) ; java.util.List < org.ovirt.engine.core.compat.Guid > guids = vmAndTemplatesGenerationsDao.getVmTemplatesIdsForOvfUpdate ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER ) ; org.junit.Assert.assertEquals ( "one template should need ovf update" , 1 , guids.size ( ) ) ; org.junit.Assert.assertEquals ( "wrong template returned as in need for ovf update" , FixturesTool.VM_TEMPLATE_RHEL5 , guids.get ( 0 ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface mock , int index ) { org.easymock.EasyMock.expect ( mock.getInterfaceName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( mock.getMacAddress ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDeviceResourceTest.ADDRESS ) . anyTimes ( ) ; return mock ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface mock , int index ) { org.mockito.Mockito.when ( mock.getInterfaceName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( mock.getMacAddress ( ) ) . thenReturn ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDeviceResourceTest.ADDRESS ) ; return mock ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportNetworkData importData = importModel.getNetworkImportData ( object.getMacAddress ( ) ) ; java.util.ArrayList < java.lang.String > networkList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : importModel.getNetworks ( ) ) { networkList.add ( network.getName ( ) ) ; } ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( networkList ) ; return networkList.isEmpty ( ) ? "" : networkList.get ( 0 ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { java.util.ArrayList < java.lang.String > networkList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : importModel.getNetworks ( ) ) { networkList.add ( network.getName ( ) ) ; } ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( networkList ) ; return networkList.isEmpty ( ) ? "" : networkList.get ( 0 ) ; }
Source:
protected boolean canDoAction ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.VDS_INVALID_SERVER_ID ) ; result = false ; } else if ( ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Connecting ) ) || ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_CANNOT_CHECK_VERSION_HOST_NON_RESPONSIVE ) ; result = false ; } return result ; }

Target:
protected boolean canDoAction ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.VDS_INVALID_SERVER_ID ) ; result = false ; } else if ( ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Connecting ) ) || ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_CANNOT_CHECK_VERSION_HOST_NON_RESPONSIVE ) ; result = false ; } return result ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; return qRetVal.getSucceeded ( ) ? qRetVal.< java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) : null ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; return qRetVal.getSucceeded ( ) ? qRetVal.< java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) : null ; }
Source:
public static void addUsbSlots ( org.ovirt.engine.core.compat.Guid vmId , int numberOfSlots ) { for ( int index = 1 ; index <= numberOfSlots ; index ++ ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmId ) , VmDeviceGeneralType.REDIR , VmDeviceType.SPICEVMC , org.ovirt.engine.core.bll.utils.VmDeviceUtils.EMPTY_SPEC_PARAMS , true , false ) ; } }

Target:
public void addUsbSlots ( org.ovirt.engine.core.compat.Guid vmId , int numberOfSlots ) { for ( int index = 1 ; index <= numberOfSlots ; index ++ ) { addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmId ) , VmDeviceGeneralType.REDIR , VmDeviceType.SPICEVMC , org.ovirt.engine.core.bll.utils.VmDeviceUtils.EMPTY_SPEC_PARAMS , true , false ) ; } }
Source:
public void showProfileStats ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileInfo entity ) { final java.util.List < org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails > brickProfileDetails = entity.getBrickProfileDetails ( ) ; getBricks ( ) . setItems ( brickProfileDetails ) ; getBricks ( ) . setSelectedItem ( brickProfileDetails.get ( 0 ) ) ; }

Target:
public void showProfileStats ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileInfo entity ) { if ( entity != null ) { final java.util.List < org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails > brickProfileDetails = entity.getBrickProfileDetails ( ) ; getBricks ( ) . setItems ( brickProfileDetails ) ; if ( ( brickProfileDetails.size ( ) ) > 0 ) { getBricks ( ) . setSelectedItem ( brickProfileDetails.get ( 0 ) ) ; } } }
Source:
public org.ovirt.optimizer.rest.dto.ScoreResult recomputeScore ( org.ovirt.optimizer.solver.problemspace.OptimalDistributionStepsSolution situation , org.ovirt.optimizer.rest.dto.Result result ) { org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore score = org.ovirt.optimizer.solver.util.SolverUtils.computeScore ( situation , result.getMigrations ( ) , java.util.Collections.< java.lang.String > emptySet ( ) , configProvider.customRuleFiles ( ) ) ; org.ovirt.optimizer.rest.dto.ScoreResult scoreResult = new org.ovirt.optimizer.rest.dto.ScoreResult ( ) ; scoreResult.setHardScore ( score.getHardScore ( ) ) ; scoreResult.setSoftScore ( score.getSoftScore ( ) ) ; return scoreResult ; }

Target:
public org.ovirt.optimizer.rest.dto.ScoreResult recomputeScore ( org.ovirt.optimizer.solver.problemspace.OptimalDistributionStepsSolution situation , org.ovirt.optimizer.rest.dto.Result result ) { org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore score = org.ovirt.optimizer.solver.util.SolverUtils.computeScore ( situation , result , java.util.Collections.< java.lang.String > emptySet ( ) , configProvider.customRuleFiles ( ) ) ; org.ovirt.optimizer.rest.dto.ScoreResult scoreResult = new org.ovirt.optimizer.rest.dto.ScoreResult ( ) ; scoreResult.setHardScore ( score.getHardScore ( ) ) ; scoreResult.setSoftScore ( score.getSoftScore ( ) ) ; return scoreResult ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }
Source:
public void testCheckGlusterQuorumWithVolumeDown ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getGlusterVolumes ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID , GlusterStatus.DOWN ) ) . when ( volumeDao ) . getByClusterId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; org.junit.Assert.assertTrue ( "Quorum check is failing with volumes in down status" , hostValidator.checkGlusterQuorum ( cluster , hostIds ) . isEmpty ( ) ) ; }

Target:
public void testCheckGlusterQuorumWithVolumeDown ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true ) ; org.mockito.Mockito.doReturn ( getGlusterVolumes ( GlusterStatus.DOWN ) ) . when ( volumeDao ) . getByClusterId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; org.junit.Assert.assertTrue ( "Quorum check is failing with volumes in down status" , hostValidator.checkGlusterQuorum ( cluster , hostIds ) . isEmpty ( ) ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { if ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getTemplateType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { return true ; } return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getMasterVm ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { if ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getTemplateType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { return true ; } return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getMasterVm ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getVm ( ) . getCompatibilityVersion ( ) ) ) ; }
Source:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.gluster.EntityIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.gluster.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.api.restapi.resource.VolumeStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.VolumeStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.GlusterVolume , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > ( entityType , guid , query ) ) ; }

Target:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.gluster.EntityIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.gluster.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.api.restapi.resource.VolumeStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.VolumeStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource ( entityType , guid , query ) ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getMapValue ( final java.lang.String name , final java.lang.String defaultValue ) { final java.lang.String jsonString = ( ( java.lang.String ) ( GetValue ( DataType.String , name , defaultValue ) ) ) ; if ( jsonString != null ) { return new org.ovirt.engine.core.utils.serialization.json.JsonObjectDeserializer ( ) . deserialize ( jsonString , java.util.HashMap.class ) ; } else { return null ; } }

Target:
public java.util.Map < java.lang.String , java.lang.String > getMapValue ( final java.lang.String name , final java.lang.String defaultValue ) { final java.lang.String jsonString = ( ( java.lang.String ) ( getValue ( DataType.String , name , defaultValue ) ) ) ; if ( jsonString != null ) { return new org.ovirt.engine.core.utils.serialization.json.JsonObjectDeserializer ( ) . deserialize ( jsonString , java.util.HashMap.class ) ; } else { return null ; } }
Source:
public void checkExecuteCommandWithEmptyVdsId ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doNothing ( ) . when ( storageServerConnectionDao ) . remove ( NFSConnection.getId ( ) ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.never ( ) ) . disconnectStorage ( ) ; }

Target:
public void checkExecuteCommandWithEmptyVdsId ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; parameters.setVdsId ( Guid.Empty ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.never ( ) ) . disconnectStorage ( ) ; }
Source:
public final void setData ( java.lang.String sessionId , java.lang.String key , java.lang.Object value ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; if ( sessionInfo == null ) { sessionInfo = new org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo ( ) ; sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_ID , sessionId ) ; org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo oldSessionInfo = sessionInfoMap.putIfAbsent ( sessionId , sessionInfo ) ; if ( oldSessionInfo != null ) { sessionInfo = oldSessionInfo ; } } sessionInfo.contentOfSession.put ( key , value ) ; }

Target:
protected final void setData ( java.lang.String sessionId , java.lang.String key , java.lang.Object value ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; if ( sessionInfo == null ) { sessionInfo = new org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo ( ) ; sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_ID , sessionId ) ; org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo oldSessionInfo = sessionInfoMap.putIfAbsent ( sessionId , sessionInfo ) ; if ( oldSessionInfo != null ) { sessionInfo = oldSessionInfo ; } } sessionInfo.contentOfSession.put ( key , value ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVdcOptionDao ( ) ) ; existingOption = dao.getByNameAndVersion ( "UserDefinedVmPropertiesKey1" , "general" ) ; newOption = new org.ovirt.engine.core.common.businessentities.VdcOption ( ) ; newOption.setoption_name ( "option_name" ) ; newOption.setoption_value ( "option_value" ) ; newOption.setversion ( "general" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVdcOptionDao ( ) ; existingOption = dao.getByNameAndVersion ( "UserDefinedVmPropertiesKey1" , "general" ) ; newOption = new org.ovirt.engine.core.common.businessentities.VdcOption ( ) ; newOption.setoption_name ( "option_name" ) ; newOption.setoption_value ( "option_value" ) ; newOption.setversion ( "general" ) ; }
Source:
private boolean updateImageParametersRequiringVmDownRequested ( ) { if ( ( getOldDisk ( ) . getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return false ; } org.ovirt.engine.core.compat.Guid oldQuotaId = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) . getQuotaId ( ) ; return ! ( java.util.Objects.equals ( oldQuotaId , getQuotaId ( ) ) ) ; }

Target:
private boolean updateImageParametersRequiringVmDownRequested ( ) { if ( ( getOldDisk ( ) . getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return false ; } org.ovirt.engine.core.compat.Guid oldQuotaId = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) . getQuotaId ( ) ; if ( oldQuotaId == null ) { return false ; } return ! ( java.util.Objects.equals ( oldQuotaId , getQuotaId ( ) ) ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; boolean detach = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendVmDiskResource.DETACH_ONLY , true , false ) ; if ( detach ) { return performAction ( VdcActionType.DetachDiskFromVm , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( vmId , guid ) ) ; } else { return performAction ( VdcActionType.RemoveDisk , new org.ovirt.engine.core.common.action.RemoveDiskParameters ( guid ) ) ; } }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; return performAction ( VdcActionType.DetachDiskFromVm , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( vmId , guid ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { getView ( ) . clear ( ) ; return ; } getView ( ) . edit ( modelProvider.getModel ( ) ) ; getView ( ) . displayVmOsImages ( true ) ; setupDisks ( modelProvider ) ; setupConsole ( modelProvider ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } setupDisks ( modelProvider ) ; }
Source:
private void createObjects ( org.ovirt.engine.core.compat.Version version ) { existingServer1 = createServer ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.SERVER_NAME_1 , version ) ; existingServer2 = createServer ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.SERVER_ID_2 , org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.SERVER_NAME_2 , version ) ; existingServers.add ( existingServer1 ) ; existingServers.add ( existingServer2 ) ; existingServers.add ( createServer ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.SERVER_ID_3 , org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.SERVER_NAME_3 , version ) ) ; existingDistVol = createDistVol ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.DIST_VOL_NAME , org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.EXISTING_VOL_DIST_ID ) ; existingReplVol = createReplVol ( ) ; }

Target:
private void createObjects ( ) { existingServer1 = createServer ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.SERVER_NAME_1 ) ; existingServer2 = createServer ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.SERVER_ID_2 , org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.SERVER_NAME_2 ) ; existingServers.add ( existingServer1 ) ; existingServers.add ( existingServer2 ) ; existingServers.add ( createServer ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.SERVER_ID_3 , org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.SERVER_NAME_3 ) ) ; existingDistVol = createDistVol ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.DIST_VOL_NAME , org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.EXISTING_VOL_DIST_ID ) ; existingReplVol = createReplVol ( ) ; }
Source:
public void testGetPagPhrase ( ) { mcr.mockConfigValue ( ConfigValues.DBPagingType , "wrongPageType" ) ; mcr.mockConfigValue ( ConfigValues.DBPagingSyntax , "wrongPageSyntax" ) ; org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = new org.ovirt.engine.core.searchbackend.SyntaxContainer ( "" ) ; res.setMaxCount ( 0 ) ; org.junit.Assert.assertEquals ( "" , chkr.getPagePhrase ( res , "1" ) ) ; mcr.mockConfigValue ( ConfigValues.DBPagingType , "Range" ) ; mcr.mockConfigValue ( ConfigValues.DBPagingSyntax , " WHERE RowNum BETWEEN %1$s AND %2$s" ) ; org.junit.Assert.assertNotEquals ( "" , chkr.getPagePhrase ( res , "1" ) ) ; }

Target:
public void testGetPagPhrase ( ) { mcr.mockConfigValue ( ConfigValues.DBPagingType , "Range" ) ; mcr.mockConfigValue ( ConfigValues.DBPagingSyntax , " WHERE RowNum BETWEEN %1$s AND %2$s" ) ; org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = new org.ovirt.engine.core.searchbackend.SyntaxContainer ( "" ) ; res.setMaxCount ( 0 ) ; org.junit.Assert.assertNotEquals ( "" , chkr.getPagePhrase ( res , "1" ) ) ; }