auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { 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.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public 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:
protected int getHighUtilizationDefaultValue ( ) { return org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.HighUtilizationForPowerSave ) ; }

Target:
protected org.ovirt.engine.core.bll.scheduling.utils.FindVmAndDestinations getFindVmAndDestinations ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.Map < java.lang.String , java.lang.String > parameters ) { final int highUtilization = tryParseWithDefault ( parameters.get ( "HighUtilization" ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.HighUtilizationForPowerSave ) ) ; final long overUtilizedMemory = ( parameters.containsKey ( EvenDistributionBalancePolicyUnit.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED ) ) ? java.lang.Long.valueOf ( parameters.get ( EvenDistributionBalancePolicyUnit.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED ) ) : 0L ; return new org.ovirt.engine.core.bll.scheduling.utils.FindVmAndDestinations ( cluster , highUtilization , overUtilizedMemory ) ; }
Source:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
private static boolean canPlugInterfaceInDc ( org.ovirt.engine.core.common.businessentities.network.VmNic iface , org.ovirt.engine.core.compat.Guid dataCenterId ) { if ( dataCenterId == null ) { return false ; } else { org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy pool = org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDcSingleton.getInstance ( ) . poolForDataCenter ( dataCenterId ) ; return ! ( pool.isMacInUse ( iface.getMacAddress ( ) ) ) ; } }

Target:
private static boolean canPlugInterfaceInDc ( java.lang.String macAddress , org.ovirt.engine.core.compat.Guid dataCenterId ) { if ( dataCenterId == null ) { return false ; } if ( macAddress == null ) { return true ; } org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy pool = org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDcSingleton.getInstance ( ) . poolForDataCenter ( dataCenterId ) ; return ! ( pool.isMacInUse ( macAddress ) ) ; }
Source:
protected java.util.Set < org.ovirt.engine.core.utils.MockConfigRule.MockConfigDescriptor < java.lang.Object > > getExtraConfigDescriptors ( ) { return new java.util.HashSet ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.MockConfigRule.mockConfig ( ConfigValues.OvirtInitialSupportedIsoVersion , "2.5.5:5.8" ) , org.ovirt.engine.core.utils.MockConfigRule.mockConfig ( ConfigValues.OvirtIsoPrefix , "^ovirt-node-iso-([0-9].*)\\.iso$:^rhevh-([0-9].*)\\.iso$" ) , org.ovirt.engine.core.utils.MockConfigRule.mockConfig ( ConfigValues.OvirtNodeOS , "^ovirt.*$:^rhev.*$" ) , org.ovirt.engine.core.utils.MockConfigRule.mockConfig ( ConfigValues.DataDir , "/usr/share/engine" ) , org.ovirt.engine.core.utils.MockConfigRule.mockConfig ( ConfigValues.oVirtISOsRepositoryPath , "/usr/share/ovirt-node-iso:/usr/share/rhev-hypervisor" ) ) ) ; }

Target:
protected java.util.Set < org.ovirt.engine.core.utils.MockConfigDescriptor < java.lang.Object > > getExtraConfigDescriptors ( ) { return new java.util.HashSet ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.OvirtInitialSupportedIsoVersion , "2.5.5:5.8" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.OvirtIsoPrefix , "^ovirt-node-iso-([0-9].*)\\.iso$:^rhevh-([0-9].*)\\.iso$" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.OvirtNodeOS , "^ovirt.*$:^rhev.*$" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.DataDir , "/usr/share/engine" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.oVirtISOsRepositoryPath , "/usr/share/ovirt-node-iso:/usr/share/rhev-hypervisor" ) ) ) ; }
Source:
public void testReadOneMovesToNextEventWithMultipleNestedElements ( ) { org.ovirt.api.metamodel.runtime.xml.XmlReader reader = openReader ( ( "<root>" + ( ( ( ( ( ( ( ( ( "<vm>" + "<name>myvm</name>" ) + "<description>My VM</description>" ) + "<disks>" ) + "<disk id=\"123\"><alias>disk1</alias></disk>" ) + "<disk id=\"456\"><alias>disk2</alias></disk>" ) + "</disks>" ) + "</vm>" ) + "<next/>" ) + "</root>" ) ) ) ; org.ovirt.engine.api.xml.V4XmlVmReader.readOne ( reader ) ; org.junit.Assert.assertEquals ( javax.xml.stream.XMLStreamConstants.START_ELEMENT , reader.getEventType ( ) ) ; org.junit.Assert.assertEquals ( "next" , reader.getLocalName ( ) ) ; }

Target:
public void testReadOneMovesToNextEventWithMultipleNestedElements ( ) { org.ovirt.api.metamodel.runtime.xml.XmlReader reader = openReader ( ( "<root>" + ( ( ( ( ( ( ( ( ( "<vm>" + "<name>myvm</name>" ) + "<description>My VM</description>" ) + "<disks>" ) + "<disk id=\"123\"><alias>disk1</alias></disk>" ) + "<disk id=\"456\"><alias>disk2</alias></disk>" ) + "</disks>" ) + "</vm>" ) + "<next/>" ) + "</root>" ) ) ) ; reader.next ( ) ; org.ovirt.engine.api.xml.V4XmlVmReader.readOne ( reader ) ; org.junit.Assert.assertEquals ( javax.xml.stream.XMLStreamConstants.START_ELEMENT , reader.getEventType ( ) ) ; org.junit.Assert.assertEquals ( "next" , reader.getLocalName ( ) ) ; }
Source:
private void completeNetworkNames ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachments , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap ) { networkIdNetworkNameCompleter.completeNetworkAttachments ( attachments , networkMap ) ; }

Target:
private void completeNetworkNames ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachments , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap ) { org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentsByHostIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.common.businessentities.VDS host = hostDao.get ( hostId ) ; networkIdNetworkNameCompleter.completeNetworkAttachments ( attachments , networkMap , host.getStoragePoolId ( ) ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.Permission o1 , org.ovirt.engine.core.common.businessentities.Permission o2 ) { if ( getValue ( o1 ) . equals ( getValue ( o2 ) ) ) { return 0 ; } else { return getCommonResources ( ) . userImage ( ) . equals ( getValue ( o1 ) ) ? - 1 : 1 ; } }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.Permission o1 , org.ovirt.engine.core.common.businessentities.Permission o2 ) { if ( getValue ( o1 ) . equals ( getValue ( o2 ) ) ) { return 0 ; } else { return org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn.resources.userImage ( ) . equals ( getValue ( o1 ) ) ? - 1 : 1 ; } }
Source:
private org.ovirt.engine.core.common.businessentities.Provider.AdditionalProperties mapAdditionalProperties ( java.sql.ResultSet rs , org.ovirt.engine.core.common.businessentities.Provider < ? > entity ) throws java.sql.SQLException { switch ( entity.getType ( ) ) { case OPENSTACK_NETWORK : org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties properties = new org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties ( ) ; properties.setTenantName ( rs.getString ( "tenant_name" ) ) ; properties.setPluginType ( rs.getString ( "plugin_type" ) ) ; return properties ; default : return null ; } }

Target:
private org.ovirt.engine.core.common.businessentities.Provider.AdditionalProperties mapAdditionalProperties ( java.sql.ResultSet rs , org.ovirt.engine.core.common.businessentities.Provider < ? > entity ) throws java.sql.SQLException { switch ( entity.getType ( ) ) { case OPENSTACK_NETWORK : org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties properties = new org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties ( ) ; properties.setTenantName ( rs.getString ( "tenant_name" ) ) ; properties.setPluginType ( rs.getString ( "plugin_type" ) ) ; properties.setAgentConfiguration ( org.ovirt.engine.core.utils.SerializationFactory.getDeserializer ( ) . deserialize ( rs.getString ( "agent_configuration" ) , org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties.AgentConfiguration.class ) ) ; return properties ; default : return null ; } }
Source:
public void save ( org.ovirt.engine.core.compat.Guid jobId , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.common.VdcObjectType entityType ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "job_id" , jobId ) . addValue ( "entity_id" , entityId ) . addValue ( "entity_type" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( entityType ) ) ; getCallsHandler ( ) . executeModification ( "InsertJobSubjectEntity" , parameterSource ) ; }

Target:
public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > getJobSubjectEntityByJobId ( org.ovirt.engine.core.compat.Guid jobId ) { java.util.List < org.ovirt.engine.core.common.job.JobSubjectEntity > list = multipleResults ( entityManager.createNamedQuery ( "JobSubjectEntity.getJobSubjectEntityByJobId" , org.ovirt.engine.core.common.job.JobSubjectEntity.class ) . setParameter ( "jobId" , jobId ) ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entityMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > ( ) ; for ( org.ovirt.engine.core.common.job.JobSubjectEntity jobSubjectEntity : list ) { entityMap.put ( jobSubjectEntity.getEntityId ( ) , jobSubjectEntity.getEntityType ( ) ) ; } return entityMap ; }
Source:
public java.util.Collection < ? > getProblemFacts ( ) { java.util.Collection < java.lang.Object > facts = new java.util.ArrayList < > ( ) ; facts.addAll ( vms ) ; facts.addAll ( hosts ) ; facts.addAll ( otherFacts ) ; facts.addAll ( fixedFacts ) ; return facts ; }

Target:
public java.util.Collection < ? > getProblemFacts ( ) { java.util.Collection < java.lang.Object > facts = new java.util.ArrayList < > ( ) ; facts.addAll ( instances ) ; facts.addAll ( hosts ) ; facts.addAll ( otherFacts ) ; facts.addAll ( fixedFacts ) ; facts.addAll ( vms.values ( ) ) ; return facts ; }
Source:
public void shouldFailWhenGraphicsTypeNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.console.ConsoleOptions options = new org.ovirt.engine.core.common.console.ConsoleOptions ( ) ; options.setVmId ( Guid.Empty ) ; org.ovirt.engine.core.common.queries.ConsoleOptionsParams params = new org.ovirt.engine.core.common.queries.ConsoleOptionsParams ( options ) ; org.ovirt.engine.core.bll.GetConsoleDescriptorFileQuery query = new org.ovirt.engine.core.bll.GetConsoleDescriptorFileQuery ( params ) ; org.junit.Assert.assertFalse ( query.validateInputs ( ) ) ; }

Target:
public void shouldFailWhenGraphicsTypeNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.console.ConsoleOptions options = new org.ovirt.engine.core.common.console.ConsoleOptions ( ) ; options.setVmId ( Guid.Empty ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( options ) ; org.junit.Assert.assertFalse ( getQuery ( ) . validateInputs ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Quota > getAllRelevantQuotasForVdsGroup ( org.ovirt.engine.core.compat.Guid vdsGroupId , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource ( ) ; quotaParameterSource.addValue ( "vds_group_id" , vdsGroupId ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = getCallsHandler ( ) . executeReadList ( "getAllThinQuotasByVDSGroupId" , getQuotaMetaDataFromResultSet ( ) , quotaParameterSource ) ; return quotas ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Quota > getAllRelevantQuotasForVdsGroup ( org.ovirt.engine.core.compat.Guid vdsGroupId , long engineSessionSeqId , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource ( ) ; quotaParameterSource.addValue ( "vds_group_id" , vdsGroupId ) . addValue ( "engine_session_seq_id" , engineSessionSeqId ) . addValue ( "is_filtered" , isFiltered ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = getCallsHandler ( ) . executeReadList ( "getAllThinQuotasByVDSGroupId" , getQuotaMetaDataFromResultSet ( ) , quotaParameterSource ) ; return quotas ; }
Source:
private void endCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { if ( ! ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . isRemoveDuringExecution ( ) ) ) { removeImageFromDB ( true ) ; } } else { org.ovirt.engine.core.bll.RemoveImageCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.RemoveImageCommand.unLockImage ( ) ; } org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }

Target:
private void performImageDbOperations ( ) { switch ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getDbOperationScope ( ) ) { case IMAGE : removeImageFromDB ( ) ; break ; case MAPPING : removeImageMapping ( ) ; break ; case NONE : break ; } }
Source:
private void assertGetAllRelevantQuoatsForStorage ( org.ovirt.engine.core.compat.Guid storageId , int expectedQuotas ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = dao.getAllRelevantQuotasForStorage ( storageId , org.ovirt.engine.core.dao.PRIVILEGED_USER_SESSION_ID , false ) ; org.junit.Assert.assertEquals ( "Wrong number of quotas retuend" , expectedQuotas , quotas.size ( ) ) ; }

Target:
private void assertGetAllRelevantQuoatsForStorage ( org.ovirt.engine.core.compat.Guid storageId , int expectedQuotas ) { org.junit.Assert.assertNotNull ( privilegedUserSession ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = dao.getAllRelevantQuotasForStorage ( storageId , privilegedUserSession.getId ( ) , false ) ; org.junit.Assert.assertEquals ( "Wrong number of quotas retuend" , expectedQuotas , quotas.size ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcActionParametersBase getAddParameters ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity , org.ovirt.engine.api.model.NIC nic ) { return new org.ovirt.engine.core.common.action.AddVmInterfaceParameters ( parentId , setNetwork ( nic , entity ) ) ; }

Target:
protected org.ovirt.engine.core.common.action.VdcActionParametersBase getAddParameters ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity , org.ovirt.engine.api.model.NIC nic ) { return new org.ovirt.engine.core.common.action.AddVmInterfaceParameters ( parentId , setNetwork ( nic , entity ) , ( nic.isSetNetwork ( ) ? entity.getNetworkName ( ) : null ) , ( nic.isSetPortMirroring ( ) ? entity.isPortMirroring ( ) : false ) ) ; }
Source:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.UnLockVmTemplate ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full EndAction" ) ; } }

Target:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.UnLockVmTemplate ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full endAction" ) ; } }
Source:
public void setMessage ( java.lang.String message ) { super . setMessage ( message ) ; boolean isMessageEmpty = ( message == null ) || ( message.isEmpty ( ) ) ; messagePanel.setVisible ( ( ! isMessageEmpty ) ) ; messagePanel.add ( new com.google.gwt.user.client.ui.Label ( message ) ) ; }

Target:
public void setMessage ( java.lang.String message ) { super . setMessage ( message ) ; if ( ( message != null ) && ( ! ( message.isEmpty ( ) ) ) ) { messagePanel.add ( new com.google.gwt.user.client.ui.HTML ( templates.iconWithText ( warningImage , message ) ) ) ; } messagePanel.setVisible ( messagePanel.iterator ( ) . hasNext ( ) ) ; }
Source:
private void massLabelsUpdate ( org.ovirt.engine.core.compat.Guid vfsConfigId , java.util.Set < java.lang.String > labels ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > executions = new java.util.ArrayList < > ( labels.size ( ) ) ; for ( java.lang.String label : labels ) { executions.add ( createLabelParametersMapper ( vfsConfigId , label ) ) ; } getCallsHandler ( ) . executeStoredProcAsBatch ( "InsertvfsConfigLabel" , executions ) ; }

Target:
private void massLabelsUpdate ( org.ovirt.engine.core.compat.Guid vfsConfigId , java.util.Set < java.lang.String > labels ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > executions = new java.util.ArrayList < > ( labels.size ( ) ) ; for ( java.lang.String label : labels ) { executions.add ( createLabelParametersMapper ( vfsConfigId , label ) ) ; } getCallsHandler ( ) . executeStoredProcAsBatch ( "InsertVfsConfigLabel" , executions ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( GUIDS [ 0 ] , true ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( GUIDS [ 0 ] , true ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private boolean networkAttachmentReferenceSameNetworkDuplicately ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > userNetworkAttachments ) { java.util.Set < org.ovirt.engine.core.compat.Guid > networkIds = new java.util.HashSet ( userNetworkAttachments.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : userNetworkAttachments ) { networkIds.add ( attachment.getNetworkId ( ) ) ; } return ( networkIds.size ( ) ) != ( userNetworkAttachments.size ( ) ) ; }

Target:
private java.util.Set < java.lang.String > getRemovedBondNames ( ) { if ( ( removedBondNames ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > existingVdsInterfaceToBeRemoved = getRemovedBonds ( ) ; java.util.Set < java.lang.String > removedBondNames = new java.util.HashSet ( existingVdsInterfaceToBeRemoved.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface removedBondInterface : existingVdsInterfaceToBeRemoved ) { removedBondNames.add ( removedBondInterface.getName ( ) ) ; } this . removedBondNames = removedBondNames ; } return removedBondNames ; }
Source:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassCanDoAction ( ) ; group.setcompatibility_version ( Version.v3_3 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Arrays.asList ( "VirtIO" ) ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }

Target:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassCanDoAction ( ) ; group.setCompatibilityVersion ( Version.v3_3 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Arrays.asList ( "VirtIO" ) ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { fullVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.getBroker ( ) . fullList ( org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.getParameters ( ) . getVmIds ( ) . stream ( ) . map ( Guid :: toString ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.Object > [ ] struct = fullVmListReturn.vmList ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.setReturnValue ( struct ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { fullVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.getBroker ( ) . fullList ( org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.getParameters ( ) . getVmIds ( ) . stream ( ) . map ( Guid :: toString ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.Object > [ ] struct = fullVmListReturn.vmList ; java.util.Arrays.stream ( struct ) . forEach ( this :: changeScsiDeviceToVirtioScsi ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.setReturnValue ( struct ) ; }
Source:
public static void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getAAAProfilesListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean passwordBasedOnly ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.convertAAAProfilesResult ( aQuery , passwordBasedOnly ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testGetFileDataStoreNoNetwork ( ) throws java.io.IOException { final java.util.Map < java.lang.String , byte [ ] > actual = underTest.getFileData ( ) ; final java.util.Map < java.lang.String , java.lang.Object > actualMetaData = parseResult ( actual ) ; org.junit.Assert.assertThat ( actualMetaData , org.hamcrest.Matchers.not ( org.hamcrest.Matchers.hasKey ( "network_config" ) ) ) ; org.junit.Assert.assertThat ( actualMetaData , org.hamcrest.Matchers.not ( org.hamcrest.Matchers.hasKey ( "network-interfaces" ) ) ) ; assertOpenstackNetworkDataFileNotCreated ( actual ) ; }

Target:
public void testGetFileDataStoreNoNetwork ( ) throws java.io.IOException { final java.util.Map < java.lang.String , byte [ ] > actual = underTest.getFileData ( ) ; final java.util.Map < java.lang.String , java.lang.Object > actualMetaData = parseResult ( actual ) ; org.hamcrest.MatcherAssert.assertThat ( actualMetaData , org.hamcrest.Matchers.not ( org.hamcrest.Matchers.hasKey ( "network_config" ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( actualMetaData , org.hamcrest.Matchers.not ( org.hamcrest.Matchers.hasKey ( "network-interfaces" ) ) ) ; assertOpenstackNetworkDataFileNotCreated ( actual ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.VmInterfaceType getDefaultNicType ( ) { return org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.pv ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VmInterfaceType getDefaultNicType ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > items ) { if ( ( items == null ) || ( items.isEmpty ( ) ) ) { return null ; } else if ( items.contains ( VmInterfaceType.pv ) ) { return org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.pv ; } else { return items.iterator ( ) . next ( ) ; } }
Source:
org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VdsmVm > build ( ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VdsmVm > pair = pairOf ( createDbVm ( ) , createVmInternalData ( ) ) ; pair.getSecond ( ) . getVmDynamic ( ) . setStatus ( VMStatus.MigratingTo ) ; pair.getSecond ( ) . getVmDynamic ( ) . setRunOnVds ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs.DST_HOST_ID ) ; return pair ; }

Target:
org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > build ( ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > pair = pairOf ( createDbVm ( ) , createVmInternalData ( ) ) ; pair.getSecond ( ) . getVmDynamic ( ) . setStatus ( VMStatus.MigratingTo ) ; pair.getSecond ( ) . getVmDynamic ( ) . setRunOnVds ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs.DST_HOST_ID ) ; return pair ; }
Source:
private void networkNameTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , boolean networkLinkingSupported , java.lang.String networkName ) { mockConfigRule.mockConfigValue ( ConfigValues.NetworkLinkingSupported , version , networkLinkingSupported ) ; org.mockito.Mockito.when ( nic.getNetworkName ( ) ) . thenReturn ( networkName ) ; org.junit.Assert.assertThat ( validator.networkNameValid ( ) , matcher ) ; }

Target:
private void vnicProfileTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , boolean networkLinkingSupported , org.ovirt.engine.core.compat.Guid vnicProfileId ) { mockConfigRule.mockConfigValue ( ConfigValues.NetworkLinkingSupported , version , networkLinkingSupported ) ; org.mockito.Mockito.when ( nic.getVnicProfileId ( ) ) . thenReturn ( vnicProfileId ) ; org.junit.Assert.assertThat ( validator.emptyNetworkValid ( ) , matcher ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.provider.network.NetworkProviderProxy proxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) . getProvidedBy ( ) . setExternalId ( proxy.add ( org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) ) ) ; org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) . setVlanId ( null ) ; 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 ( ) { addNetwork ( ) ; return null ; } } ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.provider.network.NetworkProviderProxy proxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) . getProvidedBy ( ) . setExternalId ( proxy.add ( org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) ) ) ; org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) . setVlanId ( null ) ; org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) . setLabel ( null ) ; 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 ( ) { addNetwork ( ) ; return null ; } } ) ; }
Source:
public static void IsLiveStorageMigrationEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters params = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.LiveStorageMigrationEnabled ) ; params.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( params , 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.storage_domains > ( ) ; } 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.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void canDoActionFailsOnServerNotUp ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForAdd ( VDSStatus.Down ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP.toString ( ) ) ) ; }

Target:
public void validateFailsOnServerNotUp ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForAdd ( VDSStatus.Down ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP.toString ( ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterSnapshotInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterSnapshotInfo ( "" , volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepConfigListXmlRpc glusterVolumeGeoRepConfigList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String userName ) { try { return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepConfigListXmlRpc ( vdsServer.glusterVolumeGeoRepConfigList ( volumeName , slaveHost , slaveVolumeName , userName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static void initOsArchitecture ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osArchitectures = ( ( java.util.HashMap < java.lang.Integer , org.ovirt.engine.core.common.businessentities.ArchitectureType > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsArchitectures ) , callback ) ; }

Target:
public void initLinuxOsTypes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { linuxOsIds = ( ( java.util.ArrayList < java.lang.Integer > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetLinuxOss ) , callback ) ; }
Source:
private org.apache.http.conn.ClientConnectionManager createPoolingClientConnectionManager ( java.lang.String url , java.lang.Integer port ) { org.apache.http.conn.scheme.SchemeRegistry schemeRegistry = createSchemeRegistry ( url , port ) ; org.apache.http.impl.conn.PoolingClientConnectionManager cm = new org.apache.http.impl.conn.PoolingClientConnectionManager ( schemeRegistry ) ; cm.setMaxTotal ( org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS ) ; cm.setDefaultMaxPerRoute ( org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS_PER_ROUTE ) ; cm.setMaxPerRoute ( new org.apache.http.conn.routing.HttpRoute ( new org.apache.http.HttpHost ( getHost ( url ) , getPort ( url , port ) ) ) , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS_PER_HOST ) ; new org.ovirt.engine.sdk.web.IdleConnectionMonitorThread ( cm , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.WAIT_IDLE_CHECK_TTL , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.WAIT_IDLE_CLOSE_TTL ) . start ( ) ; return cm ; }

Target:
private org.apache.http.impl.client.DefaultHttpClient createDefaultHttpClient ( java.lang.String url , java.lang.String username , java.lang.String password , java.lang.String key_file , java.lang.String cert_file , java.lang.String ca_file , java.lang.Integer port , java.lang.Integer timeout ) { int port_ = getPort ( url , port ) ; org.apache.http.impl.client.DefaultHttpClient client = new org.apache.http.impl.client.DefaultHttpClient ( createPoolingClientConnectionManager ( url , port_ ) ) ; client.getCredentialsProvider ( ) . setCredentials ( new org.apache.http.auth.AuthScope ( getHost ( url ) , port_ ) , new org.apache.http.auth.UsernamePasswordCredentials ( username , password ) ) ; return client ; }
Source:
private boolean devicePluggable ( org.ovirt.engine.core.common.businessentities.VmDevice device ) { return ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isDisk ( device ) ) || ( ( VmDeviceType.BRIDGE.getName ( ) . equals ( device.getDevice ( ) ) ) && ( ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.INTERFACE ) == ( device.getType ( ) ) ) ) ; }

Target:
private int parseIntVdsProperty ( java.lang.Object vdsProperty ) { if ( vdsProperty instanceof java.lang.Integer ) { return ( ( java.lang.Integer ) ( vdsProperty ) ) ; } else { return java.lang.Integer.parseInt ( ( ( java.lang.String ) ( vdsProperty ) ) ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; getDataCenters ( ) . setItems ( dataCenters ) ; getDataCenters ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCenters ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetExternalNetworkList ( networkQuery , provider.getId ( ) ) ; }

Target:
protected void initProviderList ( ) { getProviders ( ) . setItems ( java.util.Collections.singletonList ( provider ) ) ; }
Source:
private void initHostWithOneVfsConfig ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > passthroughVnics , int numOfVfs , boolean allNetworksAllowed , boolean networkInSriovConfig , boolean labelInSriovConfig , boolean hasFreeVf ) { org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig hostNicVfsConfig = new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic : passthroughVnics ) { updateVfsConfig ( hostNicVfsConfig , vnic , numOfVfs , allNetworksAllowed , networkInSriovConfig , labelInSriovConfig , hasFreeVf ) ; } mockVfsConfigsOnHost ( java.util.Collections.singletonList ( hostNicVfsConfig ) ) ; }

Target:
private void initHostWithOneVfsConfig ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > passthroughVnics , int numOfVfs , boolean allNetworksAllowed , boolean networkInSriovConfig , boolean labelInSriovConfig , boolean hasFreeVf , boolean freeVfShareIommuGroup ) { org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig hostNicVfsConfig = new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic : passthroughVnics ) { updateVfsConfig ( hostNicVfsConfig , vnic , numOfVfs , allNetworksAllowed , networkInSriovConfig , labelInSriovConfig , hasFreeVf , freeVfShareIommuGroup ) ; } mockVfsConfigsOnHost ( java.util.Collections.singletonList ( hostNicVfsConfig ) ) ; }
Source:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { 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.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void canDoActionPreallocatedSpaceCheckFailsSize ( ) { final int availableSize = 3 ; final int usedSize = 7 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
public void canDoActionSpaceValidationFails ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockMaxPciSlots ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }
Source:
protected static org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain currDomain : domainsInPool ) { org.ovirt.engine.core.bll.VmHandler.updateDisksStorageType ( currDomain.getStorageType ( ) , disksList.get ( 0 ) ) ; if ( ( ( currDomain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( ( currDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) && ( org.ovirt.engine.core.bll.VmHandler.validateSpaceRequirements ( currDomain , disksList ) ) ) { return currDomain ; } } return null ; }

Target:
private static void updateDisksStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disksList ) { disk.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Collections.singletonList ( storageDomain.getId ( ) ) ) ) ; } org.ovirt.engine.core.bll.VmHandler.updateDiskVolumeType ( storageDomain.getStorageType ( ) , disksList.get ( 0 ) ) ; }