auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( nicName , nicId , nicName , message , existingInterfacesMap ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.action.CreateOrUpdateBond createOrUpdateBond ) { org.ovirt.engine.core.compat.Guid nicId = createOrUpdateBond.getId ( ) ; java.lang.String nicName = createOrUpdateBond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( nicName , nicId , nicName , message , existingInterfacesMap ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.NetworkFilterParameter model = new org.ovirt.engine.api.model.NetworkFilterParameter ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "NetworkFilterParameter" , "add" , "value" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.NetworkFilterParameter model = new org.ovirt.engine.api.model.NetworkFilterParameter ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "NetworkFilterParameter" , "add" , "value" ) ; } }
Source:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "vmId" , getVmId ( ) ) . append ( "op" , getOp ( ) ) . append ( "postZero" , getPostZero ( ) ) . append ( "force" , getForce ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "vmId" , getVmId ( ) ) . append ( "op" , getOp ( ) ) . append ( "postZero" , getPostZero ( ) ) . append ( "discard" , isDiscard ( ) ) . append ( "force" , getForce ( ) ) ; }
Source:
private void initializeOsRepository ( int osId , org.ovirt.engine.core.common.businessentities.DiskInterface diskInterface ) { java.util.ArrayList < java.lang.String > supportedDiskInterfaces = new java.util.ArrayList < > ( ) ; supportedDiskInterfaces.add ( diskInterface.name ( ) ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( 1 , null ) ) . thenReturn ( supportedDiskInterfaces ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( 2 , null ) ) . thenReturn ( new java.util.ArrayList < java.lang.String > ( ) ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }

Target:
private void initializeOsRepository ( int osId , org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface ) { java.util.ArrayList < java.lang.String > supportedDiskInterfaces = new java.util.ArrayList < > ( ) ; supportedDiskInterfaces.add ( diskInterface.name ( ) ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( 1 , null ) ) . thenReturn ( supportedDiskInterfaces ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( 2 , null ) ) . thenReturn ( new java.util.ArrayList < java.lang.String > ( ) ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }
Source:
private void assertHostsListMatch ( java.util.List < org.ovirt.engine.api.model.Host > modelHostsList , java.util.List < org.ovirt.engine.api.model.Host > trnsfHostsList ) { for ( org.ovirt.engine.api.model.Host host : modelHostsList ) { boolean foundInTransformation = false ; for ( org.ovirt.engine.api.model.Host otherHost : trnsfHostsList ) { if ( host.getId ( ) . equals ( otherHost.getId ( ) ) ) { foundInTransformation = true ; break ; } } org.junit.Assert.assertTrue ( "Umatching dedicated host in Placement Policy" , foundInTransformation ) ; } }

Target:
private void assertHostsListMatch ( java.util.List < org.ovirt.engine.api.model.Host > modelHostsList , java.util.List < org.ovirt.engine.api.model.Host > trnsfHostsList ) { for ( org.ovirt.engine.api.model.Host host : modelHostsList ) { boolean foundInTransformation = false ; for ( org.ovirt.engine.api.model.Host otherHost : trnsfHostsList ) { if ( host.getId ( ) . equals ( otherHost.getId ( ) ) ) { foundInTransformation = true ; break ; } } org.junit.jupiter.api.Assertions.assertTrue ( foundInTransformation , "Umatching dedicated host in Placement Policy" ) ; } }
Source:
public void hostDoesNotExist ( ) { org.mockito.Mockito.when ( vdsStaticDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertFalse ( getQuery ( ) . getQueryReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertNull ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; org.junit.Assert.assertEquals ( VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST.name ( ) , getQuery ( ) . getQueryReturnValue ( ) . getExceptionString ( ) ) ; }

Target:
public void hostDoesNotExist ( ) { org.mockito.Mockito.when ( vdsStaticDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertFalse ( getQuery ( ) . getQueryReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertNull ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; org.junit.Assert.assertEquals ( EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST.name ( ) , getQuery ( ) . getQueryReturnValue ( ) . getExceptionString ( ) ) ; }
Source:
private boolean vmDeviceChanged ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType deviceType , java.lang.String device , boolean deviceEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.UpdateVmCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmId ( ) , deviceType , device ) ; return deviceEnabled == ( vmDevices.isEmpty ( ) ) ; }

Target:
private boolean isRunningConfigurationNeeded ( ) { return ( ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . isNextRunConfigurationExists ( ) ) || ( ! ( org.ovirt.engine.core.bll.VmHandler.isUpdateValid ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . getStatus ( ) ) ) ) ) || ( ! ( org.ovirt.engine.core.bll.VmHandler.isUpdateValidForVmDevices ( getVmId ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VdsStatistics getNonExistentEntity ( ) { return newStatistics ; }

Target:
public void testSave ( ) { staticDao.save ( newStaticVds ) ; newStatistics.setId ( newStaticVds.getId ( ) ) ; dao.save ( newStatistics ) ; org.ovirt.engine.core.common.businessentities.VdsStatic staticResult = staticDao.get ( newStaticVds.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VdsStatistics statisticsResult = dao.get ( newStatistics.getId ( ) ) ; org.junit.Assert.assertNotNull ( staticResult ) ; org.junit.Assert.assertEquals ( newStaticVds , staticResult ) ; org.junit.Assert.assertNotNull ( statisticsResult ) ; org.junit.Assert.assertEquals ( newStatistics , statisticsResult ) ; }
Source:
public void updateNetworkDevice ( ) { org.ovirt.engine.core.common.businessentities.HostDevice before = getNetworkDevice ( ) ; before.setNetworkInterfaceName ( ( ( before.getNetworkInterfaceName ( ) ) + "new" ) ) ; before.setDriver ( "updated driver" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.HostDevice after = dao.get ( before.getId ( ) ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void updateNetworkDevice ( ) { org.ovirt.engine.core.common.businessentities.HostDevice before = getNetworkDevice ( ) ; before.setNetworkInterfaceName ( ( ( before.getNetworkInterfaceName ( ) ) + "new" ) ) ; before.setDriver ( "updated driver" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.HostDevice after = dao.get ( before.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( after ) ; org.junit.jupiter.api.Assertions.assertEquals ( before , after ) ; }
Source:
public static void getDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.TimeZoneType timeZoneType ) { 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 "" ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setTimeZoneType ( timeZoneType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDefaultTimeZone , params , aQuery ) ; }

Target:
public void getAAANamespaces ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForDisplayNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( getNetworkCluster ( ) . isDisplay ( ) ) && ( ( ipConfiguration == null ) || ( ( ipConfiguration.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL ) . when ( failWhen ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForDisplayNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( getNetworkCluster ( ) . isDisplay ( ) ) && ( ( ( ipConfiguration == null ) || ( ! ( ipConfiguration.hasPrimaryAddressSet ( ) ) ) ) || ( ( ipConfiguration.getPrimaryAddress ( ) . getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL ) . when ( failWhen ) ; }
Source:
public void cleanHostParametersFields ( ) { getName ( ) . setEntity ( "" ) ; getComment ( ) . setEntity ( "" ) ; getAuthSshPort ( ) . setEntity ( java.lang.Integer.parseInt ( constants.defaultHostSSHPort ( ) ) ) ; getHost ( ) . setEntity ( "" ) ; getUserPassword ( ) . setEntity ( "" ) ; getFetchSshFingerprint ( ) . setEntity ( "" ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends T > ev , java.lang.Object sender , T args ) { if ( ( enabled ) && ( ( delegate ) != null ) ) { delegate.eventRaised ( ev , sender , args ) ; } }
Source:
private void addResource ( final org.ovirt.engine.api.restapi.resource.BackendResource resource ) { resource.setMessageBundle ( messageBundle ) ; resource.setBackend ( backend ) ; resource.setSessionHelper ( sessionHelper ) ; if ( resource instanceof org.ovirt.engine.api.restapi.resource.AbstractBackendResource ) { ( ( org.ovirt.engine.api.restapi.resource.AbstractBackendResource ) ( resource ) ) . setMappingLocator ( mappingLocator ) ; } else if ( resource instanceof org.ovirt.engine.api.resource.CapabilitiesResource ) { ( ( org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource ) ( resource ) ) . setMappingLocator ( mappingLocator ) ; } singletons.add ( resource ) ; }

Target:
private void addResource ( final org.ovirt.engine.api.restapi.resource.BackendResource resource ) { resource.setMessageBundle ( messageBundle ) ; resource.setBackend ( backend ) ; resource.setSessionHelper ( sessionHelper ) ; if ( resource instanceof org.ovirt.engine.api.restapi.resource.AbstractBackendResource ) { ( ( org.ovirt.engine.api.restapi.resource.AbstractBackendResource ) ( resource ) ) . setMappingLocator ( mappingLocator ) ; } else if ( resource instanceof org.ovirt.engine.api.resource.CapabilitiesResource ) { ( ( org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource ) ( resource ) ) . setMappingLocator ( mappingLocator ) ; } resource.setValidatorLocator ( validatorLocator ) ; singletons.add ( resource ) ; }
Source:
public void qosValidCommitmentReportedNicSpeed ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosCommitmentNicSetup ( ( ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) / 2 ) , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
public void template_SelectedItemChanged ( ) { getModel ( ) . setIsDisksAvailable ( true ) ; updateHostPinning ( pool.getMigrationSupport ( ) ) ; }

Target:
public void initialize ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel systemTreeSelectedItem ) { initTemplate ( ) ; super . initialize ( systemTreeSelectedItem ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( pool.getVmPoolSpiceProxy ( ) ) ) ) { getModel ( ) . getSpiceProxyEnabled ( ) . setEntity ( true ) ; getModel ( ) . getSpiceProxy ( ) . setEntity ( pool.getVmPoolSpiceProxy ( ) ) ; getModel ( ) . getSpiceProxy ( ) . setIsChangable ( true ) ; } instanceTypeManager = new org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.ExistingPoolInstanceTypeManager ( getModel ( ) , pool ) ; }
Source:
private java.lang.Integer calcMaxVCpu ( ) { java.lang.Integer maxSockets = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumOfVmSockets , vm.getCompatibilityVersion ( ) . getValue ( ) ) ; java.lang.Integer maxVCpus = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumOfVmCpus , vm.getCompatibilityVersion ( ) . getValue ( ) ) ; int threadsPerCore = vm.getThreadsPerCpu ( ) ; int cpuPerSocket = vm.getCpuPerSocket ( ) ; maxVCpus = ( cpuPerSocket * threadsPerCore ) * ( java.lang.Math.min ( maxSockets , ( maxVCpus / ( cpuPerSocket * threadsPerCore ) ) ) ) ; return maxVCpus ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > getSortedDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > diskImages = new java.util.ArrayList ( vm.getDiskMap ( ) . values ( ) ) ; java.util.Collections.sort ( diskImages , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; java.util.Collections.sort ( diskImages , java.util.Collections.reverseOrder ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilderBase.DiskImageByBootAndSnapshotComparator ( vm.getId ( ) ) ) ) ; return diskImages ; }
Source:
public void testUnmappedModelValue ( ) { for ( org.ovirt.engine.api.model.BootProtocol value : org.ovirt.engine.api.model.BootProtocol.values ( ) ) { org.junit.Assert.assertThat ( java.lang.String.format ( "%s.%s is not mapped" , org.ovirt.engine.api.model.BootProtocol.class . getName ( ) , value ) , org.ovirt.engine.api.restapi.types.Ipv6BootProtocolMapper.map ( value ) , org.hamcrest.Matchers.notNullValue ( ) ) ; } }

Target:
public void testUnmappedModelValue ( ) { for ( org.ovirt.engine.api.model.BootProtocol value : org.ovirt.engine.api.model.BootProtocol.values ( ) ) { org.hamcrest.MatcherAssert.assertThat ( java.lang.String.format ( "%s.%s is not mapped" , org.ovirt.engine.api.model.BootProtocol.class . getName ( ) , value ) , org.ovirt.engine.api.restapi.types.Ipv6BootProtocolMapper.map ( value ) , org.hamcrest.Matchers.notNullValue ( ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc heartBeat ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.ping" ) . 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 java.util.List < java.security.cert.Certificate > getPeerCertificates ( ) { try { return client.getClient ( ) . getPeerCertificates ( ) ; } catch ( org.ovirt.vdsm.jsonrpc.client.ClientConnectionException | java.lang.IllegalStateException e ) { org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcVdsServer.logger.error ( "Failed to get peer certification for host '{}': {}" , client.getHostname ( ) , e.getMessage ( ) ) ; org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcVdsServer.logger.debug ( "Exception" , e ) ; return null ; } }
Source:
private void loadPayload ( ) { org.ovirt.engine.core.dao.VmDeviceDAO dao = org.ovirt.engine.core.bll.RunVmOnceCommand.getDbFacade ( ) . getVmDeviceDao ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > disks = dao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getVmId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice disk : disks ) { if ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( disk.getSpecParams ( ) ) ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( disk ) ; org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . setVmPayload ( payload ) ; break ; } } }

Target:
private void loadPayload ( ) { org.ovirt.engine.core.dao.VmDeviceDao dao = org.ovirt.engine.core.bll.RunVmOnceCommand.getDbFacade ( ) . getVmDeviceDao ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > disks = dao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getVmId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice disk : disks ) { if ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( disk.getSpecParams ( ) ) ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( disk ) ; org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . setVmPayload ( payload ) ; break ; } } }
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 < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getParameters ( ) . getVmTemplate ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , imageToDestinationDomainMap.get ( disk.getId ( ) ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } 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 < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : getParameters ( ) . getVmTemplate ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , imageToDestinationDomainMap.get ( disk.getId ( ) ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } return list ; }
Source:
public void testGetFile ( ) throws java.lang.Exception { java.io.File file = writeConf ( "file=/file" ) ; org.ovirt.engine.core.authentication.Configuration config = org.ovirt.engine.core.authentication.Configuration.loadFile ( file ) ; junit.framework.Assert.assertNotNull ( config ) ; junit.framework.Assert.assertEquals ( new java.io.File ( "/file" ) , config.getFile ( "file" ) ) ; }

Target:
public void testGetFile ( ) throws java.lang.Exception { java.io.File file = writeConf ( "file=file" ) ; org.ovirt.engine.core.authentication.Configuration config = org.ovirt.engine.core.authentication.Configuration.loadFile ( file ) ; junit.framework.Assert.assertNotNull ( config ) ; junit.framework.Assert.assertEquals ( new java.io.File ( "file" ) , config.getFile ( "file" ) ) ; }
Source:
public void getHostNumaTopologyByHostId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.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.VdsNumaNode > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsNumaNodesByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , asyncQuery ) ; }

Target:
public void getAllRelevantQuotasForClusterSorted ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid topQuotaId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.QuotaConverter ( topQuotaId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRelevantQuotasForCluster , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createISCSIConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type , java.lang.String iqn , java.lang.String port , java.lang.String user , java.lang.String password ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( connection , type ) ; connectionDetails.setiqn ( iqn ) ; connectionDetails.setport ( port ) ; connectionDetails.setuser_name ( user ) ; connectionDetails.setpassword ( password ) ; return connectionDetails ; }

Target:
public void addNFSEmptyConn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.VALIDATION_STORAGE_CONNECTION_EMPTY_CONNECTION ) ; }
Source:
public void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType action , org.ovirt.engine.core.common.errors.VdcFault fault ) { if ( isRaiseErrorModalPanel ( action , fault ) ) { errorPopupManager.show ( org.ovirt.engine.ui.common.uicommon.FrontendEventsHandlerImpl.messages.uiCommonRunActionExecutionFailed ( org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . translate ( action ) , fault.getMessage ( ) ) ) ; } }

Target:
public void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType action , org.ovirt.engine.core.common.errors.EngineFault fault ) { if ( isRaiseErrorModalPanel ( action , fault ) ) { errorPopupManager.show ( org.ovirt.engine.ui.common.uicommon.FrontendEventsHandlerImpl.messages.uiCommonRunActionExecutionFailed ( org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . translate ( action ) , fault.getMessage ( ) ) ) ; } }
Source:
public void getDataCentersByStorageDomain ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , 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 ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
void mockGetCaCertificate ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue caCertificateReturnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; caCertificateReturnValue.setSucceeded ( true ) ; caCertificateReturnValue.setReturnValue ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.CA_CERTIFICATE ) ; org.mockito.Mockito.doReturn ( caCertificateReturnValue ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( VdcQueryType.GetCACertificate ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; }

Target:
void mockGetCaCertificate ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue caCertificateReturnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; caCertificateReturnValue.setSucceeded ( true ) ; caCertificateReturnValue.setReturnValue ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.CA_CERTIFICATE ) ; org.mockito.Mockito.doReturn ( caCertificateReturnValue ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetCACertificate ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain getStorageDomain ( ) { if ( ( CinderStorageDomain ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > providerStorageList = getStorageDomainDao ( ) . getAllByConnectionId ( provider.getId ( ) ) ; if ( ! ( providerStorageList.isEmpty ( ) ) ) { CinderStorageDomain = providerStorageList.get ( 0 ) ; } } return CinderStorageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain getStorageDomain ( ) { if ( ( CinderStorageDomain ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > providerStorageList = storageDomainDao.getAllByConnectionId ( provider.getId ( ) ) ; if ( ! ( providerStorageList.isEmpty ( ) ) ) { CinderStorageDomain = providerStorageList.get ( 0 ) ; } } return CinderStorageDomain ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult interfaceIsValidSlave ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.HostInterfaceValidator.VAR_INTERFACE_NAME , iface.getName ( ) ) ) . when ( ( ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( iface ) ) || ( iface.isBond ( ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult interfaceIsValidSlave ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.HostInterfaceValidator.VAR_NIC_NAME , iface.getName ( ) ) ) . when ( ( ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( iface ) ) || ( iface.isBond ( ) ) ) ) ; }
Source:
public void testGetAllInterfacesForVmFilteredWithoutPermissionsAndWithoutFiltering ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > result = dao.getAllForVm ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID , org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.UNPRIVILEGED_USER_ID , false ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : result ) { assertEquals ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID , iface.getVmId ( ) ) ; } }

Target:
public void testGetAllInterfacesForVmFilteredWithoutPermissionsAndWithoutFiltering ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > result = dao.getAllForVm ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID , org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.UNPRIVILEGED_USER_ID , false ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID , iface.getVmId ( ) ) ; } }
Source:
public void testQuotaStorageByQuotaGuidWithGeneralDefaultWithDefault ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorageList = dao.getQuotaStorageByQuotaGuidWithGeneralDefault ( FixturesTool.DEFAULT_QUOTA_GENERAL ) ; org.junit.Assert.assertNotNull ( quotaStorageList ) ; org.junit.Assert.assertEquals ( "wrong number of quotas returned" , 1 , quotaStorageList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.QuotaStorage group : quotaStorageList ) { org.junit.Assert.assertEquals ( "Storage ID should not be null in general mode" , Guid.Empty , group.getStorageId ( ) ) ; org.junit.Assert.assertNull ( "Storage name should not be null in general mode" , group.getStorageName ( ) ) ; } }

Target:
public void testQuotaStorageByQuotaGuidWithGeneralDefaultNoDefault ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorageList = dao.getQuotaStorageByQuotaGuidWithGeneralDefault ( FixturesTool.QUOTA_SPECIFIC ) ; org.junit.jupiter.api.Assertions.assertNotNull ( quotaStorageList ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , quotaStorageList.size ( ) , "wrong number of quotas returned" ) ; for ( org.ovirt.engine.core.common.businessentities.QuotaStorage group : quotaStorageList ) { org.junit.jupiter.api.Assertions.assertNotNull ( group.getStorageId ( ) , "Storage ID should not be null in specific mode" ) ; org.junit.jupiter.api.Assertions.assertNotNull ( group.getStorageName ( ) , "Storage name should not be null in specific mode" ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeRebalanceStop ( java.lang.String volumeName ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeRebalanceStop ( volumeName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturnForXmlRpc glusterVolumeRebalanceStop ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeRebalanceStop ( volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static void InitDictionaries ( ) { org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.clear ( ) ; for ( org.ovirt.engine.core.compat.Version ver : org.ovirt.engine.core.common.config.Config.< java.util.HashSet < org.ovirt.engine.core.compat.Version > > GetValue ( ConfigValues.SupportedClusterLevels ) ) { org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.put ( ver , new org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager ( ver ) ) ; } }

Target:
public static void InitDictionaries ( ) { org.ovirt.engine.core.bll.CpuFlagsManagerHandler.log.info ( "Start initializing dictionaries" ) ; org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.clear ( ) ; for ( org.ovirt.engine.core.compat.Version ver : org.ovirt.engine.core.common.config.Config.< java.util.HashSet < org.ovirt.engine.core.compat.Version > > GetValue ( ConfigValues.SupportedClusterLevels ) ) { org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.put ( ver , new org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager ( ver ) ) ; } org.ovirt.engine.core.bll.CpuFlagsManagerHandler.log.info ( "Finished initializing dictionaries" ) ; }
Source:
protected void initProviderList ( ) { startProgress ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllNetworkProviders ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > ) ( returnValue ) ) ; providers.add ( 0 , null ) ; getProviders ( ) . setItems ( providers ) ; } } ) ) ; }

Target:
protected void initProviderList ( ) { startProgress ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllNetworkProviders ( new org.ovirt.engine.ui.uicommonweb.models.networks.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > providers ) { stopProgress ( ) ; providers.add ( 0 , null ) ; getProviders ( ) . setItems ( providers ) ; } } ) ) ; }
Source:
private boolean canRemoveVmWithDetachDisks ( ) { if ( ! ( Guid.Empty.equals ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getVmtGuid ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.VM_CANNOT_REMOVE_WITH_DETACH_DISKS_BASED_ON_TEMPLATE ) ; } for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getDiskList ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImageList = org.ovirt.engine.core.bll.RemoveVmCommand.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( disk.getId ( ) ) ; if ( ( diskImageList.size ( ) ) > 1 ) { return failCanDoAction ( VdcBllMessages.VM_CANNOT_REMOVE_WITH_DETACH_DISKS_SNAPSHOTS_EXIST ) ; } } return true ; }

Target:
private boolean canRemoveVmWithDetachDisks ( ) { if ( ! ( Guid.Empty.equals ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getVmtGuid ( ) ) ) ) { return failCanDoAction ( EngineMessage.VM_CANNOT_REMOVE_WITH_DETACH_DISKS_BASED_ON_TEMPLATE ) ; } for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getDiskList ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImageList = org.ovirt.engine.core.bll.RemoveVmCommand.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( disk.getId ( ) ) ; if ( ( diskImageList.size ( ) ) > 1 ) { return failCanDoAction ( EngineMessage.VM_CANNOT_REMOVE_WITH_DETACH_DISKS_SNAPSHOTS_EXIST ) ; } } return true ; }
Source:
private boolean isVmInterfacesConfigured ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getInterfaces ( ) ) { if ( ( nic.getNetworkName ( ) ) == null ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.networkLinking ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED ) ; return false ; } else { return true ; } } } return true ; }

Target:
private boolean isVmInterfacesConfigured ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getInterfaces ( ) ) { if ( ( nic.getVnicProfileId ( ) ) == null ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.networkLinking ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED ) ; return false ; } else { return true ; } } } return true ; }
Source:
public void isPoolNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( java.lang.Boolean ) ( source ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmPoolWithSameNameExists , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public void isPoolNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.Converter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean convert ( java.lang.Object source ) { if ( source != null ) { return ! ( ( java.lang.Boolean ) ( source ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmPoolWithSameNameExists , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public void testEquals ( ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p1 = new org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > ( true , "abc" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p2 = new org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > ( true , "abc" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p3 = new org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > ( false , "abc" ) ; junit.framework.Assert.assertTrue ( p1.equals ( p2 ) ) ; junit.framework.Assert.assertFalse ( p1.equals ( p3 ) ) ; }

Target:
public void testEquals ( ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p1 = new org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > ( true , "abc" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p2 = new org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > ( true , "abc" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p3 = new org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > ( false , "abc" ) ; org.junit.Assert.assertTrue ( p1.equals ( p2 ) ) ; org.junit.Assert.assertFalse ( p1.equals ( p3 ) ) ; }
Source:
private void addDnsConfiguration ( org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations result ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NameServer > nameServersOfHost = getNameServers ( reportedDnsResolverConfiguration ) ; if ( isDefaultRouteNetwork ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NameServer > expectedNameServers = getExpectedNameServers ( ) ; boolean engineDefineDnsConfiguration = expectedNameServers != null ; if ( engineDefineDnsConfiguration ) { result.add ( org.ovirt.engine.core.common.businessentities.network.ReportedConfigurationType.DNS_CONFIGURATION , addressesAsString ( nameServersOfHost ) , addressesAsString ( expectedNameServers ) , java.util.Objects.equals ( nameServersOfHost , expectedNameServers ) ) ; } } }

Target:
private void addDnsConfiguration ( org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations result ) { if ( isDefaultRouteNetwork ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NameServer > nameServersOfHost = getNameServers ( reportedDnsResolverConfiguration ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NameServer > expectedNameServers = getExpectedNameServers ( ) ; result.add ( org.ovirt.engine.core.common.businessentities.network.ReportedConfigurationType.DNS_CONFIGURATION , addressesAsString ( nameServersOfHost ) , addressesAsString ( expectedNameServers ) , nameServersOfHost.containsAll ( expectedNameServers ) ) ; } }
Source:
public org.ovirt.engine.sdk.decorators.Network update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; 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 ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Network.class , org.ovirt.engine.sdk.decorators.Network.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Network update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; 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 ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Network.class , org.ovirt.engine.sdk.decorators.Network.class , headers ) ; }
Source:
protected void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDbUserByUserId , org.ovirt.engine.core.common.queries.GetDbUserByUserIdParameters.class , new java.lang.String [ ] { "UserId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; }

Target:
protected void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDbUserByUserId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; }
Source:
protected java.lang.String getReason ( ) { return org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . numOfVmsInPoolInvalod ( generateMaxLength ( ) , getPoolName ( ) . length ( ) ) ; }

Target:
protected java.lang.String getReason ( ) { return ( getQuestionMarksCount ( ) ) == 0 ? org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . numOfVmsInPoolInvalid ( generateMaxNumOfVms ( ) , getPoolName ( ) . length ( ) ) : org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . numOfVmsInPoolInvalidWithQuestionMarks ( generateMaxNumOfVmsWithQuestionMark ( ) , getPoolName ( ) . length ( ) , getQuestionMarksCount ( ) ) ; }