auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void validateSucceeds ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId2 ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( cmd ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getSingleBrickVolume ( volumeId1 ) ) . when ( volumeDao ) . getById ( volumeId1 ) ; org.mockito.Mockito.doReturn ( getMultiBrickVolume ( volumeId2 ) ) . when ( volumeDao ) . getById ( volumeId2 ) ; }
Source:
public org.ovirt.engine.core.compat.Guid getStorageDomainId ( ) { if ( ( _storageDomainId.equals ( Guid.Empty ) ) && ( ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) ) != null ) ) { long sizeNeeded = ( ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getTotalMemorySizeInBytes ( ) ) + ( org.ovirt.engine.core.bll.HibernateVmCommand.META_DATA_SIZE_IN_BYTES ) ) / ( BYTES_IN_GB ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getStoragePoolId ( ) , sizeNeeded ) ; if ( storageDomain != null ) { _storageDomainId = storageDomain.getId ( ) ; } } return _storageDomainId ; }

Target:
public org.ovirt.engine.core.compat.Guid getStorageDomainId ( ) { if ( ( _storageDomainId.equals ( Guid.Empty ) ) && ( ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) ) != null ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskDummiesForMemSize = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getTotalMemorySizeInBytes ( ) , org.ovirt.engine.core.bll.HibernateVmCommand.META_DATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getStoragePoolId ( ) , diskDummiesForMemSize ) ; if ( storageDomain != null ) { _storageDomainId = storageDomain.getId ( ) ; } } return _storageDomainId ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VmTemplate createVmTemplate ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; template.setName ( "test-template" ) ; template.setOrigin ( OriginType.OVIRT ) ; template.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; template.setDescription ( "test-description" ) ; template.setDbGeneration ( 2L ) ; template.setClusterArch ( ArchitectureType.x86_64 ) ; return template ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VmTemplate createVmTemplate ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; template.setName ( "test-template" ) ; template.setOrigin ( OriginType.OVIRT ) ; template.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; template.setDescription ( "test-description" ) ; template.setDbGeneration ( 2L ) ; template.setClusterArch ( ArchitectureType.x86_64 ) ; template.setOsId ( org.ovirt.engine.core.utils.ovf.OvfManagerTest.EXISTING_OS_ID ) ; return template ; }
Source:
protected org.ovirt.engine.api.model.StorageDomain getInverse ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic to ) { org.ovirt.engine.api.model.StorageDomain inverse = new org.ovirt.engine.api.model.StorageDomain ( ) ; inverse.setId ( to.getId ( ) ) ; inverse.setStorageName ( to.getStorageName ( ) ) ; inverse.setStorageDomainType ( to.getStorageDomainType ( ) ) ; inverse.setStorageType ( to.getStorageType ( ) ) ; inverse.setStorageFormat ( to.getStorageFormat ( ) ) ; return inverse ; }

Target:
protected org.ovirt.engine.api.model.StorageDomain getInverse ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic to ) { org.ovirt.engine.api.model.StorageDomain inverse = new org.ovirt.engine.api.model.StorageDomain ( ) ; inverse.setId ( to.getId ( ) ) ; inverse.setStorageName ( to.getStorageName ( ) ) ; inverse.setStorageDomainType ( to.getStorageDomainType ( ) ) ; inverse.setStorageType ( to.getStorageType ( ) ) ; inverse.setStorageFormat ( to.getStorageFormat ( ) ) ; inverse.setComment ( to.getComment ( ) ) ; return inverse ; }
Source:
protected void executeCommand ( ) { getProviderDao ( ) . remove ( org.ovirt.engine.core.bll.provider.RemoveProviderCommand.getParameters ( ) . getProvider ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.provider.RemoveProviderCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { final org.ovirt.engine.core.compat.Guid providerId = org.ovirt.engine.core.bll.provider.RemoveProviderCommand.getParameters ( ) . getProvider ( ) . getId ( ) ; org.ovirt.engine.core.bll.provider.ProviderProxy providerProxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( org.ovirt.engine.core.bll.provider.RemoveProviderCommand.getParameters ( ) . getProvider ( ) ) ; if ( providerProxy != null ) { providerProxy.onRemoval ( ) ; } getProviderDao ( ) . remove ( providerId ) ; org.ovirt.engine.core.bll.provider.RemoveProviderCommand.setSucceeded ( true ) ; }
Source:
private void handleLogout ( java.lang.String accessToken , javax.servlet.http.HttpServletResponse response ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = backend.runInternalAction ( VdcActionType.TerminateSessionsForToken , new org.ovirt.engine.core.common.action.TerminateSessionsForTokenParameters ( accessToken ) ) ; if ( returnValue.getSucceeded ( ) ) { response.setStatus ( java.net.HttpURLConnection.HTTP_OK ) ; org.ovirt.engine.core.services.SsoCallbackServlet.log.debug ( "Invalidate Sessions for access token '{}' succeeded" , accessToken ) ; } else { response.setStatus ( java.net.HttpURLConnection.HTTP_INTERNAL_ERROR ) ; org.ovirt.engine.core.services.SsoCallbackServlet.log.debug ( "Invalidate Sessions for access token '{}' failed" , accessToken ) ; } }

Target:
private void handleLogout ( java.lang.String accessToken , javax.servlet.http.HttpServletResponse response ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = backend.runInternalAction ( ActionType.TerminateSessionsForToken , new org.ovirt.engine.core.common.action.TerminateSessionsForTokenParameters ( accessToken ) ) ; if ( returnValue.getSucceeded ( ) ) { response.setStatus ( java.net.HttpURLConnection.HTTP_OK ) ; org.ovirt.engine.core.services.SsoCallbackServlet.log.debug ( "Invalidate Sessions for access token '{}' succeeded" , accessToken ) ; } else { response.setStatus ( java.net.HttpURLConnection.HTTP_INTERNAL_ERROR ) ; org.ovirt.engine.core.services.SsoCallbackServlet.log.debug ( "Invalidate Sessions for access token '{}' failed" , accessToken ) ; } }
Source:
public void testAddIscsiLunDisk_IncompleteParameters_ConnectionTarget ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . get ( 0 ) . setTarget ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "validateDiskForCreation" , "target" ) ; } }

Target:
public void testAddIscsiLunDisk_IncompleteParameters_ConnectionAddress ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . get ( 0 ) . setAddress ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddIscsiLunDisk_IncompleteParameters_ConnectionAddress" , "address" ) ; } }
Source:
public java.lang.Object call ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = getStoragePoolIsoMapDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( storageDomainId , storagePoolId ) ) ; map.setStatus ( storageDomainStatus ) ; getStoragePoolIsoMapDao ( ) . updateStatus ( map.getId ( ) , map.getStatus ( ) ) ; return null ; }

Target:
public java.lang.Object call ( ) { getStoragePoolIsoMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( mapToRemove.getstorage_id ( ) , mapToRemove.getstorage_pool_id ( ) ) ) ; return null ; }
Source:
public static void getRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; }
Source:
public java.lang.String toString ( ) { return java.lang.String.format ( ( "%s, networkName=%s, oldNetworkName=%s, hostAddr=%s, checkConnectivity=%s, " + ( "connectionTimeout=%s, vlanId=%s, bondName=%s, nics=%s, inetAddr=%s, networkMask=%s, gateway=%s, " + "stp=%s, bondingOptions=%s, bootProtocol=%s, vmNetwork=%s" ) ) , super . toString ( ) , getNetworkName ( ) , getOldNetworkName ( ) , getHostAddr ( ) , getCheckConnectivity ( ) , getConnectionTimeout ( ) , getVlanId ( ) , getBondName ( ) , java.util.Arrays.toString ( getNics ( ) ) , getInetAddr ( ) , getNetworkMask ( ) , getGateway ( ) , getStp ( ) , getBondingOptions ( ) , getBootProtocol ( ) , isVmNetwork ( ) ) ; }

Target:
public java.lang.String toString ( ) { return java.lang.String.format ( ( "%s, networkName=%s, oldNetworkName=%s, hostAddr=%s, checkConnectivity=%s, " + ( "connectionTimeout=%s, vlanId=%s, bondName=%s, nics=%s, inetAddr=%s, networkMask=%s, gateway=%s, " + "stp=%s, bondingOptions=%s, bootProtocol=%s, vmNetwork=%s, network=%s" ) ) , super . toString ( ) , getNetworkName ( ) , getOldNetworkName ( ) , getHostAddr ( ) , getCheckConnectivity ( ) , getConnectionTimeout ( ) , getVlanId ( ) , getBondName ( ) , java.util.Arrays.toString ( getNics ( ) ) , getInetAddr ( ) , getNetworkMask ( ) , getGateway ( ) , getStp ( ) , getBondingOptions ( ) , getBootProtocol ( ) , isVmNetwork ( ) , getNetwork ( ) ) ; }
Source:
private void afterMigrationFrom ( org.ovirt.engine.core.common.businessentities.VmDynamic runningVm , org.ovirt.engine.core.common.businessentities.VM vmToUpdate ) { org.ovirt.engine.core.common.businessentities.VMStatus oldVmStatus = vmToUpdate.getStatus ( ) ; if ( ( oldVmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( runningVm.getstatus ( ) . isGuestUp ( ) ) ) { _vmsToRerun.add ( runningVm.getId ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "Adding VM {0} to re-run list" , runningVm.getId ( ) ) ; vmToUpdate.setMigratingToVds ( null ) ; } }

Target:
private void afterMigrationFrom ( org.ovirt.engine.core.common.businessentities.VmDynamic runningVm , org.ovirt.engine.core.common.businessentities.VM vmToUpdate ) { org.ovirt.engine.core.common.businessentities.VMStatus oldVmStatus = vmToUpdate.getStatus ( ) ; org.ovirt.engine.core.common.businessentities.VMStatus currentVmStatus = runningVm.getstatus ( ) ; if ( ( ( oldVmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( currentVmStatus != ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) ) && ( currentVmStatus.isRunning ( ) ) ) { _vmsToRerun.add ( runningVm.getId ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "Adding VM {0} to re-run list" , runningVm.getId ( ) ) ; vmToUpdate.setMigratingToVds ( null ) ; } }
Source:
public void testAllDomainsWithinThresholdsOneLacking ( ) { domain1.getStorageDynamicData ( ) . setAvailableDiskSize ( ( ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) + 1 ) ) ; domain2.getStorageDynamicData ( ) . setAvailableDiskSize ( ( ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) - 1 ) ) ; domain1.setCriticalSpaceActionBlocker ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) ; domain2.setCriticalSpaceActionBlocker ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.allDomainsWithinThresholds ( ) ; org.junit.Assert.assertFalse ( "domain2 should not be within thresholds" , result.isValid ( ) ) ; org.junit.Assert.assertEquals ( "Wrong validation error" , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN , result.getMessage ( ) ) ; }

Target:
public void testAllDomainsWithinThresholdsOneLacking ( ) { domain1.getStorageDynamicData ( ) . setAvailableDiskSize ( ( ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) + 1 ) ) ; domain2.getStorageDynamicData ( ) . setAvailableDiskSize ( ( ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) - 1 ) ) ; domain1.setCriticalSpaceActionBlocker ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) ; domain2.setCriticalSpaceActionBlocker ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.allDomainsWithinThresholds ( ) ; org.junit.Assert.assertFalse ( "domain2 should not be within thresholds" , result.isValid ( ) ) ; org.junit.Assert.assertEquals ( "Wrong validation error" , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN , result.getMessage ( ) ) ; }
Source:
public void testIpConfiguredForStaticBootProtocolWhenIpConfigurationIsNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( null ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( attachment ) ; org.junit.Assert.assertThat ( validator.ipConfiguredForStaticBootProtocol ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworkExistWhenBothNetworkNameAndNetworkIdAreSet ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkName ( "network" ) ; networkAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( networkAttachment ) . networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private boolean validateSpaceRequirements ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = getStorageDomainValidator ( storageDomain ) ; return ( storageDomainValidator.isDomainWithinThresholds ( ) . isValid ( ) ) && ( storageDomainValidator.hasSpaceForClonedDisks ( disksList ) . isValid ( ) ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStorageDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.bll.memory.sdfilters.StorageDomainFilter storageDomainFilter : getStorageDomainFilters ( ) ) { domainsInPool = storageDomainFilter.filterStorageDomains ( domainsInPool , disksList ) ; } return domainsInPool ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RemoveVmInterface , removeVnicParameters , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { callback.vnicCreated ( vmId ) ; } } , this ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleActions ( VdcActionType.RemoveVmInterface , removeVnicParameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( isAddingNewVm ) { org.ovirt.engine.core.common.action.VmOperationParameterBase reorderParams = new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.ReorderVmNics , reorderParams , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { callback.vnicCreated ( vmId ) ; } } ) ; } else { callback.vnicCreated ( vmId ) ; } } } , this ) ; }
Source:
public static org.ovirt.engine.core.bll.ValidationResult assignFirstCpuProfile ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Guid userId ) { java.util.List < org.ovirt.engine.core.common.businessentities.profiles.CpuProfile > cpuProfilesWithPermissions = org.ovirt.engine.core.bll.profiles.CpuProfileHelper.getCpuProfileDao ( ) . getAllForCluster ( vmBase.getVdsGroupId ( ) , userId , ( userId != null ) , ActionGroup.ASSIGN_CPU_PROFILE ) ; if ( cpuProfilesWithPermissions.isEmpty ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_CPU_PROFILE_EMPTY ) ; } else { vmBase.setCpuProfileId ( cpuProfilesWithPermissions.get ( 0 ) . getId ( ) ) ; return org.ovirt.engine.core.bll.ValidationResult.VALID ; } }

Target:
public org.ovirt.engine.core.bll.ValidationResult assignFirstCpuProfile ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Guid userId ) { java.util.List < org.ovirt.engine.core.common.businessentities.profiles.CpuProfile > cpuProfilesWithPermissions = cpuProfileDao.getAllForCluster ( vmBase.getVdsGroupId ( ) , userId , ( userId != null ) , ActionGroup.ASSIGN_CPU_PROFILE ) ; if ( cpuProfilesWithPermissions.isEmpty ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_CPU_PROFILE_EMPTY ) ; } else { vmBase.setCpuProfileId ( cpuProfilesWithPermissions.get ( 0 ) . getId ( ) ) ; return org.ovirt.engine.core.bll.ValidationResult.VALID ; } }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < > ( ) ; if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , getStorageDomainId ( ) , getRequestDiskSpace ( ) ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < > ( ) ; if ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) . isInternal ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , getStorageDomainId ( ) , getRequestDiskSpace ( ) ) ) ; } return list ; }
Source:
public static org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel createInstance ( org.ovirt.engine.core.common.businessentities.VmBase vm , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > vmNicList , org.ovirt.engine.core.common.businessentities.VmNetworkInterface nic , org.ovirt.engine.ui.uicommonweb.models.EntityModel sourceModel ) { org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel instance = new org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel ( vm , clusterCompatibilityVersion , vmNicList , nic , sourceModel ) ; instance.init ( ) ; return instance ; }

Target:
public static org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel createInstance ( org.ovirt.engine.core.common.businessentities.VmBase vm , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmNicList , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic , org.ovirt.engine.ui.uicommonweb.models.EntityModel sourceModel ) { org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel instance = new org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel ( vm , clusterCompatibilityVersion , vmNicList , nic , sourceModel ) ; instance.init ( ) ; return instance ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getDbUserDAO ( ) ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setname ( "Bob" ) ; newUser.setsurname ( "Milqtoste" ) ; newUser.setusername ( "newuser" ) ; newUser.setemail ( "newuser@redhat.com" ) ; newUser.setdomain ( "domain" ) ; newUser.setgroups ( "groups" ) ; newSession = new org.ovirt.engine.core.dal.dbbroker.user_sessions ( ) ; newSession.setsession_id ( org.ovirt.engine.core.dao.DbUserDAOTest.SESSION_ID ) ; newSession.setuser_id ( existingUser.getuser_id ( ) ) ; java.util.Date now = new java.util.Date ( ) ; now.setTime ( java.lang.System.currentTimeMillis ( ) ) ; newSession.setlogin_time ( now ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getDbUserDao ( ) ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setname ( "Bob" ) ; newUser.setsurname ( "Milqtoste" ) ; newUser.setusername ( "newuser" ) ; newUser.setemail ( "newuser@redhat.com" ) ; newUser.setdomain ( "domain" ) ; newUser.setgroups ( "groups" ) ; newSession = new org.ovirt.engine.core.dal.dbbroker.user_sessions ( ) ; newSession.setsession_id ( org.ovirt.engine.core.dao.DbUserDAOTest.SESSION_ID ) ; newSession.setuser_id ( existingUser.getuser_id ( ) ) ; java.util.Date now = new java.util.Date ( ) ; now.setTime ( java.lang.System.currentTimeMillis ( ) ) ; newSession.setlogin_time ( now ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageServerConnections createNFSConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type , org.ovirt.engine.core.common.businessentities.NfsVersion version , int timeout , int retrans ) { org.ovirt.engine.core.compat.Guid id = getConnectionId ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( id , connection , type ) ; connectionDetails.setNfsVersion ( version ) ; connectionDetails.setNfsTimeo ( ( ( short ) ( timeout ) ) ) ; connectionDetails.setNfsRetrans ( ( ( short ) ( retrans ) ) ) ; return connectionDetails ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageServerConnections createNFSConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.storage.StorageType type , org.ovirt.engine.core.common.businessentities.NfsVersion version , int timeout , int retrans ) { org.ovirt.engine.core.compat.Guid id = getConnectionId ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( id , connection , type ) ; connectionDetails.setNfsVersion ( version ) ; connectionDetails.setNfsTimeo ( ( ( short ) ( timeout ) ) ) ; connectionDetails.setNfsRetrans ( ( ( short ) ( retrans ) ) ) ; return connectionDetails ; }
Source:
public void invokePlugins ( java.lang.String functionName , com.google.gwt.core.client.JsArray < ? > functionArgs ) { if ( canInvokePlugins ) { for ( org.ovirt.engine.ui.webadmin.plugin.Plugin plugin : getPlugins ( ) ) { if ( plugin.isInState ( PluginState.IN_USE ) ) { if ( ! ( invokePlugin ( plugin , functionName , functionArgs ) ) ) { org.ovirt.engine.ui.webadmin.plugin.PluginManager.logger.warning ( ( ( "Failed to invoke plugin [" + ( plugin.getMetaData ( ) . getName ( ) ) ) + "]" ) ) ; pluginFailed ( plugin ) ; } } } } }

Target:
public void enablePluginInvocation ( ) { canInvokePlugins = true ; for ( org.ovirt.engine.ui.webadmin.plugin.Plugin plugin : getPlugins ( ) ) { initPlugin ( plugin ) ; } }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getNextAvailableDiskAliasNameByVMId ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private static void addVideoDevice ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , vm.getId ( ) ) , VmDeviceType.VIDEO , vm.getDefaultDisplayType ( ) . getVmDeviceType ( ) , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getMemExpr ( vm.getNumOfMonitors ( ) ) , true , true ) ; }

Target:
private static void addVideoDevice ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , vm.getId ( ) ) , VmDeviceGeneralType.VIDEO , vm.getDefaultDisplayType ( ) . getVmDeviceType ( ) , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getMemExpr ( vm.getNumOfMonitors ( ) ) , true , true ) ; }
Source:
private org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask createTask ( org.ovirt.engine.core.compat.Guid guid , org.ovirt.engine.core.common.job.JobExecutionStatus status ) { org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask task = new org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask ( ) ; task.setTaskId ( guid ) ; task.setTaskParameters ( new org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskParameters ( ) ) ; task.getTaskParameters ( ) . setVolumeName ( "VOL" ) ; task.setMessage ( "message" ) ; task.setStatus ( status ) ; return task ; }

Target:
private org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask createTask ( org.ovirt.engine.core.compat.Guid guid , org.ovirt.engine.core.common.job.JobExecutionStatus status ) { org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask task = new org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask ( ) ; task.setTaskId ( guid ) ; task.setTaskParameters ( new org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskParameters ( ) ) ; task.getTaskParameters ( ) . setVolumeName ( "VOL" ) ; task.setMessage ( "message" ) ; task.setStatus ( status ) ; task.setType ( GlusterTaskType.REBALANCE ) ; return task ; }
Source:
protected void unlockVm ( ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) ) != null ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.VmHandler.unlockVm ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) , org.ovirt.engine.core.bll.VmCommand.getCompensationContext ( ) ) ; } } else { setLoggingForCommand ( ) ; log.warn ( "VmCommand::EndVmCommand: Vm is null - not performing endAction on Vm" ) ; } }

Target:
protected void unlockVm ( ) { org.ovirt.engine.core.bll.VmCommand.setVm ( null ) ; if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) ) != null ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.VmHandler.unlockVm ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) , org.ovirt.engine.core.bll.VmCommand.getCompensationContext ( ) ) ; } } else { setLoggingForCommand ( ) ; log.warn ( "VmCommand::EndVmCommand: Vm is null - not performing endAction on Vm" ) ; } }
Source:
private void testIsDefaultRouteWhenNetworkClusterExist ( boolean isDefaultRoute ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; networkCluster.setDefaultRoute ( isDefaultRoute ) ; org.mockito.Mockito.when ( networkClusterDao.get ( new org.ovirt.engine.core.common.businessentities.network.NetworkClusterId ( clusterId , networkId ) ) ) . thenReturn ( networkCluster ) ; org.junit.Assert.assertThat ( underTest.isDefaultRouteNetwork ( networkId , clusterId ) , org.hamcrest.CoreMatchers.is ( isDefaultRoute ) ) ; }

Target:
private void testIsDefaultRouteWhenNetworkClusterExist ( boolean isDefaultRoute ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; networkCluster.setDefaultRoute ( isDefaultRoute ) ; org.mockito.Mockito.when ( networkClusterDao.get ( new org.ovirt.engine.core.common.businessentities.network.NetworkClusterId ( clusterId , networkId ) ) ) . thenReturn ( networkCluster ) ; org.hamcrest.MatcherAssert.assertThat ( underTest.isDefaultRouteNetwork ( networkId , clusterId ) , org.hamcrest.CoreMatchers.is ( isDefaultRoute ) ) ; }
Source:
private org.ovirt.engine.ui.common.widget.editor.EntityModelLabelEditor getInstanceOfDateEditor ( ) { return new org.ovirt.engine.ui.common.widget.editor.EntityModelLabelEditor ( new org.ovirt.engine.ui.common.widget.editor.EntityModelRenderer ( ) { @ java.lang.Override public java.lang.String render ( java.lang.Object entity ) { if ( entity == null ) { return constants.unAvailablePropertyLabel ( ) ; } return org.ovirt.engine.ui.common.widget.renderer.GlusterRebalanceDateTimeRenderer.getLocalizedDateTimeFormat ( ) . format ( ( ( java.util.Date ) ( entity ) ) ) ; } } , new org.ovirt.engine.ui.common.widget.parser.EntityModelParser ( ) ) ; }

Target:
public java.util.Date parse ( java.lang.CharSequence text ) throws java.text.ParseException { return new java.util.Date ( java.util.Date.parse ( text.toString ( ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeReplaceBrickStart ( java.lang.String volumeName , java.lang.String existingBrickDir , java.lang.String newBrickDir ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.replaceBrickStart" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "existingBrick" , existingBrickDir ) . withParameter ( "newBrick" , newBrickDir ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeReplaceBrickCommitForce ( java.lang.String volumeName , java.lang.String existingBrickDir , java.lang.String newBrickDir ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.replaceBrickCommitForce" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "existingBrick" , existingBrickDir ) . withParameter ( "newBrick" , newBrickDir ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc diskReplicateFinish ( java.lang.String vmUUID , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct srcDisk , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct dstDisk ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.diskReplicateFinish ( vmUUID , srcDisk.getInnerMap ( ) , dstDisk.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc diskReplicateStart ( java.lang.String vmUUID , java.util.Map srcDisk , java.util.Map dstDisk ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.diskReplicateStart ( vmUUID , srcDisk , dstDisk ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.VM getVm ( ) { if ( getParameters ( ) . isImportAsNewEntity ( ) ) { return getParameters ( ) . getVm ( ) ; } return super . getVm ( ) ; }

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 = org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; return qRetVal.getSucceeded ( ) ? ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( qRetVal.getReturnValue ( ) ) ) : null ; }
Source:
public static void getStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
private static org.ovirt.engine.api.model.Sessions mapGuestSessions ( org.ovirt.engine.api.model.VM vm , org.ovirt.engine.api.model.Sessions sessions ) { java.lang.String guestUserName = vm.getGuestCurentUserName ( ) ; if ( ( guestUserName != null ) && ( ! ( guestUserName.isEmpty ( ) ) ) ) { org.ovirt.engine.api.model.Session guestSession = new org.ovirt.engine.api.model.Session ( ) ; org.ovirt.engine.api.model.User user = new org.ovirt.engine.api.model.User ( ) ; user.setUserName ( guestUserName ) ; guestSession.setUser ( user ) ; sessions.getSessions ( ) . add ( guestSession ) ; } return sessions ; }

Target:
private static org.ovirt.engine.api.model.Sessions mapGuestSessions ( org.ovirt.engine.api.restapi.types.VM vm , org.ovirt.engine.api.model.Sessions sessions ) { java.lang.String guestUserName = vm.getGuestCurentUserName ( ) ; if ( ( guestUserName != null ) && ( ! ( guestUserName.isEmpty ( ) ) ) ) { org.ovirt.engine.api.model.Session guestSession = new org.ovirt.engine.api.model.Session ( ) ; org.ovirt.engine.api.model.User user = new org.ovirt.engine.api.model.User ( ) ; user.setUserName ( guestUserName ) ; guestSession.setUser ( user ) ; sessions.getSessions ( ) . add ( guestSession ) ; } return sessions ; }
Source:
public void testTicket ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.SetVmTicket , org.ovirt.engine.core.common.action.SetVmTicketParameters.class , new java.lang.String [ ] { "VmId" , "Ticket" } , new java.lang.Object [ ] { GUIDS [ 0 ] , NAMES [ 1 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setTicket ( new org.ovirt.engine.api.model.Ticket ( ) ) ; action.getTicket ( ) . setValue ( NAMES [ 1 ] ) ; verifyActionResponse ( resource.ticket ( action ) ) ; }

Target:
public void testTicket ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.SetVmTicket , org.ovirt.engine.core.common.action.SetVmTicketParameters.class , new java.lang.String [ ] { "VmId" , "Ticket" } , new java.lang.Object [ ] { GUIDS [ 0 ] , NAMES [ 1 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setTicket ( new org.ovirt.engine.api.model.Ticket ( ) ) ; action.getTicket ( ) . setValue ( NAMES [ 1 ] ) ; verifyActionResponse ( resource.ticket ( action ) ) ; }
Source:
public void endSuccessfully ( ) { super . endSuccessfully ( ) ; if ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getImportAsTemplate ( ) ) { org.ovirt.engine.core.compat.Guid newTemplateId = createTemplate ( ) ; if ( newTemplateId != null ) { attachDiskToTemplate ( newTemplateId ) ; } } updateDiskStatus ( ImageStatus.OK ) ; org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.setSucceeded ( true ) ; }

Target:
public void endSuccessfully ( ) { super . endSuccessfully ( ) ; setQcowCompatForQcowImage ( ) ; if ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getImportAsTemplate ( ) ) { org.ovirt.engine.core.compat.Guid newTemplateId = createTemplate ( ) ; if ( newTemplateId != null ) { attachDiskToTemplate ( newTemplateId ) ; } } updateDiskStatus ( ImageStatus.OK ) ; org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.setSucceeded ( true ) ; }
Source:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworks ( ) { org.ovirt.engine.core.compat.Guid dataCenterId = getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , VdcQueryType.GetClusterById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( clusterId ) ) , null ) . getStoragePoolId ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ; return getBackendCollection ( VdcQueryType.GetAllNetworks , params ) ; }

Target:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworks ( ) { org.ovirt.engine.core.compat.Guid dataCenterId = getCluster ( ) . getStoragePoolId ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ; return getBackendCollection ( VdcQueryType.GetAllNetworks , params ) ; }
Source:
private void validateDataSize ( ) { if ( ( dataUrl.length ( ) ) > ( org.ovirt.engine.core.bll.validator.IconValidator.MAX_DATAURL_SIZE ) ) { validationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.DATA_SIZE_OF_PROVIDED_VM_ICON_TOO_LARGE , ( "$maxSize " + ( org.ovirt.engine.core.bll.validator.IconValidator.getSizeEstimateByDataUrlLength ( org.ovirt.engine.core.bll.validator.IconValidator.MAX_DATAURL_SIZE ) ) ) , ( "$currentSize " + ( org.ovirt.engine.core.bll.validator.IconValidator.getSizeEstimateByDataUrlLength ( dataUrl.length ( ) ) ) ) ) ; } }

Target:
private void validateDataSize ( ) { if ( ( dataUrl.length ( ) ) > ( org.ovirt.engine.core.bll.validator.IconValidator.MAX_DATAURL_SIZE ) ) { validationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.DATA_SIZE_OF_PROVIDED_VM_ICON_TOO_LARGE , ( "$maxSize " + ( org.ovirt.engine.core.bll.validator.IconValidator.getSizeEstimateByDataUrlLength ( org.ovirt.engine.core.bll.validator.IconValidator.MAX_DATAURL_SIZE ) ) ) , ( "$currentSize " + ( org.ovirt.engine.core.bll.validator.IconValidator.getSizeEstimateByDataUrlLength ( dataUrl.length ( ) ) ) ) ) ; } }
Source:
protected void OnEntityChanged ( ) { if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VM ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ( this ) ; } else if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.vm_pools ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior ( this ) ; } else { throw new java.lang.UnsupportedOperationException ( ) ; } behavior.OnEntityChanged ( ) ; }

Target:
protected void OnEntityChanged ( ) { if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VM ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ( this ) ; } else if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior ( this ) ; } else { throw new java.lang.UnsupportedOperationException ( ) ; } behavior.OnEntityChanged ( ) ; }
Source:
public static void getTemplateListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static 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 < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public java.security.cert.X509Certificate [ ] getAcceptedIssuers ( ) { return new java.security.cert.X509Certificate [ ] { } ; }

Target:
protected java.net.HttpURLConnection create ( java.net.URL url ) throws java.io.IOException , java.security.GeneralSecurityException { return new org.ovirt.engine.core.uutils.net.HttpURLConnectionBuilder ( url ) . setHttpsProtocol ( httpsProtocol ) . setReadTimeout ( readTimeout ) . setTrustManagerAlgorithm ( trustManagerAlgorithm ) . setTrustStore ( trustStore ) . setTrustStorePassword ( trustStorePassword ) . setTrustStoreType ( trustStoreType ) . setURL ( url ) . setVerifyChain ( verifyChain ) . setVerifyHost ( verifyHost ) . create ( ) ; }