auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void initVncKeyboardLayout ( ) { final java.util.List < java.lang.String > layouts = ( ( java.util.List < java.lang.String > ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) ) ; final java.util.ArrayList < java.lang.String > vncKeyboardLayoutItems = new java.util.ArrayList < java.lang.String > ( ) ; vncKeyboardLayoutItems.add ( null ) ; vncKeyboardLayoutItems.addAll ( layouts ) ; getVncKeyboardLayout ( ) . setItems ( vncKeyboardLayoutItems ) ; getVncKeyboardLayout ( ) . setIsAvailable ( isVncSelected ( ) ) ; }

Target:
private void initVncKeyboardLayout ( ) { final java.util.List < java.lang.String > layouts = ( ( java.util.List < java.lang.String > ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) ) ; final java.util.ArrayList < java.lang.String > vncKeyboardLayoutItems = new java.util.ArrayList < java.lang.String > ( ) ; vncKeyboardLayoutItems.add ( null ) ; vncKeyboardLayoutItems.addAll ( layouts ) ; getVncKeyboardLayout ( ) . setItems ( vncKeyboardLayoutItems ) ; getVncKeyboardLayout ( ) . setIsAvailable ( isVncSelected ( ) ) ; }
Source:
private void setupNetworkValidator ( boolean valid ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.NetworkValidator.class ) ; org.mockito.Mockito.when ( validator.canNetworkCompatabilityBeDecreased ( ) ) . thenReturn ( valid ) ; org.mockito.Mockito.when ( cmd.getNetworkValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.network.Network.class ) ) ) . thenReturn ( validator ) ; }

Target:
private void setupNetworkValidator ( boolean valid ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.NetworkValidator.class ) ; org.mockito.Mockito.when ( validator.canNetworkCompatabilityBeDecreased ( ) ) . thenReturn ( valid ) ; org.mockito.Mockito.when ( cmd.getNetworkValidator ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( validator ) ; }
Source:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.Statistic > collection ) { org.junit.Assert.assertNotNull ( collection ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResourceTest.STATISTICS.length , collection.size ( ) ) ; for ( int i = 0 ; i < ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResourceTest.STATISTICS.length ) ; i ++ ) { org.ovirt.engine.api.model.Statistic statistic = collection.get ( i ) ; org.ovirt.engine.api.restapi.resource.BackendStatisticsResourceTest.verify ( statistic , org.ovirt.engine.api.restapi.resource.BackendStatisticsResourceTest.STATISTICS [ i ] ) ; verifyLinks ( statistic ) ; } }

Target:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.Statistic > collection ) { org.junit.jupiter.api.Assertions.assertNotNull ( collection ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResourceTest.STATISTICS.length , collection.size ( ) ) ; for ( int i = 0 ; i < ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResourceTest.STATISTICS.length ) ; i ++ ) { org.ovirt.engine.api.model.Statistic statistic = collection.get ( i ) ; org.ovirt.engine.api.restapi.resource.BackendStatisticsResourceTest.verify ( statistic , org.ovirt.engine.api.restapi.resource.BackendStatisticsResourceTest.STATISTICS [ i ] ) ; verifyLinks ( statistic ) ; } }
Source:
private void updateReportCommandAvailability ( org.ovirt.engine.ui.uicommonweb.ReportCommand reportCommand , java.util.List < ? > selectedItems ) { reportCommand.setIsExecutionAllowed ( ( ( ( ! ( reportCommand.isMultiple ( ) ) ) && ( ( selectedItems.size ( ) ) == 1 ) ) || ( ( reportCommand.isMultiple ( ) ) && ( ( selectedItems.size ( ) ) > 1 ) ) ) ) ; }

Target:
public void onSuccess ( java.util.List < T > items ) { java.util.Collections.sort ( items , comparator ) ; setItems ( items ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesList ( ) { if ( ( ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImagesList ( ) ) == null ) && ( ! ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . setImagesList ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getDiskImageDAO ( ) . getAllSnapshotsForVmSnapshot ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) ) ) ; } return org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImagesList ( ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesList ( ) { if ( ( ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImagesList ( ) ) == null ) && ( ! ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . setImagesList ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) ) ) ; } return org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImagesList ( ) ; }
Source:
public void getSearchResultsLimit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 100 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SearchResultsLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String templateName , org.ovirt.engine.core.compat.Guid datacenterId ) { 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 ) ) ) ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( templateName ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc extendVolumeSize ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imageUUID , java.lang.String volumeUUID , java.lang.String newSize ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.extendSize" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imageUUID ) . withParameter ( "volumeID" , volumeUUID ) . withParameter ( "newSize" , newSize ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn extendVolumeSize ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imageUUID , java.lang.String volumeUUID , java.lang.String newSize ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.extendSize" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imageUUID ) . withParameter ( "volumeID" , volumeUUID ) . withParameter ( "newSize" , newSize ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn ( response ) ; }
Source:
public void generate ( org.ovirt.api.metamodel.concepts.Model model , java.io.File file ) { this . model = model ; try ( java.io.OutputStream out = new java.io.FileOutputStream ( file ) ) { javax.xml.stream.XMLOutputFactory factory = javax.xml.stream.XMLOutputFactory.newFactory ( ) ; writer = factory.createXMLStreamWriter ( out , "UTF-8" ) ; com.sun.xml.txw2.output.IndentingXMLStreamWriter indenter = new com.sun.xml.txw2.output.IndentingXMLStreamWriter ( writer ) ; indenter.setIndentStep ( " " ) ; writer = indenter ; writeModel ( ) ; writer.close ( ) ; } catch ( java.io.IOException | javax.xml.stream.XMLStreamException exception ) { throw new java.lang.IllegalStateException ( "Can't generate XML representation" , exception ) ; } }

Target:
private void writeModel ( ) { writer.writeStartElement ( "model" ) ; writer.writeStartElement ( "types" ) ; model.types ( ) . forEach ( this :: writeType ) ; writer.writeEndElement ( ) ; writer.writeStartElement ( "services" ) ; model.services ( ) . forEach ( this :: writeService ) ; writer.writeEndElement ( ) ; writer.writeEndElement ( ) ; }
Source:
public java.util.Map createStorageDomain ( java.lang.Integer storageType , java.lang.String sdUUID , java.lang.String domainName , java.lang.String typeSpecificArg , java.lang.Integer domClass , java.lang.String storageFormatType ) { log.info ( "Storage domain sdUUID: {}, name: created." , sdUUID , domainName ) ; org.ovirt.vdsmfake.domain.StorageDomain storageDomain = getStorageDomainById ( sdUUID ) ; storageDomain.setName ( domainName ) ; storageDomain.setDomainClass ( StorageDomain.DomainClass.getByCode ( domClass ) ) ; storageDomain.setStorageType ( StorageDomain.StorageType.getByCode ( storageType ) ) ; updateStorageDomain ( storageDomain ) ; return getOKStatus ( ) ; }

Target:
public java.util.Map createStorageDomain ( java.lang.Integer storageType , java.lang.String sdUUID , java.lang.String domainName , java.lang.String typeSpecificArg , java.lang.Integer domClass , java.lang.String storageFormatType ) { log.info ( "Storage domain sdUUID: {}, name: created." , sdUUID , domainName ) ; org.ovirt.vdsmfake.domain.StorageDomain storageDomain = getStorageDomainById ( sdUUID ) ; storageDomain.setName ( domainName ) ; storageDomain.setConnection ( typeSpecificArg ) ; storageDomain.setDomainClass ( StorageDomain.DomainClass.getByCode ( domClass ) ) ; storageDomain.setStorageType ( StorageDomain.StorageType.getByCode ( storageType ) ) ; updateStorageDomain ( storageDomain ) ; return getOKStatus ( ) ; }
Source:
public void testValidateQosOverriddenInterfacesWhenAttachmentDoesNotHaveQosOverridden ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = java.util.Collections.singletonList ( networkAttachment ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworkValidator ( networkAttachments ) ; org.junit.Assert.assertThat ( validator.validateQosOverriddenInterfaces ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateQosOverriddenInterfacesWhenAttachmentDoesNotHaveQosOverridden ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addNetworkAttachments ( networkAttachment ) ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateQosOverriddenInterfaces ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > > allTemplates = org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getDbFacade ( ) . getVmTemplateDAO ( ) . getAllForImage ( org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getParameters ( ) . getImageGuid ( ) ) ; for ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates : allTemplates.values ( ) ) { for ( org.ovirt.engine.core.common.businessentities.VmTemplate t : templates ) { updateDisksFromDb ( t ) ; } } org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getQueryReturnValue ( ) . setReturnValue ( allTemplates ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.Map < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > templateMap = org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getDbFacade ( ) . getVmTemplateDAO ( ) . getAllForImage ( org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getParameters ( ) . getImageGuid ( ) ) ; if ( ! ( templateMap.values ( ) . isEmpty ( ) ) ) { updateDisksFromDb ( templateMap.values ( ) . iterator ( ) . next ( ) ) ; } org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getQueryReturnValue ( ) . setReturnValue ( templateMap ) ; }
Source:
private org.ovirt.engine.api.model.Networks mapCollection ( java.util.List < org.ovirt.engine.api.model.Network > entities ) { org.ovirt.engine.api.model.Networks collection = new org.ovirt.engine.api.model.Networks ( ) ; for ( org.ovirt.engine.api.model.Network entity : entities ) { collection.getNetworks ( ) . add ( addLinks ( map ( entity ) ) ) ; } return collection ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; org.ovirt.engine.api.model.DataCenter dataCenter = new org.ovirt.engine.api.model.DataCenter ( ) ; dataCenter.setId ( dataCenterId.toString ( ) ) ; network.setDataCenter ( dataCenter ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getAddParameters ( network , entity ) ; return performCreate ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }
Source:
protected boolean canDoAction ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) ) == null ) { addCanDoActionMessage ( EngineMessage.VDS_INVALID_SERVER_ID ) ; result = false ; } else if ( ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Connecting ) ) || ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ) { addCanDoActionMessage ( EngineMessage.VDS_CANNOT_CHECK_VERSION_HOST_NON_RESPONSIVE ) ; result = false ; } return result ; }

Target:
protected boolean validate ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) ) == null ) { addValidationMessage ( EngineMessage.VDS_INVALID_SERVER_ID ) ; result = false ; } else if ( ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Connecting ) ) || ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ) { addValidationMessage ( EngineMessage.VDS_CANNOT_CHECK_VERSION_HOST_NON_RESPONSIVE ) ; result = false ; } return result ; }
Source:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_PLACE ) ; bindResourceConfiguration ( org.ovirt.engine.ui.webadmin.ApplicationConstants.class , org.ovirt.engine.ui.webadmin.ApplicationMessages.class , org.ovirt.engine.ui.webadmin.ApplicationResources.class , org.ovirt.engine.ui.webadmin.ApplicationTemplates.class , org.ovirt.engine.ui.webadmin.ApplicationDynamicConstants.class ) ; }

Target:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_PLACE ) ; bindResourceConfiguration ( org.ovirt.engine.ui.webadmin.ApplicationConstants.class , org.ovirt.engine.ui.webadmin.ApplicationMessages.class , org.ovirt.engine.ui.webadmin.ApplicationResources.class , org.ovirt.engine.ui.webadmin.ApplicationTemplates.class , org.ovirt.engine.ui.webadmin.ApplicationDynamicMessages.class ) ; }
Source:
public void onVdsDuringFailureTimer ( ) { synchronized ( getLockObj ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( getVdsId ( ) ) ; if ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Error ) ) { mFailedToRunVmAttempts.set ( 0 ) ; setStatus ( VDSStatus.Up , vds ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . updateStatus ( getVdsId ( ) , VDSStatus.Up ) ; org.ovirt.engine.core.vdsbroker.VdsManager.log.infoFormat ( "onVdsDuringFailureTimer of Host {0} entered after {1} attempts to run a VM" , vds.getName ( ) , mFailedToRunVmAttempts ) ; } } }

Target:
public void recoverFromError ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( getVdsId ( ) ) ; if ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Error ) ) { setStatus ( VDSStatus.Up , vds ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . updateStatus ( getVdsId ( ) , VDSStatus.Up ) ; org.ovirt.engine.core.vdsbroker.VdsManager.log.infoFormat ( "recoverFromError of Host {0} entered after {1} attempts to run a VM" , vds.getName ( ) , mFailedToRunVmAttempts ) ; mFailedToRunVmAttempts.set ( 0 ) ; } }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ; }

Target:
public static void fillTagsRecursive ( org.ovirt.engine.core.common.businessentities.tags tagToFill , java.util.List < org.ovirt.engine.core.common.businessentities.tags > children ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.tags > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.tags > ( ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : children ) { if ( ( tag.gettype ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { list.add ( tag ) ; if ( ( tag.getChildren ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.fillTagsRecursive ( tag , tag.getChildren ( ) ) ; } } } tagToFill.setChildren ( list ) ; }
Source:
public java.lang.Integer runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . getByVdsmTaskId ( vdsmTaskId ) ; int retVal = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . removeByVdsmTaskId ( vdsmTaskId ) ; if ( ( asyncTask != null ) && ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( asyncTask.getCommandId ( ) ) ) ) ) { commandsCache.remove ( asyncTask.getCommandId ( ) ) ; } return retVal ; }

Target:
private void buildCmdHierarchy ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { if ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( cmdEntity.getRootCommandId ( ) ) ) ) { childHierarchy.putIfAbsent ( cmdEntity.getRootCommandId ( ) , new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ; if ( ! ( childHierarchy.get ( cmdEntity.getRootCommandId ( ) ) . contains ( cmdEntity.getId ( ) ) ) ) { childHierarchy.get ( cmdEntity.getRootCommandId ( ) ) . add ( cmdEntity.getId ( ) ) ; } } }
Source:
public void UpdateItemsAvailability ( ) { if ( ! ( org.ovirt.engine.ui.frontend.Frontend.getQueryStartedEvent ( ) . getListeners ( ) . contains ( this ) ) ) org.ovirt.engine.ui.frontend.Frontend.getQueryStartedEvent ( ) . addListener ( this ) ; if ( ! ( org.ovirt.engine.ui.frontend.Frontend.getQueryCompleteEvent ( ) . getListeners ( ) . contains ( this ) ) ) org.ovirt.engine.ui.frontend.Frontend.getQueryCompleteEvent ( ) . addListener ( this ) ; }

Target:
public void updateItemsAvailability ( ) { if ( ! ( org.ovirt.engine.ui.frontend.Frontend.getQueryStartedEvent ( ) . getListeners ( ) . contains ( this ) ) ) org.ovirt.engine.ui.frontend.Frontend.getQueryStartedEvent ( ) . addListener ( this ) ; if ( ! ( org.ovirt.engine.ui.frontend.Frontend.getQueryCompleteEvent ( ) . getListeners ( ) . contains ( this ) ) ) org.ovirt.engine.ui.frontend.Frontend.getQueryCompleteEvent ( ) . addListener ( this ) ; }
Source:
public void testUpdateAll ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic existingVm2 = dao.get ( FixturesTool.VM_RHEL5_POOL_51 ) ; existingEntity.setStatus ( VMStatus.Down ) ; existingVm2.setIp ( "111" ) ; existingVm2.setFqdn ( "localhost.localdomain" ) ; dao.updateAll ( java.util.Arrays.asList ( existingEntity , existingVm2 ) ) ; org.junit.Assert.assertEquals ( existingEntity , dao.get ( existingEntity.getId ( ) ) ) ; org.junit.Assert.assertEquals ( existingVm2 , dao.get ( existingVm2.getId ( ) ) ) ; }

Target:
public void testUpdateAll ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic existingVm2 = dao.get ( FixturesTool.VM_RHEL5_POOL_51 ) ; existingEntity.setStatus ( VMStatus.Down ) ; existingVm2.setIp ( "111" ) ; existingVm2.setFqdn ( "localhost.localdomain" ) ; dao.updateAll ( java.util.Arrays.asList ( existingEntity , existingVm2 ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( existingEntity , dao.get ( existingEntity.getId ( ) ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( existingVm2 , dao.get ( existingVm2.getId ( ) ) ) ; }
Source:
public void getClusterById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getVmNicList ( 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 ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public static java.lang.String getMessage ( org.ovirt.engine.core.common.AuditLogType logType ) { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.get ( logType ) ; }

Target:
protected static java.lang.String getMessageOrNull ( org.ovirt.engine.core.common.AuditLogType logType ) { final java.lang.String key = logType.name ( ) ; try { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resourceBundle.getString ( key ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( "Key '{}' is not translated in '{}'" , key , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getResourceBundleName ( ) ) ; return null ; } }
Source:
void localize ( ) { vCenterEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vCenter ( ) ) ; esxEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.esxi ( ) ) ; vmwareDatacenterEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vmwareDataCenter ( ) ) ; vmwareClusterEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vmwareCluster ( ) ) ; proxyHostEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.proxyHost ( ) ) ; verifySSLEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vmwareSslVerification ( ) ) ; }

Target:
void localize ( ) { vCenterEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vCenter ( ) ) ; esxEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.esxi ( ) ) ; vmwareDatacenterEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vmwareDataCenter ( ) ) ; vmwareClusterEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vmwareCluster ( ) ) ; proxyHostEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.proxyHost ( ) ) ; verifySSLEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vmwareVerifyServerSslCert ( ) ) ; }
Source:
org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentNotRemoved ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.ovirt.engine.core.compat.Guid networkAttachmentId = networkAttachment.getId ( ) ; if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentInRemoveList = params.getRemovedNetworkAttachments ( ) . contains ( networkAttachmentId ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_ATTACHMENT_IN_BOTH_LISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "NETWORK_ATTACHMENT_IN_BOTH_LISTS_ENTITY" , networkAttachmentId.toString ( ) ) ) . when ( attachmentInRemoveList ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS , networkAttachmentId.toString ( ) ) ) ; }
Source:
public void guestLogoutTimeTreatmentAfterDestroy ( ) { if ( ( ( getGuestLastLoginTime ( ) ) != null ) && ( ( ( getGuestLastLogoutTime ( ) ) == null ) || ( ( getGuestLastLoginTime ( ) . compareTo ( getGuestLastLogoutTime ( ) ) ) > 0 ) ) ) { setGuestLastLogoutTime ( new java.util.Date ( ) ) ; } }

Target:
public void setGuestAgentStatus ( org.ovirt.engine.core.common.businessentities.GuestAgentStatus status ) { vmDynamic.setGuestAgentStatus ( status ) ; }
Source:
public void canDoActionThinProvisioningSpaceCheckFailsSize ( ) { final int availableSize = 4 ; final int usedSize = 6 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; 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 canDoActionSucceedsOnDiskDomainCheckWhenStorageGuidInParamsMatches ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId ) ; mockVmWithDisk ( storageId ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; runAndAssertCanDoActionSuccess ( ) ; }
Source:
public static boolean isActionSupported ( org.ovirt.engine.core.common.action.VdcActionType action , org.ovirt.engine.core.compat.Version version ) { org.ovirt.engine.core.compat.Version minimalVersion = new org.ovirt.engine.core.compat.Version ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getActionGroupDao ( ) . getActionVersionMapByActionType ( action ) . getcluster_minimal_version ( ) ) ; return ( version.compareTo ( minimalVersion ) ) >= 0 ; }

Target:
public static boolean isActionSupported ( org.ovirt.engine.core.common.action.VdcActionType action , org.ovirt.engine.core.compat.Version version ) { org.ovirt.engine.core.compat.Version minimalVersion = new org.ovirt.engine.core.compat.Version ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getActionGroupDao ( ) . getActionVersionMapByActionType ( action ) . getClusterMinimalVersion ( ) ) ; return ( version.compareTo ( minimalVersion ) ) >= 0 ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachDiskFromVm , org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "EntityInfo" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID ) } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
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 ) { 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 ) , getPort ( url , port ) ) , new org.apache.http.auth.UsernamePasswordCredentials ( username , password ) ) ; return client ; }

Target:
private org.apache.http.conn.ClientConnectionManager createPoolingClientConnectionManager ( java.lang.String url , int 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 ; }
Source:
private void setSessionsDetails ( ) { final java.util.List < java.lang.String > sessionStrings = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.EngineSession session : sessions ) { sessionStrings.add ( org.ovirt.engine.core.compat.StringFormat.format ( "%s:%d, %s:%s" , org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . sessionDbId ( ) , session.getId ( ) , org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . userName ( ) , session.getUserName ( ) ) ) ; } setItems ( sessionStrings ) ; }

Target:
private void setSessionsDetails ( ) { final java.util.List < java.lang.String > sessionStrings = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.UserSession session : sessions ) { final long sessionId = session.getId ( ) ; final java.lang.String sessionUserName = session.getUserName ( ) ; final java.lang.String userSessionRow = org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . userSessionRow ( sessionId , sessionUserName ) ; sessionStrings.add ( userSessionRow ) ; } setItems ( sessionStrings ) ; }
Source:
private void analyzeExpression ( org.ovirt.api.metamodel.analyzer.MethodExpression expression , java.util.List < org.ovirt.api.metamodel.concepts.Parameter > parameters ) { boolean mandatory = isMandatory ( expression ) ; expression = removePrefix ( expression ) ; if ( expression.getMethod ( ) . equals ( org.ovirt.api.metamodel.analyzer.InputDetailAnalyzer.OR ) ) { analyzeOrExpression ( expression , parameters , mandatory ) ; } else { analyzeExpression ( expression , parameters , mandatory ) ; } }

Target:
private void analyzeExpression ( org.ovirt.api.metamodel.analyzer.MethodExpression expression , java.util.List < org.ovirt.api.metamodel.concepts.Parameter > parameters ) { if ( expression.getMethod ( ) . equals ( org.ovirt.api.metamodel.analyzer.InputDetailAnalyzer.OR ) ) { analyzeOrExpression ( expression , parameters ) ; } else { boolean mandatory = isMandatory ( expression ) ; expression = getMethodExpression ( removePrefix ( expression ) ) ; analyzeExpression ( expression , parameters , mandatory ) ; } }
Source:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public void getStorageDomainList ( 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.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void testGetEntityNameByIdAndTypeForDataCenter ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = dbFacade.getStoragePoolDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDaoTest.STORAGE_POOL_ID ) ; org.junit.Assert.assertNotNull ( storagePool ) ; java.lang.String name = storagePool.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDaoTest.STORAGE_POOL_ID , VdcObjectType.StoragePool ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForDataCenter ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = dbFacade.getStoragePoolDao ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.STORAGE_POOL_ID ) ; org.junit.Assert.assertNotNull ( storagePool ) ; java.lang.String name = storagePool.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.STORAGE_POOL_ID , VdcObjectType.StoragePool ) ) ) ; }
Source:
private java.lang.String getMemoryVolumeFromActiveSnapshotInExportDomain ( ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { if ( ( snapshot.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.ACTIVE ) ) return snapshot.getMemoryVolume ( ) ; } org.ovirt.engine.core.bll.ImportVmCommand.log.warnFormat ( "VM {0} doesn't have active snapshot in export domain" , getVmId ( ) ) ; return org.apache.commons.lang.StringUtils.EMPTY ; }

Target:
private java.lang.String getMemoryVolumeFromActiveSnapshotInExportDomain ( ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; if ( activeSnapshot != null ) { return activeSnapshot.getMemoryVolume ( ) ; } return org.apache.commons.lang.StringUtils.EMPTY ; }
Source:
public void testBootProtocolSetForDisplayNetworkWhenIpConfigurationIsNull ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( true , network , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenIpConfigurationIsNull ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , true , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }
Source:
public boolean isQualifiedForSnapshotMerge ( ) { return ( ( ( ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringUp ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.RebootInProgress ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ; }

Target:
public boolean isQualifiedForSnapshotMerge ( ) { return ( isQualifiedForLiveSnapshotMerge ( ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel object ) { driver.edit ( object ) ; initLists ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( propName.equals ( "IsValid" ) ) { onIsValidPropertyChange ( object ) ; } } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase object ) { driver.edit ( object ) ; initLists ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( propName.equals ( "IsValid" ) ) { onIsValidPropertyChange ( object ) ; } } } ) ; }
Source:
public void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
private static int getNextImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( images.get ( i ) . getParentId ( ) . equals ( curr.getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
public void setExecutionContext ( org.ovirt.engine.core.bll.job.ExecutionContext executionContext ) { super . setExecutionContext ( executionContext ) ; }
Source:
public void flushToPrivateModel ( ) { flushCheckBoxes ( ctrlAltDel , enableUsbAutoshare , openInFullScreen , enableSpiceProxy , useLocalDrives , wanEnabled , disableSmartcard ) ; if ( spiceRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.SPICE ) ; } else if ( remoteDesktopRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.RDP ) ; } else if ( vncRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.VNC ) ; } }

Target:
public void flushToPrivateModel ( ) { flushCheckBoxes ( ctrlAltDel , enableUsbAutoshare , openInFullScreen , enableSpiceProxy , useLocalDrives , wanEnabled , disableSmartcard ) ; if ( spiceRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.SPICE ) ; setSelectedSpiceImpl ( ) ; } else if ( remoteDesktopRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.RDP ) ; } else if ( vncRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.VNC ) ; } }
Source:
public void setVersion ( org.ovirt.engine.core.compat.RpmVersion value ) { mVdsDynamic.setVersion ( value ) ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "Version" ) ) ; }

Target:
public void calculateFreeVirtualMemory ( ) { if ( ( ( ( getmem_commited ( ) ) != null ) && ( ( getphysical_mem_mb ( ) ) != null ) ) && ( ( getreserved_mem ( ) ) != null ) ) { maxSchedulingMemory = ( ( ( getmax_vds_memory_over_commit ( ) ) * ( getphysical_mem_mb ( ) ) ) / 100.0F ) - ( ( getmem_commited ( ) ) + ( getreserved_mem ( ) ) ) ; maxSchedulingMemory = ( ( maxSchedulingMemory ) > 0 ) ? maxSchedulingMemory : 0 ; } }