auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder message = new java.lang.StringBuilder ( "EngineLock [exclusiveLocks= " ) ; buildEntryStrings ( exclusiveLocks , message ) ; message.append ( ", sharedLocks= " ) ; buildEntryStrings ( sharedLocks , message ) ; message.append ( "]" ) ; return message.toString ( ) ; }

Target:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "exclusiveLocks" , exclusiveLocks ) . append ( "sharedLocks" , sharedLocks ) . build ( ) ; }
Source:
protected < T extends org.ovirt.engine.core.dao.DAO > T getDao ( java.lang.Class < T > daoType ) { T dao = org.ovirt.engine.core.dao.DaoFactory.get ( daoType ) ; if ( dao instanceof org.ovirt.engine.core.dao.BaseDAODbFacade ) { org.ovirt.engine.core.dao.BaseDAODbFacade dbFacadeDAO = ( ( org.ovirt.engine.core.dao.BaseDAODbFacade ) ( dao ) ) ; dbFacadeDAO.setTemplate ( jdbcTemplate ) ; dbFacadeDAO.setDialect ( dbEngineDialect ) ; dbFacadeDAO.setDbFacade ( this ) ; } return dao ; }

Target:
public org.springframework.jdbc.core.JdbcTemplate getJdbcTemplate ( ) { return jdbcTemplate ; }
Source:
public void rollback ( ) { log.error ( "Transaction rolled-back for command '{}'." , this . getClass ( ) . getName ( ) ) ; try { if ( isQuotaDependant ( ) ) { rollbackQuota ( ) ; } } catch ( java.lang.NullPointerException e ) { log.error ( "RollbackQuota: failed (may be because quota is disabled)" , e ) ; } cancelTasks ( ) ; }

Target:
protected void persistCommandIfNeeded ( ) { if ( ( ( getCallback ( ) ) != null ) || ( parentHasCallback ( ) ) ) { persistCommand ( getParameters ( ) . getParentCommand ( ) ) ; } }
Source:
public void testGetAllForStorageDomainFull ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > result = dao.getAllForStorageDomain ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 2 , result.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile diskProfile : result ) { org.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 , diskProfile.getStorageDomainId ( ) ) ; } }

Target:
private void testAllQosValuesEqualToNull ( boolean isAllNull ) { boolean allValues = true ; java.util.List < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > allForStorageDomain = dao.getAllForStorageDomain ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 ) ; org.junit.Assert.assertNotNull ( allForStorageDomain ) ; org.junit.Assert.assertFalse ( allForStorageDomain.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile diskProfile : allForStorageDomain ) { allValues &= ( diskProfile.getQosId ( ) ) == null ; } org.junit.Assert.assertEquals ( isAllNull , allValues ) ; }
Source:
public void testImportVMFromConfigurationWhenStorageDomainIsInactive ( ) { initCommand ( getOvfEntityData ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = createStorageDomain ( ) ; storageDomain.setStatus ( StorageDomainStatus.Inactive ) ; org.mockito.Mockito.when ( validator.validateUnregisteredEntity ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.IVdcQueryable.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.OvfEntityData.class ) , org.mockito.Matchers.anyList ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; }

Target:
public void testImportVMFromConfigurationWhenStorageDomainIsInactive ( ) { initCommand ( getOvfEntityData ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = createStorageDomain ( ) ; storageDomain.setStatus ( StorageDomainStatus.Inactive ) ; org.mockito.Mockito.when ( validator.validateUnregisteredEntity ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.IVdcQueryable.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.OvfEntityData.class ) , org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; }
Source:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOAMIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertSame ( listOfRepoFiles.isEmpty ( ) , true ) ; org.ovirt.engine.core.common.businessentities.RepoFileMetaData newRepoFileMap = org.ovirt.engine.core.dao.RepoFileMetaDataDAOTest.getNewIsoRepoFile ( ) ; repoFileMetaDataDao.addRepoFileMap ( newRepoFileMap ) ; listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOAMIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.Assert.assertSame ( listOfRepoFiles.isEmpty ( ) , false ) ; }

Target:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOAMIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertSame ( listOfRepoFiles.isEmpty ( ) , true ) ; org.ovirt.engine.core.common.businessentities.RepoImage newRepoFileMap = org.ovirt.engine.core.dao.RepoFileMetaDataDAOTest.getNewIsoRepoFile ( ) ; repoFileMetaDataDao.addRepoFileMap ( newRepoFileMap ) ; listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOAMIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.Assert.assertSame ( listOfRepoFiles.isEmpty ( ) , false ) ; }
Source:
protected org.ovirt.engine.api.model.GlusterBrick addParents ( org.ovirt.engine.api.model.GlusterBrick glusterBrick ) { org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterBrickResourceTest.clusterId.toString ( ) ) ; org.ovirt.engine.api.model.GlusterVolume volume = new org.ovirt.engine.api.model.GlusterVolume ( ) ; volume.setId ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterBrickResourceTest.volumeId.toString ( ) ) ; volume.setCluster ( cluster ) ; glusterBrick.setGlusterVolume ( volume ) ; return glusterBrick ; }

Target:
protected org.ovirt.engine.api.model.GlusterBrick addParents ( org.ovirt.engine.api.model.GlusterBrick glusterBrick ) { org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.clusterId.toString ( ) ) ; org.ovirt.engine.api.model.GlusterVolume volume = new org.ovirt.engine.api.model.GlusterVolume ( ) ; volume.setId ( org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.volumeId.toString ( ) ) ; volume.setCluster ( cluster ) ; glusterBrick.setGlusterVolume ( volume ) ; return glusterBrick ; }
Source:
public void updateAllInBatch ( java.lang.String procedureName , java.util.Collection < T > paramValues , org.ovirt.engine.core.dal.dbbroker.EntityToMapSqlParameterMapper < T > mapper ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > sqlParams = new java.util.ArrayList < > ( ) ; for ( T param : paramValues ) { sqlParams.add ( mapper.map ( param ) ) ; } org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getCallsHandler ( ) . executeStoredProcAsBatch ( ( procedureName == null ? org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) : procedureName ) , sqlParams ) ; }

Target:
public void updateAllInBatch ( java.lang.String procedureName , java.util.Collection < T > paramValues , org.ovirt.engine.core.dal.dbbroker.MapSqlParameterMapper < T > mapper ) { org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getCallsHandler ( ) . executeStoredProcAsBatch ( ( procedureName == null ? org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) : procedureName ) , paramValues , mapper ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.Network n ) { return ( ( n.getname ( ) . trim ( ) . toLowerCase ( ) . equals ( getNetworkName ( ) . trim ( ) . toLowerCase ( ) ) ) && ( ! ( n.getId ( ) . equals ( getNetwork ( ) . getId ( ) ) ) ) ) && ( getNetwork ( ) . getstorage_pool_id ( ) . equals ( n.getstorage_pool_id ( ) ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.network.Network network ) { return ( ( network.getName ( ) . trim ( ) . toLowerCase ( ) . equals ( getNetworkName ( ) . trim ( ) . toLowerCase ( ) ) ) && ( ! ( network.getId ( ) . equals ( getNetwork ( ) . getId ( ) ) ) ) ) && ( getNetwork ( ) . getDataCenterId ( ) . equals ( network.getDataCenterId ( ) ) ) ; }
Source:
private static void mockStorageDomainStatic ( org.ovirt.engine.core.bll.ImportVmTemplateCommand command , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { final org.ovirt.engine.core.dao.StorageDomainStaticDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainStaticDAO.class ) ; final org.ovirt.engine.core.common.businessentities.StorageDomainStatic domain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; domain.setStorageType ( storageType ) ; org.mockito.Mockito.when ( dao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; org.mockito.Mockito.doReturn ( dao ) . when ( command ) . getStorageDomainStaticDAO ( ) ; }

Target:
private static void mockStorageDomainStatic ( org.ovirt.engine.core.bll.ImportVmTemplateCommand command , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { final org.ovirt.engine.core.dao.StorageDomainStaticDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainStaticDAO.class ) ; final org.ovirt.engine.core.common.businessentities.StorageDomainStatic domain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; domain.setStorageType ( storageType ) ; org.mockito.Mockito.when ( dao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; org.mockito.Mockito.doReturn ( dao ) . when ( command ) . getStorageDomainStaticDAO ( ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.VnicProfileView mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.VnicProfileView entity = super . mapRow ( rs , rowNum ) ; entity.setNetworkName ( rs.getString ( "network_name" ) ) ; entity.setNetworkQoSName ( rs.getString ( "network_qos_name" ) ) ; entity.setDataCenterName ( rs.getString ( "data_center_name" ) ) ; entity.setCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( rs.getString ( "compatibility_version" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.VnicProfileView mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.VnicProfileView entity = super . mapRow ( rs , rowNum ) ; entity.setNetworkName ( rs.getString ( "network_name" ) ) ; entity.setNetworkQosName ( rs.getString ( "network_qos_name" ) ) ; entity.setDataCenterName ( rs.getString ( "data_center_name" ) ) ; entity.setCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( rs.getString ( "compatibility_version" ) ) ) ; return entity ; }
Source:
public static void IsMTUOverrideSupported ( 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.MTUOverrideSupported ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void isMTUOverrideSupported ( 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.MTUOverrideSupported ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangable ( true ) ; setEnableSearchHost ( true ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangeable ( true ) ; setEnableSearchHost ( true ) ; }
Source:
public void setValue ( java.lang.Object value ) { asSuggestBox ( ) . setValue ( ( ( java.lang.String ) ( value ) ) ) ; }

Target:
public void setAcceptableValues ( java.util.Collection < java.lang.Object > values ) { java.util.Collection < java.lang.String > stringValues = org.ovirt.engine.ui.uicommonweb.Linq.cast ( values ) ; com.google.gwt.user.client.ui.MultiWordSuggestOracle suggestOracle = ( ( com.google.gwt.user.client.ui.MultiWordSuggestOracle ) ( asSuggestBox ( ) . getSuggestOracle ( ) ) ) ; suggestOracle.clear ( ) ; suggestOracle.addAll ( stringValues ) ; suggestOracle.setDefaultSuggestionsFromText ( stringValues ) ; }
Source:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
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 ) ; }
Source:
public 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 ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getMaxVmsInPool ( 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 ) ) : 1000 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVmsInPool , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private static boolean isBelowPctThreshold ( final org.ovirt.engine.core.common.businessentities.storage_domains domain ) { org.ovirt.engine.core.common.businessentities.storage_domain_dynamic dynamic = domain.getStorageDynamicData ( ) ; return ( ( dynamic != null ) && ( ( dynamic.getfreeDiskInGB ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.FreeSpaceCriticalLowInGB ) ) ) ) && ( ( dynamic.getfreeDiskPercent ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.FreeSpaceLow ) ) ) ; }

Target:
private static boolean isBelowPctThreshold ( final org.ovirt.engine.core.common.businessentities.storage_domains domain ) { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic dynamic = domain.getStorageDynamicData ( ) ; return ( ( dynamic != null ) && ( ( dynamic.getfreeDiskInGB ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.FreeSpaceCriticalLowInGB ) ) ) ) && ( ( dynamic.getfreeDiskPercent ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.FreeSpaceLow ) ) ) ; }
Source:
public void testHashCode ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > > m = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p1 = new org.ovirt.engine.core.common.utils.Pair ( true , "abc" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p2 = new org.ovirt.engine.core.common.utils.Pair ( true , "abc" ) ; m.put ( "test" , p1 ) ; org.junit.Assert.assertTrue ( m.containsValue ( p1 ) ) ; org.junit.Assert.assertTrue ( m.containsValue ( p2 ) ) ; }

Target:
public void testHashCode ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > > m = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p1 = new org.ovirt.engine.core.common.utils.Pair ( true , "abc" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p2 = new org.ovirt.engine.core.common.utils.Pair ( true , "abc" ) ; m.put ( "test" , p1 ) ; org.junit.jupiter.api.Assertions.assertTrue ( m.containsValue ( p1 ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( m.containsValue ( p2 ) ) ; }
Source:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
public java.lang.Boolean runInTransaction ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifaces = new java.util.ArrayList ( getInterfaces ( ) ) ; ifaces.addAll ( getRemovedBonds ( ) . values ( ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.CollectHostNetworkDataVdsCommandParameters ( getVds ( ) , ifaces ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }

Target:
public java.lang.Boolean runInTransaction ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifaces = new java.util.ArrayList ( getInterfaces ( ) ) ; ifaces.addAll ( getRemovedBonds ( ) . values ( ) ) ; runVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.CollectHostNetworkDataVdsCommandParameters ( getVds ( ) , ifaces ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }
Source:
public org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryResult runDiscover ( ) { try { org.apache.xmlrpc.client.XmlRpcClient client = new org.apache.xmlrpc.client.XmlRpcClient ( ) ; client.setConfig ( config ) ; java.lang.Object result = client.execute ( org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.DISCOVER , org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.EMPTY ) ; return parseDiscoverResults ( result ) ; } catch ( org.apache.xmlrpc.XmlRpcException e ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.log.error ( "Could not communicate with the external scheduler while discovering" , e ) ; return null ; } }

Target:
public org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryResult runDiscover ( ) { try { org.apache.xmlrpc.client.XmlRpcClient client = new org.apache.xmlrpc.client.XmlRpcClient ( ) ; client.setConfig ( config ) ; java.lang.Object result = client.execute ( org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.DISCOVER , org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.EMPTY ) ; return parseDiscoverResults ( result ) ; } catch ( org.apache.xmlrpc.XmlRpcException e ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.log.error ( "Error communicating with the external scheduler while discovering: {}" , e.getMessage ( ) ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.log.debug ( "Exception" , e ) ; return null ; } }
Source:
public org.ovirt.engine.sdk.decorators.ClusterNetwork update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Network.class , org.ovirt.engine.sdk.decorators.ClusterNetwork.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.ClusterNetwork update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Network.class , org.ovirt.engine.sdk.decorators.ClusterNetwork.class , headers ) ; }
Source:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus storagePoolStatus , org.ovirt.engine.api.model.DataCenterStatus dataCenterStatus ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setstatus ( storagePoolStatus ) ; org.ovirt.engine.api.model.DataCenter dataCenter = org.ovirt.engine.api.restapi.types.DataCenterMapper.map ( storagePool , null ) ; assertEquals ( dataCenter.getStatus ( ) . getState ( ) , dataCenterStatus.value ( ) ) ; }

Target:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus storagePoolStatus , org.ovirt.engine.api.model.DataCenterStatus dataCenterStatus ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setStatus ( storagePoolStatus ) ; org.ovirt.engine.api.model.DataCenter dataCenter = org.ovirt.engine.api.restapi.types.DataCenterMapper.map ( storagePool , null ) ; assertEquals ( dataCenter.getStatus ( ) . getState ( ) , dataCenterStatus.value ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DbUser getTargetDbUser ( ) { org.ovirt.engine.core.common.businessentities.DbUser dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; dbUser.setLoginName ( getSearchString ( ) ) ; dbUser.setDomain ( getDomain ( ) . getSelectedItem ( ) . toString ( ) ) ; return dbUser ; }

Target:
private org.ovirt.engine.core.common.businessentities.aaa.DbUser getTargetDbUser ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser dbUser = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; dbUser.setLoginName ( getSearchString ( ) ) ; dbUser.setDomain ( ( ( org.ovirt.engine.core.aaa.ProfileEntry ) ( getProfile ( ) . getSelectedItem ( ) ) ) . getAuthz ( ) ) ; return dbUser ; }
Source:
public void initUserAndGroupData ( ) { if ( ( dbUser ) == null ) { dbUser = org.ovirt.engine.core.bll.PermissionsCommandBase.getDbUserDao ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getAdElementId ( ) ) ; } if ( ( ( dbUser ) == null ) && ( ( dbGroup ) == null ) ) { dbGroup = org.ovirt.engine.core.bll.PermissionsCommandBase.getAdGroupDao ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getAdElementId ( ) ) ; } }

Target:
public void initUserAndGroupData ( ) { if ( ( dbUser ) == null ) { dbUser = org.ovirt.engine.core.bll.PermissionsCommandBase.getDbUserDao ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getAdElementId ( ) ) ; } if ( ( ( dbUser ) == null ) && ( ( dbGroup ) == null ) ) { dbGroup = dbGroupDao.get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getAdElementId ( ) ) ; } }
Source:
public void canDoActionFailsForCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; mockIsGlusterEnabled ( false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; mockIsGlusterEnabled ( true ) ; mockCompatibilityVersion ( Version.v3_5 ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void validateFailsForCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; mockIsGlusterEnabled ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; mockIsGlusterEnabled ( true ) ; mockCompatibilityVersion ( Version.v3_5 ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public java.lang.Object runInTransaction ( ) { detachStorageDomainWithEntities ( getStorageDomain ( ) ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapToRemove = getStorageDomain ( ) . getStoragePoolIsoMapData ( ) ; getCompensationContext ( ) . snapshotEntity ( mapToRemove ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( mapToRemove.getstorage_id ( ) , mapToRemove.getstorage_pool_id ( ) ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskProfileDao ( ) . nullifyQosForStorageDomain ( getStorageDomain ( ) . getId ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { detachStorageDomainWithEntities ( getStorageDomain ( ) ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapToRemove = getStorageDomain ( ) . getStoragePoolIsoMapData ( ) ; getCompensationContext ( ) . snapshotEntity ( mapToRemove ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( mapToRemove.getStorageId ( ) , mapToRemove.getStoragePoolId ( ) ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskProfileDao ( ) . nullifyQosForStorageDomain ( getStorageDomain ( ) . getId ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
protected void executeCommand ( ) { getMacPoolEntity ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getMacPoolDao ( ) . save ( getMacPoolEntity ( ) ) ; addPermission ( getCurrentUser ( ) . getId ( ) , getMacPoolEntity ( ) . getId ( ) ) ; poolPerDc.createPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }

Target:
protected void executeCommand ( ) { registerRollbackHandler ( new org.ovirt.engine.core.bll.AddMacPoolCommand.CustomTransactionCompletionListener ( ) ) ; getMacPoolEntity ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getMacPoolDao ( ) . save ( getMacPoolEntity ( ) ) ; addPermission ( getCurrentUser ( ) . getId ( ) , getMacPoolEntity ( ) . getId ( ) ) ; macPoolPerCluster.createPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }
Source:
public void refreshStoragePool ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getBroker ( ) . refreshStoragePool ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getMasterDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getStoragePool ( ) . getmaster_domain_version ( ) ) ; }

Target:
public void refreshStoragePool ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getBroker ( ) . refreshStoragePool ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getMasterDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getStoragePool ( ) . getMasterDomainVersion ( ) ) ; }
Source:
public void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : java.util.Collections.emptyList ( ) ; } } ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
private void resetTabsValidity ( ) { setIsGeneralTabValid ( true ) ; setIsSystemTabValid ( true ) ; setIsFirstRunTabValid ( true ) ; setIsDisplayTabValid ( true ) ; setIsHostTabValid ( true ) ; setIsAllocationTabValid ( true ) ; setIsBootSequenceTabValid ( true ) ; setRngTabValid ( true ) ; setIsCustomPropertiesTabValid ( true ) ; getValid ( ) . setEntity ( true ) ; }

Target:
private void numaSupport ( ) { setNumaChanged ( true ) ; getBehavior ( ) . numaSupport ( ) ; }
Source:
public void Cluster_SelectedItemChanged ( ) { UpdateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; UpdateMinAllocatedMemory ( ) ; UpdateNumOfSockets ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateCpuPinningVisibility ( ) ; }

Target:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateCpuPinningVisibility ( ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getAddCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.vms.hostdev.VmHostDeviceListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getAddCommand ( ) ) ) { return addPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getRepinHostCommand ( ) ) ) { return repinPopupProvider.get ( ) ; } return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; }
Source:
protected void endVmCommand ( ) { try { if ( org.ovirt.engine.core.bll.RemoveVmCommand.acquireLock ( ) ) { setVm ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ; if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) != null ) { updateDisksAfterVmRemoved ( ) ; removeVmFromDb ( ) ; } } org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( true ) ; } finally { org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; } }

Target:
protected void endVmCommand ( ) { try { if ( org.ovirt.engine.core.bll.RemoveVmCommand.acquireLock ( ) ) { setVm ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ; if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) != null ) { processUnremovedDisks ( true ) ; removeVmFromDb ( ) ; } } org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( true ) ; } finally { org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; } }
Source:
public void testGetLunsToUpdateInDbForSameLun ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; org.ovirt.engine.core.compat.Guid lunId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; lun.setLUNId ( lunId.toString ( ) ) ; lun.setPhysicalVolumeId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > upToDateLuns = getLunsToUpdateInDb ( lun , lun ) . get ( command.noOp ) ; assertLunIdInList ( upToDateLuns , lunId ) ; }

Target:
private void setLunsSameLunAndPvIds ( ) { org.ovirt.engine.core.compat.Guid lunId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.compat.Guid pvId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; setLunsIds ( lunId , lunId , pvId , pvId ) ; }
Source:
public static org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel createInstance ( org.ovirt.engine.core.common.businessentities.VmBase vm , org.ovirt.engine.core.common.businessentities.VMStatus vmStatus , org.ovirt.engine.core.compat.Guid dcId , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmNicList , org.ovirt.engine.ui.uicommonweb.models.EntityModel sourceModel ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel instance = new org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel ( vm , vmStatus , dcId , clusterCompatibilityVersion , vmNicList , sourceModel ) ; instance.init ( ) ; return instance ; }

Target:
public static org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel createInstance ( org.ovirt.engine.core.common.businessentities.VmBase vm , org.ovirt.engine.core.common.businessentities.VMStatus vmStatus , org.ovirt.engine.core.compat.Guid dcId , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmNicList , org.ovirt.engine.ui.uicommonweb.models.IModel sourceModel ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel instance = new org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel ( vm , vmStatus , dcId , clusterCompatibilityVersion , vmNicList , sourceModel ) ; instance.init ( ) ; return instance ; }
Source:
private void handleVdsLiveSnapshotFailure ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.warnFormat ( "Could not perform live snapshot due to error: {0}. VM will still be configured to the new created snapshot" , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; addCustomValue ( "SnapshotName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotName ( ) ) ; addCustomValue ( "VmName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ; updateCallStackFromThrowable ( e ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE ) ; }

Target:
private void handleVdsLiveSnapshotFailure ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.warn ( ( "Could not perform live snapshot due to error, VM will still be configured to the new created" + " snapshot: {}" ) , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; addCustomValue ( "SnapshotName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotName ( ) ) ; addCustomValue ( "VmName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ; updateCallStackFromThrowable ( e ) ; auditLogDirector.log ( this , AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE ) ; }
Source:
public static void updateSmartcardDevice ( org.ovirt.engine.core.compat.Guid vmId , boolean smartcardEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.SMARTCARD , VmDeviceType.SMARTCARD.getName ( ) ) ; if ( ! smartcardEnabled ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : vmDevices ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } else if ( vmDevices.isEmpty ( ) ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addSmartcardDevice ( vmId ) ; } }

Target:
public static void updateSmartcardDevice ( org.ovirt.engine.core.compat.Guid vmId , boolean smartcardEnabled ) { if ( smartcardEnabled ) { if ( ! ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.hasSmartcardDevice ( vmId ) ) ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addSmartcardDevice ( vmId ) ; } } else { org.ovirt.engine.core.bll.utils.VmDeviceUtils.removeSmartcardDevices ( vmId ) ; } }
Source:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void getClusterDesktopMemoryOverCommit ( 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 ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupByVdsGroupId , org.ovirt.engine.core.common.queries.GetVdsGroupByVdsGroupIdParameters.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { GUIDS [ 2 ] } , getVdsGroupEntity ( ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendTemplatesResourceTest.getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupByVdsGroupId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 2 ] } , getVdsGroupEntity ( ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendTemplatesResourceTest.getModel ( 0 ) ) , 0 ) ; }