auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId , filterOutExistingHosts , searchFilter ) , aQuery ) ; }

Target:
public static void GetExternalNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { 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.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }
Source:
private static org.ovirt.engine.api.model.Tag parent ( org.ovirt.engine.core.common.businessentities.Tags entity ) { if ( ( entity.getparent_id ( ) ) != null ) { org.ovirt.engine.api.model.Tag parent = new org.ovirt.engine.api.model.Tag ( ) ; parent.setId ( entity.getparent_id ( ) . toString ( ) ) ; return parent ; } else { return null ; } }

Target:
private static org.ovirt.engine.api.model.Tag parent ( org.ovirt.engine.core.common.businessentities.Tags entity ) { if ( ( entity.getParentId ( ) ) != null ) { org.ovirt.engine.api.model.Tag parent = new org.ovirt.engine.api.model.Tag ( ) ; parent.setId ( entity.getParentId ( ) . toString ( ) ) ; return parent ; } else { return null ; } }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getHosts ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.VDS host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; host.setStatus ( VDSStatus.Up ) ; hosts.add ( host ) ; return hosts ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getHosts ( ) { org.ovirt.engine.core.common.businessentities.VDS host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; host.setStatus ( VDSStatus.Up ) ; return java.util.Collections.singletonList ( host ) ; }
Source:
public void testAddStorageDomainNoHost ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.StorageDomain model = org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "StorageDomain" , "add" , "host.id|name" ) ; } }

Target:
public void testAddStorageDomainNoHost ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.StorageDomain model = org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "StorageDomain" , "add" , "host.id|name" ) ; } }
Source:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResourceTest.TEMPLATE_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResourceTest.TEMPLATE_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: get ) ) ; }
Source:
public org.ovirt.engine.core.utils.ovf.xml.XmlNode SelectSingleNode ( java.lang.String string ) { try { javax.xml.xpath.XPathFactory factory = javax.xml.xpath.XPathFactory.newInstance ( ) ; javax.xml.xpath.XPath xPath = factory.newXPath ( ) ; java.lang.Object o = xPath.evaluate ( string , node , javax.xml.xpath.XPathConstants.NODE ) ; if ( o != null ) { return new org.ovirt.engine.core.utils.ovf.xml.XmlNode ( ( ( org.w3c.dom.Node ) ( o ) ) ) ; } return null ; } catch ( javax.xml.xpath.XPathExpressionException e ) { throw new java.lang.RuntimeException ( ( "Failed to evaluate xpath: " + string ) , e ) ; } }

Target:
public org.ovirt.engine.core.utils.ovf.xml.XmlNode selectSingleNode ( java.lang.String string ) { try { javax.xml.xpath.XPathFactory factory = javax.xml.xpath.XPathFactory.newInstance ( ) ; javax.xml.xpath.XPath xPath = factory.newXPath ( ) ; java.lang.Object o = xPath.evaluate ( string , node , javax.xml.xpath.XPathConstants.NODE ) ; if ( o != null ) { return new org.ovirt.engine.core.utils.ovf.xml.XmlNode ( ( ( org.w3c.dom.Node ) ( o ) ) ) ; } return null ; } catch ( javax.xml.xpath.XPathExpressionException e ) { throw new java.lang.RuntimeException ( ( "Failed to evaluate xpath: " + string ) , e ) ; } }
Source:
public static void getGlusterVolumeOptionInfoList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeOptionsInfo , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.dao.StorageDomainStaticDAO getStorageDomainStaticDAO ( ) { return org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainStaticDao ( ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; if ( ! ( qRetVal.getSucceeded ( ) ) ) { return null ; } return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( qRetVal.getReturnValue ( ) ) ) ; }
Source:
protected void loadPolicyUnits ( ) { java.util.List < org.ovirt.engine.core.common.scheduling.PolicyUnit > allPolicyUnits = getPolicyUnitDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : allPolicyUnits ) { if ( policyUnit.isInternal ( ) ) { policyUnits.put ( policyUnit.getId ( ) , org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.getPolicyUnitImpl ( policyUnit , getPendingResourceManager ( ) ) ) ; } else { policyUnits.put ( policyUnit.getId ( ) , new org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl ( policyUnit , getPendingResourceManager ( ) ) ) ; } } }

Target:
private void loadPolicyUnits ( ) { java.util.List < org.ovirt.engine.core.common.scheduling.PolicyUnit > allPolicyUnits = getPolicyUnitDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : allPolicyUnits ) { if ( policyUnit.isInternal ( ) ) { policyUnits.put ( policyUnit.getId ( ) , org.ovirt.engine.core.di.Injector.injectMembers ( org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.getPolicyUnitImpl ( policyUnit , getPendingResourceManager ( ) ) ) ) ; } else { policyUnits.put ( policyUnit.getId ( ) , new org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl ( policyUnit , getPendingResourceManager ( ) ) ) ; } } }
Source:
public static java.lang.String map ( org.ovirt.engine.core.common.businessentities.VdsProtocol protocol , java.lang.String template ) { java.lang.String result = null ; if ( protocol != null ) { switch ( protocol ) { case STOMP : result = VdsProtocol.STOMP.value ( ) ; break ; case AMQP : result = VdsProtocol.AMQP.value ( ) ; break ; case XML : default : result = VdsProtocol.XML.value ( ) ; break ; } } return result ; }

Target:
public static org.ovirt.engine.api.model.SpmState map ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus entityStatus , org.ovirt.engine.api.model.SpmState template ) { switch ( entityStatus ) { case None : return org.ovirt.engine.api.model.SpmState.NONE ; case Contending : return org.ovirt.engine.api.model.SpmState.CONTENDING ; case SPM : return org.ovirt.engine.api.model.SpmState.SPM ; default : return null ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.VDS checkForActiveVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getVdsDAO ( ) . getAllForStoragePoolAndStatus ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) . getId ( ) , VDSStatus.Up ) ; if ( ! ( hosts.isEmpty ( ) ) ) { return hosts.get ( new java.util.Random ( ) . nextInt ( hosts.size ( ) ) ) ; } addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NO_VDS_IN_POOL ) ; return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDS checkForActiveVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getVdsDao ( ) . getAllForStoragePoolAndStatus ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) . getId ( ) , VDSStatus.Up ) ; if ( ! ( hosts.isEmpty ( ) ) ) { return hosts.get ( new java.util.Random ( ) . nextInt ( hosts.size ( ) ) ) ; } addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NO_VDS_IN_POOL ) ; return null ; }
Source:
public static org.ovirt.engine.core.common.businessentities.LdapUser getUserByUserGuid ( org.ovirt.engine.core.compat.Guid userGuid ) { org.ovirt.engine.core.common.businessentities.LdapUser retVal = null ; org.ovirt.engine.core.common.businessentities.DbUser dbUser = org.ovirt.engine.core.bll.adbroker.InternalBrokerUtils.getDbUserDAO ( ) . get ( userGuid ) ; if ( dbUser != null ) { retVal = new org.ovirt.engine.core.common.businessentities.LdapUser ( dbUser ) ; } return retVal ; }

Target:
public static org.ovirt.engine.core.common.businessentities.LdapUser getUserById ( org.ovirt.engine.core.common.utils.ExternalId id ) { org.ovirt.engine.core.common.businessentities.LdapUser retVal = null ; org.ovirt.engine.core.common.businessentities.DbUser dbUser = org.ovirt.engine.core.bll.adbroker.InternalBrokerUtils.getDbUserDAO ( ) . getByExternalId ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.AdminDomain ) , id ) ; if ( dbUser != null ) { retVal = new org.ovirt.engine.core.common.businessentities.LdapUser ( dbUser ) ; } return retVal ; }
Source:
private void onExportDomainChosen ( ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dataCenters.getSelectedItem ( ) ; startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenter.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , createGetStorageDomainsByStoragePoolIdCallback ( dataCenter ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dataCenters.getSelectedItem ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenter.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , createGetStorageDomainsByStoragePoolIdCallback ( dataCenter ) ) ) ; }
Source:
public static void GetRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void onSuccess ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Frontend: sucessfully executed runAction, determining result!" ) ; handleActionResult ( actionType , parameters , result , ( callback != null ? callback : org.ovirt.engine.ui.frontend.Frontend.NULLABLE_ASYNC_CALLBACK ) , state , showErrorDialog ) ; org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , state ) ; org.ovirt.engine.ui.frontend.communication.RefreshActiveModelEvent.fire ( this , true ) ; }

Target:
public void onAsyncOperationComplete ( org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent event ) { if ( ( event.isAction ( ) ) && ( event.isSuccess ( ) ) ) { org.ovirt.engine.ui.frontend.communication.RefreshActiveModelEvent.fire ( this , true ) ; } }
Source:
protected java.util.List < java.lang.Class < ? > > getValidationGroups ( ) { if ( ( org.ovirt.engine.core.bll.VmManagementCommandBase.getParameters ( ) . getVmStaticData ( ) . getVmType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) { org.ovirt.engine.core.bll.VmManagementCommandBase.addValidationGroup ( org.ovirt.engine.core.common.validation.group.DesktopVM.class ) ; } return super . getValidationGroups ( ) ; }

Target:
protected boolean isVmWithSameNameExists ( java.lang.String name ) { return org.ovirt.engine.core.bll.VmHandler.isVmWithSameNameExistStatic ( name ) ; }
Source:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getMaxNumOfCPUsPerSocket ( 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.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.storage.DisksAllocationModel model ) { driver.edit ( model ) ; initListeners ( model ) ; updateColumnsAvailability ( model ) ; updateListHeader ( model ) ; }

Target:
private java.lang.String calculateColumnWidthPercentage ( ) { int columnCount = 2 ; if ( showVolumeType ) { columnCount ++ ; } if ( showVolumeFormat ) { columnCount ++ ; } if ( showSource ) { columnCount ++ ; } if ( showTarget ) { columnCount ++ ; } columnCount ++ ; if ( showQuota ) { columnCount ++ ; } double columnPercentage = 100.0F / columnCount ; return java.lang.String.valueOf ( columnPercentage ) ; }
Source:
protected void itemsChanged ( ) { super . itemsChanged ( ) ; if ( ( getItems ( ) ) != null ) { for ( java.lang.Object item : getItems ( ) ) { org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel ) ( item ) ) ; model.setContainer ( this ) ; if ( item instanceof org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) { org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel nfsModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) ( item ) ) ; nfsModel.getPathChangedEvent ( ) . addListener ( this ) ; } } } }

Target:
protected void storageItemsChanged ( ) { if ( ( getItems ( ) ) != null ) { for ( java.lang.Object item : getItems ( ) ) { org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel ) ( item ) ) ; model.setContainer ( this ) ; if ( item instanceof org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) { org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel nfsModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) ( item ) ) ; nfsModel.getPathChangedEvent ( ) . addListener ( this ) ; } } } }
Source:
public void saveOrUpdateWithoutTransaction ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }

Target:
public void saveOrUpdateWithoutTransaction ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { commandEntityDao.saveOrUpdate ( cmdEntity ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }
Source:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , getPrincipalName ( sessionId ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.AUTH_RECORD_PARAMETER_NAME , false ) ) ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.PRINCIPAL_RECORD_PARAMETER_NAME , false ) ) ) , message , msgArgs ) ; getDbFacade ( ) . getEngineSessionDao ( ) . remove ( getEngineSessionSeqId ( sessionId ) ) ; sessionInfoMap.remove ( sessionId ) ; }

Target:
public org.ovirt.engine.core.aaa.AuthenticationProfile getProfile ( java.lang.String sessionId ) { org.ovirt.engine.core.aaa.AuthenticationProfile profile = ( ( org.ovirt.engine.core.aaa.AuthenticationProfile ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.PROFILE_PARAMETER_NAME , false ) ) ) ; if ( profile == null ) { profile = getProfileFromUser ( getUser ( sessionId , false ) ) ; } return profile ; }
Source:
protected void build ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VmBase vm ) { org.ovirt.engine.core.common.businessentities.VDS defaultHost = model.getDefaultHost ( ) . getSelectedItem ( ) ; if ( model.getIsAutoAssign ( ) . getEntity ( ) ) { vm.setDedicatedVmForVds ( null ) ; } else { vm.setDedicatedVmForVds ( defaultHost.getId ( ) ) ; } }

Target:
protected void build ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VmBase vm ) { org.ovirt.engine.core.common.businessentities.VDS defaultHost = model.getDefaultHost ( ) . getSelectedItem ( ) ; if ( model.getIsAutoAssign ( ) . getEntity ( ) ) { vm.setDedicatedVmForVdsList ( java.util.Collections.< org.ovirt.engine.core.compat.Guid > emptyList ( ) ) ; } else { vm.setDedicatedVmForVdsList ( defaultHost.getId ( ) ) ; } }
Source:
private void assertGeneratesCorrect ( int maxNameLengt , int poolNameLength , int expectedMaxNumOfVms ) { org.ovirt.engine.ui.uicommonweb.validation.ExistingPoolNameLengthValidation validation = new org.ovirt.engine.ui.uicommonweb.validation.ExistingPoolNameLengthValidation ( "" , 0 , org.ovirt.engine.core.common.businessentities.VmOsType.Other ) ; int res = validation.doGenerateMaxLength ( maxNameLengt , poolNameLength ) ; org.junit.Assert.assertThat ( res , org.hamcrest.core.Is.is ( org.hamcrest.core.IsEqual.equalTo ( expectedMaxNumOfVms ) ) ) ; }

Target:
private void assertGeneratesCorrect ( int maxNameLengt , int poolNameLength , int expectedMaxNumOfVms ) { org.ovirt.engine.ui.uicommonweb.validation.ExistingPoolNameLengthValidation validation = new org.ovirt.engine.ui.uicommonweb.validation.ExistingPoolNameLengthValidation ( "" , 0 , org.ovirt.engine.core.common.osinfo.OsRepository.DEFAULT_OS ) ; int res = validation.doGenerateMaxLength ( maxNameLengt , poolNameLength ) ; org.junit.Assert.assertThat ( res , org.hamcrest.core.Is.is ( org.hamcrest.core.IsEqual.equalTo ( expectedMaxNumOfVms ) ) ) ; }
Source:
protected void executeCommand ( ) { boolean succeeded = false ; try { java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > vmNumaNodes = org.ovirt.engine.core.bll.numa.vm.RemoveVmNumaNodesCommand.getParameters ( ) . getVmNumaNodeList ( ) ; java.util.List < org.ovirt.engine.core.compat.Guid > guids = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmNumaNode node : vmNumaNodes ) { guids.add ( node.getId ( ) ) ; } org.ovirt.engine.core.bll.numa.vm.RemoveVmNumaNodesCommand.getDbFacade ( ) . getVmNumaNodeDAO ( ) . massRemoveNumaNodeByNumaNodeId ( guids ) ; succeeded = true ; } finally { org.ovirt.engine.core.bll.numa.vm.RemoveVmNumaNodesCommand.setSucceeded ( succeeded ) ; } }

Target:
protected void executeCommand ( ) { boolean succeeded = false ; try { java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > vmNumaNodes = org.ovirt.engine.core.bll.numa.vm.RemoveVmNumaNodesCommand.getParameters ( ) . getVmNumaNodeList ( ) ; java.util.List < org.ovirt.engine.core.compat.Guid > guids = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmNumaNode node : vmNumaNodes ) { guids.add ( node.getId ( ) ) ; } org.ovirt.engine.core.bll.numa.vm.RemoveVmNumaNodesCommand.getVmNumaNodeDao ( ) . massRemoveNumaNodeByNumaNodeId ( guids ) ; succeeded = true ; } finally { org.ovirt.engine.core.bll.numa.vm.RemoveVmNumaNodesCommand.setSucceeded ( succeeded ) ; } }
Source:
public void canDoActionSucceedsOnDiskDomainCheckWhenStorageGuidInParamsMismatches ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId ) ; mockVmWithDisk ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void validateSucceedsOnDiskDomainCheckWhenStorageGuidInParamsMismatches ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId ) ; mockVmWithDisk ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }
Source:
public void qosOverridden ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_4 ) ; validateAndAssertQosOverridden ( helper , iface ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
public void qosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; iface.setQos ( createQos ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void networkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( "network" ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , "network" ) ; mockExistingIfaces ( nic ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNoChanges ( helper ) ; }
Source:
public void testAllByConnectionId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = dao.getAllByConnectionId ( new org.ovirt.engine.core.compat.Guid ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ) ; org.junit.Assert.assertEquals ( "Unexpected number of storage domains by connection id" , 1 , domains.size ( ) ) ; org.junit.Assert.assertEquals ( "Wrong storage domain id for search by connection id" , FixturesTool.STORAGE_DOAMIN_NFS_MASTER , domains.get ( 0 ) . getId ( ) ) ; }

Target:
public void testAllByConnectionId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = dao.getAllByConnectionId ( new org.ovirt.engine.core.compat.Guid ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ) ; org.junit.Assert.assertEquals ( "Unexpected number of storage domains by connection id" , 1 , domains.size ( ) ) ; org.junit.Assert.assertEquals ( "Wrong storage domain id for search by connection id" , FixturesTool.STORAGE_DOMAIN_NFS_MASTER , domains.get ( 0 ) . getId ( ) ) ; }
Source:
public boolean checkQuotaNameExisting ( org.ovirt.engine.core.common.businessentities.Quota quota , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.common.businessentities.Quota quotaByName = getQuotaDao ( ) . getQuotaByQuotaName ( quota.getQuotaName ( ) ) ; if ( ( quotaByName != null ) && ( ! ( quotaByName.getId ( ) . equals ( quota.getId ( ) ) ) ) ) { messages.add ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED.toString ( ) ) ; return false ; } return true ; }

Target:
public boolean validateQuotaNameIsUnique ( org.ovirt.engine.core.common.businessentities.Quota quota ) { org.ovirt.engine.core.common.businessentities.Quota quotaByName = getQuotaDao ( ) . getQuotaByQuotaName ( quota.getQuotaName ( ) , quota.getStoragePoolId ( ) ) ; if ( ( quotaByName != null ) && ( ! ( quotaByName.getId ( ) . equals ( quota.getId ( ) ) ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ; return false ; } return true ; }
Source:
public static void IsHotPlugAvailable ( 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 tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.HotPlugEnabled ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
private static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > getClusterByServiceList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list , boolean supportsVirtService , boolean supportsGlusterService ) { final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : list ) { if ( ( supportsVirtService && ( cluster.supportsVirtService ( ) ) ) || ( supportsGlusterService && ( cluster.supportsGlusterService ( ) ) ) ) { filteredList.add ( cluster ) ; } } java.util.Collections.sort ( filteredList , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return filteredList ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { lockInteractionManager.hideLoadingIndicator ( ) ; formatAndSetErrorMessage ( loginModel.getMessage ( ) ) ; org.ovirt.engine.ui.common.presenter.AbstractLoginPresenterWidget.logger.warning ( ( ( "Login failed for user [" + ( loginModel.getUserName ( ) . getEntity ( ) ) ) + "]" ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { lockInteractionManager.hideLoadingIndicator ( ) ; formatAndSetErrorMessage ( loginModel.getMessages ( ) ) ; org.ovirt.engine.ui.common.presenter.AbstractLoginPresenterWidget.logger.warning ( ( ( "Login failed for user [" + ( loginModel.getUserName ( ) . getEntity ( ) ) ) + "]" ) ) ; }
Source:
public void perform ( ) { if ( ( this . manager.isMonitoringNeeded ( ) ) && ( getRefreshStatistics ( ) ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( this . manager ) ; fetcher.fetch ( ) ; new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( this . manager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , this . auditLogDirector ) . perform ( ) ; } }

Target:
public void perform ( ) { if ( ( this . manager.isMonitoringNeeded ( ) ) && ( getRefreshStatistics ( ) ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( this . manager ) ; fetcher.fetch ( ) ; new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( this . manager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , this . auditLogDirector , java.lang.System.nanoTime ( ) ) . perform ( ) ; } }
Source:
protected boolean validateQuota ( ) { getParameters ( ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVmTemplate ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage di : getParameters ( ) . getImages ( ) ) { di.setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVmTemplate ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; } return true ; }

Target:
private java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > getStorageQuotaListParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getParameters ( ) . getImages ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( disk.getQuotaId ( ) , imageToDestinationDomainMap.get ( disk.getId ( ) ) , disk.getSizeInGigabytes ( ) ) ) ; } return list ; }
Source:
private void mockAvailableMacsInRange ( java.util.List < org.ovirt.engine.core.bll.network.macpoolmanager.Range > ranges , java.util.List < java.lang.Integer > rangesWithoutAvailableMacs ) { for ( int i = 0 ; i < ( ranges.size ( ) ) ; i ++ ) { org.ovirt.engine.core.bll.network.macpoolmanager.Range range = ranges.get ( i ) ; boolean shouldBeEmpty = rangesWithoutAvailableMacs.contains ( i ) ; org.mockito.Mockito.when ( range.getAvailableCount ( ) ) . thenReturn ( ( shouldBeEmpty ? 0 : 1 ) ) ; } }

Target:
private void mockAvailableMacsInRange ( java.util.List < org.ovirt.engine.core.bll.network.macpool.Range > ranges , java.util.List < java.lang.Integer > rangesWithoutAvailableMacs ) { for ( int i = 0 ; i < ( ranges.size ( ) ) ; i ++ ) { org.ovirt.engine.core.bll.network.macpool.Range range = ranges.get ( i ) ; boolean shouldBeEmpty = rangesWithoutAvailableMacs.contains ( i ) ; org.mockito.Mockito.when ( range.getAvailableCount ( ) ) . thenReturn ( ( shouldBeEmpty ? 0 : 1 ) ) ; } }
Source:
public void testReorderMacAddresses ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.ReorderVmNics , org.ovirt.engine.core.common.action.VmOperationParameterBase.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; verifyActionResponse ( resource.reorderMacAddresses ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testReorderMacAddresses ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.ReorderVmNics , org.ovirt.engine.core.common.action.VmOperationParameterBase.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; verifyActionResponse ( resource.reorderMacAddresses ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
public void failRunStatelessHA_VM ( ) { canRunVmAsStateless ( true , false , true , true , false , EngineMessage.VM_CANNOT_RUN_STATELESS_HA ) ; canRunVmAsStateless ( true , false , true , null , false , EngineMessage.VM_CANNOT_RUN_STATELESS_HA ) ; canRunVmAsStateless ( true , false , false , true , false , EngineMessage.VM_CANNOT_RUN_STATELESS_HA ) ; }

Target:
public void failRunStatelessHaVm ( ) { canRunVmAsStateless ( true , false , true , true , false , EngineMessage.VM_CANNOT_RUN_STATELESS_HA ) ; canRunVmAsStateless ( true , false , true , null , false , EngineMessage.VM_CANNOT_RUN_STATELESS_HA ) ; canRunVmAsStateless ( true , false , false , true , false , EngineMessage.VM_CANNOT_RUN_STATELESS_HA ) ; }
Source:
public void testAddTag ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.Tags tagFromDirector = tagsDirector.GetTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNull ( tagFromDirector ) ; tagsDirector.AddTag ( tag ) ; tagFromDirector = tagsDirector.GetTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNotNull ( tagFromDirector ) ; org.junit.Assert.assertEquals ( tag , tagFromDirector ) ; }

Target:
public void testAddTag ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.Tags tagFromDirector = tagsDirector.GetTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNull ( tagFromDirector ) ; tagsDirector.addTag ( tag ) ; tagFromDirector = tagsDirector.GetTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNotNull ( tagFromDirector ) ; org.junit.Assert.assertEquals ( tag , tagFromDirector ) ; }
Source:
public boolean flush ( ) { if ( validate ( ) ) { diskModel.flush ( ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getDiskModel ( ) . getDisk ( ) ) ) . setVolumeFormat ( getVolumeFormat ( ) . getSelectedItem ( ) ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getDiskModel ( ) . getDisk ( ) ) ) . setActualSizeInBytes ( getImageSize ( ) ) ; return true ; } return false ; }

Target:
public boolean flush ( ) { if ( validate ( ) ) { diskModel.flush ( ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getDiskModel ( ) . getDisk ( ) ) ) . setVolumeFormat ( getVolumeFormat ( ) . getSelectedItem ( ) ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getDiskModel ( ) . getDisk ( ) ) ) . setActualSizeInBytes ( getImageSize ( ) ) ; return true ; } else { setIsValid ( false ) ; } return false ; }
Source:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }

Target:
public java.lang.Integer getMaxIoThreadsPerVm ( ) { return ( ( java.lang.Integer ) ( getConfigValuePreConverted ( ConfigurationValues.MaxIoThreadsPerVm ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult checkStoragePoolNotInStatus ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus ... statuses ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePoolStatus > statusList = java.util.Arrays.asList ( statuses ) ; if ( ! ( statusList.contains ( storagePool.getStatus ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isInStatus ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus ... statuses ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePoolStatus > statusList = java.util.Arrays.asList ( statuses ) ; if ( ! ( statusList.contains ( storagePool.getStatus ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > filteredStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : storageDomains ) { if ( ( a.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { filteredStorageDomains.add ( a ) ; } } vmListModel.PostExportGetStorageDomainList ( filteredStorageDomains ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > filteredStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : storageDomains ) { if ( ( a.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { filteredStorageDomains.add ( a ) ; } } vmListModel.PostExportGetStorageDomainList ( filteredStorageDomains ) ; }
Source:
private void createVDS ( ) { vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( vdsId ) ; vds.setVdsName ( "TestVDS" ) ; vds.setStoragePoolId ( storagePoolId ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setSpmStatus ( VdsSpmStatus.None ) ; vds.setVdsSpmPriority ( 10 ) ; }

Target:
private void createVDSandStoragePool ( ) { vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( vdsId ) ; vds.setVdsName ( "TestVDS" ) ; vds.setStoragePoolId ( storagePoolId ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setSpmStatus ( VdsSpmStatus.None ) ; vds.setVdsSpmPriority ( 10 ) ; storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.VmTemplate.name ( ) . toLowerCase ( ) , ( ( getVmTemplateName ( ) ) == null ? "" : getVmTemplateName ( ) ) ) ; } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; jobProperties.put ( VdcObjectType.VmTemplate.name ( ) . toLowerCase ( ) , ( ( getVmTemplateName ( ) ) == null ? "" : getVmTemplateName ( ) ) ) ; jobProperties.put ( VdcObjectType.StoragePool.name ( ) . toLowerCase ( ) , getStoragePoolName ( ) ) ; } return jobProperties ; }
Source:
public void setIsDatacenterAvailable ( java.lang.Boolean value ) { if ( ( ( isDatacenterAvailable ) == null ) && ( value == null ) ) { return ; } if ( ( ( isDatacenterAvailable ) == null ) || ( ! ( isDatacenterAvailable.equals ( value ) ) ) ) { isDatacenterAvailable = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "IsDatacenterAvailable" ) ) ; } }

Target:
public void setIsCustomPropertiesTabAvailable ( boolean value ) { if ( ( isCustomPropertiesTabAvailable ) != value ) { isCustomPropertiesTabAvailable = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsCustomPropertiesTabAvailable" ) ) ; } }