auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
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.GetAllDisksByVmIdParameters ( vmId ) , aQuery ) ; }

Target:
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.GetVmConfigurationBySnapshotQueryParams ( snapshotSourceId ) , aQuery ) ; }
Source:
private void auditFenceAction ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent , org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { org.ovirt.engine.core.bll.FenceExecutor.log.info ( "Executing <{}> Power Management command: Proxy Host:{}, Target Host:{}, Agent:{}, Fencing policy:{}" , action , getNameOrId ( proxyHost ) , getNameOrId ( _vds ) , agent , fencingPolicy ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = getAuditParams ( action , agent , proxyHost ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.FENCE_USING_AGENT_AND_PROXY_HOST ) ; }

Target:
private void auditFenceAction ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent , org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { org.ovirt.engine.core.bll.FenceExecutor.log.info ( "Executing <{}> Power Management command: Proxy Host:{}, Target Host:{}, Agent:{}, Fencing policy:{}" , action , getNameOrId ( proxyHost ) , getNameOrId ( _vds ) , agent , fencingPolicy ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = getAuditParams ( action , agent , proxyHost ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , AuditLogType.FENCE_USING_AGENT_AND_PROXY_HOST ) ; }
Source:
public void testCheckForIndex_BadParams ( ) throws java.io.IOException { org.junit.Assert.assertNull ( "no index file" , testServlet.checkForIndex ( mockRequest , mockResponse , null , null ) ) ; org.junit.Assert.assertNull ( "no index file" , testServlet.checkForIndex ( mockRequest , mockResponse , file.getParentFile ( ) , null ) ) ; }

Target:
public void testCheckForIndex_BadParams ( ) throws java.io.IOException { org.junit.jupiter.api.Assertions.assertNull ( testServlet.checkForIndex ( mockRequest , mockResponse , null , null ) , "no index file" ) ; org.junit.jupiter.api.Assertions.assertNull ( testServlet.checkForIndex ( mockRequest , mockResponse , file.getParentFile ( ) , null ) , "no index file" ) ; }
Source:
private boolean validateNetworkProviderConfiguration ( ) { return ( ( ! ( org.ovirt.engine.core.bll.hostdeploy.UpdateVdsCommand.getParameters ( ) . isInstallHost ( ) ) ) || ( ( org.ovirt.engine.core.bll.hostdeploy.UpdateVdsCommand.getParameters ( ) . getNetworkProviderId ( ) ) == null ) ) || ( validateNetworkProviderProperties ( org.ovirt.engine.core.bll.hostdeploy.UpdateVdsCommand.getParameters ( ) . getNetworkProviderId ( ) , org.ovirt.engine.core.bll.hostdeploy.UpdateVdsCommand.getParameters ( ) . getNetworkMappings ( ) ) ) ; }

Target:
private boolean validateNetworkProviderConfiguration ( ) { return ( ( ! ( org.ovirt.engine.core.bll.hostdeploy.UpdateVdsCommand.getParameters ( ) . isInstallHost ( ) ) ) || ( ( org.ovirt.engine.core.bll.hostdeploy.UpdateVdsCommand.getParameters ( ) . getVdsStaticData ( ) . getOpenstackNetworkProviderId ( ) ) == null ) ) || ( validateNetworkProviderProperties ( org.ovirt.engine.core.bll.hostdeploy.UpdateVdsCommand.getParameters ( ) . getVdsStaticData ( ) . getOpenstackNetworkProviderId ( ) , org.ovirt.engine.core.bll.hostdeploy.UpdateVdsCommand.getParameters ( ) . getNetworkMappings ( ) ) ) ; }
Source:
private static void logVmStatusTransition ( org.ovirt.engine.core.common.businessentities.VM vmToUpdate , org.ovirt.engine.core.common.businessentities.VmDynamic runningVm ) { if ( ( vmToUpdate.getStatus ( ) ) != ( runningVm.getStatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "VM {0} {1} moved from {2} --> {3}" , vmToUpdate.getName ( ) , vmToUpdate.getId ( ) , vmToUpdate.getStatus ( ) . name ( ) , runningVm.getStatus ( ) . name ( ) ) ; } }

Target:
private static void logVmStatusTransition ( org.ovirt.engine.core.common.businessentities.VM vmToUpdate , org.ovirt.engine.core.common.businessentities.VmDynamic runningVm ) { if ( ( vmToUpdate.getStatus ( ) ) != ( runningVm.getStatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "VM {0} {1} moved from {2} --> {3}" , vmToUpdate.getName ( ) , vmToUpdate.getId ( ) , vmToUpdate.getStatus ( ) . name ( ) , runningVm.getStatus ( ) . name ( ) ) ; if ( ( vmToUpdate.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.logVmStatusTransionFromUnknown ( vmToUpdate , runningVm ) ; } } }
Source:
private void vdsExist ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }

Target:
private void vdsExist ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult hotUpdatePossible ( ) { if ( ( getRequiredAction ( ) ) == ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ) ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.networkLinking ( version ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOT_VM_INTERFACE_UPDATE_IS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.clusterVersion ( ) ) ; } else if ( getVnicProfile ( ) . isPortMirroring ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.CANNOT_PERFORM_HOT_UPDATE_WITH_PORT_MIRRORING ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult hotUpdatePossible ( ) { if ( ( getRequiredAction ( ) ) == ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ) ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.networkLinking ( version ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOT_VM_INTERFACE_UPDATE_IS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.clusterVersion ( ) ) ; } else if ( ( portMirroringEnabled ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.getInterface ( ) . getVnicProfileId ( ) ) ) || ( portMirroringEnabled ( oldIface.getVnicProfileId ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.CANNOT_PERFORM_HOT_UPDATE_WITH_PORT_MIRRORING ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
private static boolean isEnoughFreeSpace ( final org.ovirt.engine.core.common.businessentities.storage_domains domain ) { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic dynamic = domain.getStorageDynamicData ( ) ; return ( ( dynamic != null ) && ( ( dynamic.getfreeDiskInGB ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.FreeSpaceCriticalLowInGB ) ) ) ) && ( ( dynamic.getfreeDiskPercent ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.FreeSpaceLow ) ) ) ; }

Target:
public static boolean isWithinThresholds ( final org.ovirt.engine.core.common.businessentities.storage_domains domain ) { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic dynamic = domain.getStorageDynamicData ( ) ; return ( dynamic != null ) && ( ( dynamic.getfreeDiskInGB ( ) ) > ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.getLowDiskSpaceThreshold ( ) ) ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IAutoCompleter retval ; if ( ( ( ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "CREATIONDATE" ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "SIZE" ) ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "ACTUAL_SIZE" ) ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "PROVISIONED_SIZE" ) ) ) { retval = BiggerOrSmallerRelationAutoCompleter.INTSANCE ; } else { retval = StringConditionRelationAutoCompleter.INSTANCE ; } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IAutoCompleter retval ; if ( ( ( ( ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "CREATIONDATE" ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "SIZE" ) ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "NUMBER_OF_VMS" ) ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "ACTUAL_SIZE" ) ) ) || ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "PROVISIONED_SIZE" ) ) ) { retval = BiggerOrSmallerRelationAutoCompleter.INTSANCE ; } else { retval = StringConditionRelationAutoCompleter.INSTANCE ; } return retval ; }
Source:
public void qosCommitmentMissingNicSpeed ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosCommitmentNicSetup ( ( ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) / 2 ) , null ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_INVALID_INTERFACE_SPEED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME ) ; }

Target:
public void customPropertiesBadInput ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; java.util.Map < java.lang.String , java.lang.String > customProperties = new java.util.HashMap < > ( ) ; customProperties.put ( "foo" , "b@r" ) ; iface.setCustomProperties ( customProperties ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_BAD_INPUT , network.getName ( ) ) ; }
Source:
private static void testFingerprintString ( final java.lang.String keyEncoding , final java.lang.String goodFingerprintString ) throws java.lang.Exception { final java.security.PublicKey key = org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.decodeKey ( keyEncoding ) ; final java.lang.String fingerprintString = org.ovirt.engine.core.uutils.ssh.OpenSSHUtils.getKeyFingerprintString ( key ) ; org.junit.Assert.assertEquals ( goodFingerprintString , fingerprintString ) ; }

Target:
private static void testFingerprintString ( final java.lang.String keyEncoding , final java.lang.String goodFingerprintString , java.lang.String algo ) throws java.lang.Exception { final java.security.PublicKey key = org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.decodeKey ( keyEncoding ) ; final java.lang.String fingerprintString = org.ovirt.engine.core.uutils.ssh.OpenSSHUtils.getKeyFingerprint ( key , algo ) ; org.junit.Assert.assertEquals ( goodFingerprintString , fingerprintString ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected void loadTemplateData ( org.ovirt.engine.core.common.businessentities.VmTemplate template ) { if ( ( ( template.getInterfaces ( ) ) == null ) || ( template.getInterfaces ( ) . isEmpty ( ) ) ) { template.setInterfaces ( getVmNetworkInterfaceDao ( ) . getAllForTemplate ( template.getId ( ) ) ) ; } }

Target:
protected void loadTemplateData ( org.ovirt.engine.core.common.businessentities.VmTemplate template ) { setManagedVideoDevices ( template ) ; if ( ( ( template.getInterfaces ( ) ) == null ) || ( template.getInterfaces ( ) . isEmpty ( ) ) ) { template.setInterfaces ( getVmNetworkInterfaceDao ( ) . getAllForTemplate ( template.getId ( ) ) ) ; } }
Source:
public static void IsBackendAvailable ( 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 ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( true ) ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getVmGuestAgentInterfacesByVmId ( 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private static java.lang.Object instantiate ( java.lang.Class < ? > clz ) { java.lang.Object model = null ; try { model = clz.newInstance ( ) ; } catch ( java.lang.Exception e ) { } return model ; }

Target:
private static void populateBigDecimal ( java.lang.reflect.Method method , java.lang.Object model ) { try { method.invoke ( model , new java.math.BigDecimal ( org.ovirt.engine.api.restapi.types.MappingTestHelper.rand ( 100 ) ) ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.api.restapi.types.MappingTestHelper.logger.error ( ( ( ( "Failed to populate big decimal in " + ( method.getDeclaringClass ( ) ) ) + "." ) + ( method.getName ( ) ) ) , e ) ; } }
Source:
protected void detachStorageDomainWithEntities ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsForStorageDomain = getVMsForStorageDomain ( storageDomain.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > vmTemplatesForStorageDomain = getTemplatesForStorageDomain ( storageDomain.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksForStorageDomain = getDiskImageDao ( ) . getAllForStorageDomain ( storageDomain.getId ( ) ) ; removeEntitiesFromStorageDomain ( vmsForStorageDomain , vmTemplatesForStorageDomain , disksForStorageDomain , storageDomain.getId ( ) ) ; }

Target:
protected void detachStorageDomainWithEntities ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsForStorageDomain = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getVmDAO ( ) . getAllForStorageDomain ( storageDomain.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > vmTemplatesForStorageDomain = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getVmTemplateDAO ( ) . getAllForStorageDomain ( storageDomain.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksForStorageDomain = getDiskImageDao ( ) . getAllForStorageDomain ( storageDomain.getId ( ) ) ; removeEntitiesFromStorageDomain ( vmsForStorageDomain , vmTemplatesForStorageDomain , disksForStorageDomain , storageDomain.getId ( ) ) ; }
Source:
public static void GetGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public static void GetClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , "" , "" , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
protected void sendWarningForNonExportableDisks ( org.ovirt.engine.core.common.businessentities.VM entity ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmDiskList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getWindow ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( target ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > vmDisks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( model , vmDisks , VmModelHelper.WarningType.VM_EXPORT ) ; } } ) , entity.getId ( ) ) ; }

Target:
protected void sendWarningForNonExportableDisks ( org.ovirt.engine.core.common.businessentities.VM entity ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmDiskList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( target ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( model , vmDisks , VmModelHelper.WarningType.VM_EXPORT ) ; } } ) , entity.getId ( ) ) ; }
Source:
private void AfterSuspendTreatment ( org.ovirt.engine.core.common.businessentities.VmDynamic vm ) { org.ovirt.engine.core.common.AuditLogType type = ( ( vm.getExitStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmExitStatus.Normal ) ) ? org.ovirt.engine.core.common.AuditLogType.USER_SUSPEND_VM_OK : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_SUSPEND_VM ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( _vds.getId ( ) , vm.getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , type ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . RemoveAsyncRunningVm ( vm.getId ( ) ) ; }

Target:
private void AfterSuspendTreatment ( org.ovirt.engine.core.common.businessentities.VmDynamic vm ) { org.ovirt.engine.core.common.AuditLogType type = ( ( vm.getExitStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmExitStatus.Normal ) ) ? org.ovirt.engine.core.common.AuditLogType.USER_SUSPEND_VM_OK : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_SUSPEND_VM ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( _vds.getId ( ) , vm.getId ( ) ) ; auditLog ( logable , type ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . RemoveAsyncRunningVm ( vm.getId ( ) ) ; }
Source:
public static org.ovirt.engine.core.compat.Version getEffective ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , java.util.function.Supplier < org.ovirt.engine.core.common.businessentities.VDSGroup > vdsGroupSupplier ) { if ( ( vmBase != null ) && ( ( vmBase.getCustomCompatibilityVersion ( ) ) != null ) ) { return vmBase.getCustomCompatibilityVersion ( ) ; } else { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = vdsGroupSupplier.get ( ) ; return vdsGroup != null ? vdsGroup.getCompatibilityVersion ( ) : null ; } }

Target:
public static org.ovirt.engine.core.compat.Version getEffective ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , java.util.function.Supplier < org.ovirt.engine.core.common.businessentities.Cluster > clusterSupplier ) { if ( ( vmBase != null ) && ( ( vmBase.getCustomCompatibilityVersion ( ) ) != null ) ) { return vmBase.getCustomCompatibilityVersion ( ) ; } else { org.ovirt.engine.core.common.businessentities.Cluster cluster = clusterSupplier.get ( ) ; return cluster != null ? cluster.getCompatibilityVersion ( ) : null ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult isVmReadyForUpgrade ( final org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Objects.requireNonNull ( vm ) ; java.util.List < org.ovirt.engine.core.bll.validator.InClusterUpgradeValidator.UpgradeError > validationResult = checkVmReadyForUpgrade ( vm ) ; if ( validationResult.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.BOUND_TO_HOST_WHILE_UPGRADING_CLUSTER , java.lang.String.format ( "$json %1$s" , org.ovirt.engine.core.bll.validator.InClusterUpgradeValidator.VmValidation.toJson ( validationResult ) ) ) ; } }

Target:
public org.ovirt.engine.core.bll.ValidationResult isVmReadyForUpgrade ( final org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Objects.requireNonNull ( vm ) ; java.util.List < java.lang.String > vmErrors = checkVmReadyForUpgrade ( vm ) ; if ( vmErrors.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.BOUND_TO_HOST_WHILE_UPGRADING_CLUSTER , vmErrors ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disk.setDiskAlias ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; disk.setActive ( true ) ; disk.setImageStatus ( ImageStatus.OK ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageDomainIds = new java.util.ArrayList < > ( ) ; storageDomainIds.add ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disk.setStorageIds ( storageDomainIds ) ; return disk ; }

Target:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disk.setDiskAlias ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; disk.setActive ( true ) ; disk.setImageStatus ( ImageStatus.OK ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageDomainIds = new java.util.ArrayList < > ( ) ; storageDomainIds.add ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disk.setStorageIds ( storageDomainIds ) ; return disk ; }
Source:
public void testAddGroupFailure ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ( ( "ADGROUP@" + ( DOMAIN ) ) + ": name=*" ) , SearchType.AdGroup , getAdGroup ( 0 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Group model = new org.ovirt.engine.api.model.Group ( ) ; model.setName ( BAD_NAMES [ 0 ] ) ; try { javax.ws.rs.core.Response response = collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testAddGroupWithoutDirectoryName ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Group model = new org.ovirt.engine.api.model.Group ( ) ; model.setName ( NAMES [ 0 ] ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > setUpLuns ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > luns = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { luns.add ( getEntity ( i ) ) ; } return luns ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > setUpLuns ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { luns.add ( getEntity ( i ) ) ; } return luns ; }
Source:
protected boolean validateSuffix ( java.lang.String suffix , org.ovirt.engine.ui.uicommonweb.models.EntityModel entityModel ) { for ( java.lang.Object object : objectsInSetupMap.values ( ) ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( object ) ) ; if ( ! ( validateName ( ( ( template.getname ( ) ) + suffix ) , template , entityModel ) ) ) { return false ; } } return true ; }

Target:
protected boolean validateSuffix ( java.lang.String suffix , org.ovirt.engine.ui.uicommonweb.models.EntityModel entityModel ) { for ( java.lang.Object object : objectsToClone ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( object ) ) . getTemplate ( ) ; if ( ! ( validateName ( ( ( template.getName ( ) ) + suffix ) , template , entityModel ) ) ) { return false ; } } return true ; }
Source:
public boolean getIsAvailable ( ) { return ( ( getDetailModel ( ) . getIsPosix ( ) ) && ( ( getDetailModel ( ) . getVfsType ( ) ) != null ) ) && ( ! ( getDetailModel ( ) . getVfsType ( ) . isEmpty ( ) ) ) ; }

Target:
public boolean getIsAvailable ( ) { return ( ( ( getDetailModel ( ) . getIsPosix ( ) ) || ( getDetailModel ( ) . getIsGlusterfs ( ) ) ) && ( ( getDetailModel ( ) . getVfsType ( ) ) != null ) ) && ( ! ( getDetailModel ( ) . getVfsType ( ) . isEmpty ( ) ) ) ; }
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.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getStorageDomainId ( org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.common.businessentities.StorageDomainType type , org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { org.ovirt.engine.core.compat.Guid returnValue = org.ovirt.engine.core.compat.Guid.Empty ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = getStorageDomains ( poolId , type , status ) ; if ( ! ( domains.isEmpty ( ) ) ) { returnValue = domains.get ( 0 ) . getId ( ) ; } return returnValue ; }

Target:
private org.ovirt.engine.core.compat.Guid getStorageDomainId ( org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.common.businessentities.StorageDomainType type , org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { return getStorageDomains ( poolId , type , status ) . stream ( ) . findFirst ( ) . map ( StorageDomain :: getId ) . orElse ( Guid.Empty ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > getCinderDisksToBeRemoved ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > imageDisks = org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllVmCinderDisksCommand.getParameters ( ) . cinderDisks ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = new java.util.ArrayList < > ( ) ; if ( imageDisks == null ) { cinderDisks = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterDisksBasedOnCinder ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllVmCinderDisksCommand.getVmId ( ) ) ) ; } else { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : imageDisks ) { cinderDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( diskImage ) ) ) ; } } return cinderDisks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > getCinderDisksToBeRemoved ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > imageDisks = org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllVmCinderDisksCommand.getParameters ( ) . cinderDisks ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = new java.util.ArrayList < > ( ) ; if ( imageDisks == null ) { cinderDisks = org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.filterCinderDisks ( diskDao.getAllForVm ( org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllVmCinderDisksCommand.getVmId ( ) ) ) ; } else { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : imageDisks ) { cinderDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( diskImage ) ) ) ; } } return cinderDisks ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { NON_EXISTANT_GUID } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testAddSetAndUploadIconFailure ( ) throws java.lang.Exception { control.replay ( ) ; final org.ovirt.engine.api.model.VM model = createModel ( null ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }
Source:
public org.ovirt.engine.sdk.decorators.HostNIC add ( org.ovirt.engine.sdk.decorators.HostNIC hostnic ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , hostnic , org.ovirt.engine.sdk.entities.HostNIC.class , org.ovirt.engine.sdk.decorators.HostNIC.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.HostNIC add ( org.ovirt.engine.sdk.decorators.HostNIC hostnic ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , hostnic , org.ovirt.engine.sdk.entities.HostNIC.class , org.ovirt.engine.sdk.decorators.HostNIC.class , headers ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 3 ) ; setGetVmQueryExpectations ( 2 ) ; setGetNetworksQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getNic ( false ) ) ; assertNotNull ( nic ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 3 ) ; setGetVmQueryExpectations ( 2 ) ; setGetNetworksQueryExpectations ( 2 ) ; setGetGuestAgentQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getNic ( false ) ) ; assertNotNull ( nic ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > setUpVgs ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > vgs = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { vgs.add ( getVgEntity ( i ) ) ; } return vgs ; }

Target:
private java.util.List < org.ovirt.engine.api.restapi.resource.StorageDomain > setUpVgs ( ) { java.util.List < org.ovirt.engine.api.restapi.resource.StorageDomain > vgs = new java.util.ArrayList < org.ovirt.engine.api.restapi.resource.StorageDomain > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { vgs.add ( getVgEntity ( i ) ) ; } return vgs ; }
Source:
public static void getVmById ( 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.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected javax.ws.rs.core.Response performRemove ( java.lang.String id ) { return performAction ( VdcActionType.RemoveClusterPolicy , new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( asGuid ( id ) , null ) ) ; }

Target:
protected javax.ws.rs.core.Response performRemove ( java.lang.String id ) { javax.ws.rs.core.Response performAction = null ; try { performAction = performAction ( VdcActionType.RemoveClusterPolicy , new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( asGuid ( id ) , queryIdResolver.lookupEntity ( asGuid ( id ) ) ) ) ; } catch ( org.ovirt.engine.api.restapi.resource.BackendFailureException e ) { e.printStackTrace ( ) ; } return performAction ; }
Source:
public org.ovirt.engine.sdk.entities.Action cancelmigration ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/cancelmigration" ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class ) ; }

Target:
public org.ovirt.engine.sdk.entities.Action ticket ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/ticket" ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( getVmPool ( ) ) ; setPoolBeingDestroyed ( ) ; setPrestartedToZero ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; org.ovirt.engine.core.bll.RemoveVmPoolCommand.setSucceeded ( ( ( ( stopVms ( ) ) && ( removeVmsInPool ( ) ) ) && ( removeVmPool ( ) ) ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( getVmPool ( ) ) ; setPoolBeingDestroyed ( ) ; setPrestartedToZero ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; org.ovirt.engine.core.bll.RemoveVmPoolCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.RemoveVmPoolCommand.log ( ) ; stopVms ( ) ; if ( allVmsDown ) { endSuccessfully ( ) ; } else { org.ovirt.engine.core.bll.RemoveVmPoolCommand.setSucceeded ( true ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.storage_domain_dynamic mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.storage_domain_dynamic entity = new org.ovirt.engine.core.common.businessentities.storage_domain_dynamic ( ) ; entity.setavailable_disk_size ( ( ( java.lang.Integer ) ( rs.getObject ( "available_disk_size" ) ) ) ) ; entity.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "id" ) ) ) ; entity.setused_disk_size ( ( ( java.lang.Integer ) ( rs.getObject ( "used_disk_size" ) ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.StorageDomainDynamic mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic entity = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; entity.setavailable_disk_size ( ( ( java.lang.Integer ) ( rs.getObject ( "available_disk_size" ) ) ) ) ; entity.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "id" ) ) ) ; entity.setused_disk_size ( ( ( java.lang.Integer ) ( rs.getObject ( "used_disk_size" ) ) ) ) ; return entity ; }