auphong2707/dl4se-code-review-dataset huggingface dataset:
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.RunQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.common.PermissionSubject > permissionList = super . getPermissionCheckSubjects ( ) ; if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getCustomProperties ( ) ) ) ) { permissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.common.VdcObjectType.VM , org.ovirt.engine.core.common.businessentities.ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES ) ) ; } return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = super . getPermissionCheckSubjects ( ) ; if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getCustomProperties ( ) ) ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.common.VdcObjectType.VM , org.ovirt.engine.core.common.businessentities.ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES ) ) ; } return permissionList ; }
Source:
public org.ovirt.engine.sdk.decorators.DataCenter add ( org.ovirt.engine.sdk.decorators.DataCenter datacenter , java.lang.String expect , java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Expect" , expect ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , datacenter , org.ovirt.engine.sdk.entities.DataCenter.class , org.ovirt.engine.sdk.decorators.DataCenter.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.DataCenter add ( org.ovirt.engine.sdk.decorators.DataCenter datacenter ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; 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 ( ) . add ( url , datacenter , org.ovirt.engine.sdk.entities.DataCenter.class , org.ovirt.engine.sdk.decorators.DataCenter.class , headers ) ; }
Source:
public void testQuotaClusterByQuotaGuidWithGeneralDefaultNoDefault ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByQuotaGuidWithGeneralDefault ( FixturesTool.QUOTA_SPECIFIC ) ; org.junit.Assert.assertNotNull ( quotaClusterList ) ; org.junit.Assert.assertEquals ( "wrong number of quotas returned" , 2 , quotaClusterList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.QuotaCluster group : quotaClusterList ) { org.junit.Assert.assertNotNull ( "VDS ID should not be null in specific mode" , group.getClusterId ( ) ) ; org.junit.Assert.assertNotNull ( "VDS name should not be null in specific mode" , group.getClusterName ( ) ) ; } }

Target:
public void testQuotaClusterByQuotaGuidWithGeneralDefaultWithDefault ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByQuotaGuidWithGeneralDefault ( FixturesTool.QUOTA_GENERAL ) ; org.junit.jupiter.api.Assertions.assertNotNull ( quotaClusterList ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , quotaClusterList.size ( ) , "wrong number of quotas returned" ) ; for ( org.ovirt.engine.core.common.businessentities.QuotaCluster group : quotaClusterList ) { org.junit.jupiter.api.Assertions.assertEquals ( Guid.Empty , group.getClusterId ( ) , "VDS ID should be empty in general mode" ) ; org.junit.jupiter.api.Assertions.assertNull ( group.getClusterName ( ) , "VDS name should be null in general mode" ) ; } }
Source:
public boolean validate ( org.ovirt.engine.core.config.entity.ConfigKey key , java.lang.String value ) { java.util.List < java.lang.String > validValues = key.getValidValues ( ) ; boolean isValid = false ; if ( validValues.isEmpty ( ) ) { isValid = true ; } else { isValid = validValues.contains ( value ) ; } return isValid ; }

Target:
public org.ovirt.engine.core.config.entity.helper.ValidationResult validate ( org.ovirt.engine.core.config.entity.ConfigKey key , java.lang.String value ) { java.util.List < java.lang.String > validValues = key.getValidValues ( ) ; boolean isValid = false ; if ( validValues.isEmpty ( ) ) { isValid = true ; } else { isValid = validValues.contains ( value ) ; } return new org.ovirt.engine.core.config.entity.helper.ValidationResult ( isValid ) ; }
Source:
public static java.lang.Long determineTotalImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.DiskImage sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid dstDomain ) { if ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { double totalSizeForClonedDisk = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getTotalSizeForClonedDisk ( sourceImage , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . get ( dstDomain ) . getStorageStaticData ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( java.lang.Double.valueOf ( totalSizeForClonedDisk ) . longValue ( ) ) ; } return null ; }

Target:
public static java.lang.Long determineTotalImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.DiskImage sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid dstDomain ) { if ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { double totalSizeForClonedDisk = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getTotalActualSizeOfDisk ( sourceImage , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . get ( dstDomain ) . getStorageStaticData ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( java.lang.Double.valueOf ( totalSizeForClonedDisk ) . longValue ( ) ) ; } return null ; }
Source:
public void testSetStatusForNonRequiredNetworkUpdated ( ) { networkCluster.setRequired ( false ) ; networkCluster.setStatus ( NetworkStatus.NON_OPERATIONAL ) ; underTest.setStatus ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME ) ) ; org.mockito.Mockito.verify ( networkClusterDao ) . updateStatus ( org.mockito.ArgumentMatchers.same ( networkCluster ) ) ; org.junit.Assert.assertThat ( networkCluster.getStatus ( ) , org.hamcrest.Matchers.is ( NetworkStatus.OPERATIONAL ) ) ; }

Target:
public void testSetStatusForRequiredNetworkAbsentOnHost ( ) { networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; testSetStatusForRequiredNetwork ( ( "not" + ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME ) ) ) ; org.mockito.Mockito.verify ( networkClusterDao ) . updateStatus ( org.mockito.Matchers.same ( networkCluster ) ) ; org.junit.Assert.assertThat ( networkCluster.getStatus ( ) , org.hamcrest.Matchers.is ( NetworkStatus.NON_OPERATIONAL ) ) ; }
Source:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }

Target:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String templateName , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( templateName ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , params , aQuery ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { if ( ( model.getGlobalClusterQuota ( ) . getEntity ( ) ) || ( ( model.getSpecificClusterQuota ( ) . getEntity ( ) ) && ( selectedClusterGuid.contains ( object.getVdsGroupId ( ) ) ) ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.QuotaPopupView.constants.editCellQuota ( ) ; } return null ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.QuotaCluster object ) { if ( ( model.getGlobalClusterQuota ( ) . getEntity ( ) ) || ( ( model.getSpecificClusterQuota ( ) . getEntity ( ) ) && ( selectedClusterGuid.contains ( object.getClusterId ( ) ) ) ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.QuotaPopupView.constants.editCellQuota ( ) ; } return null ; }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
private static void interfaceHasSiblingVlanInterfaces ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; if ( ( siblingVlanInterfaces.size ( ) ) > 0 ) { return true ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllSiblingVlanInterfaces , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc getVGList ( ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getVGList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc convertVmFromOva ( java.lang.String ovaPath , java.util.Map < java.lang.String , java.lang.Object > vm , java.lang.String jobUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.convertExternalVmFromOva ( ovaPath , vm , jobUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testIsFieldsUpdated ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; jedi2.saberColor = "red" ; org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; boolean changed = oic.isFieldsUpdated ( jedi1 , jedi2 , java.util.Arrays.asList ( "name" ) ) ; org.junit.Assert.assertFalse ( "No Change" , changed ) ; changed = oic.isFieldsUpdated ( jedi1 , jedi2 , java.util.Arrays.asList ( "saberColor" ) ) ; org.junit.Assert.assertTrue ( "1 Change" , changed ) ; }

Target:
public void testIsFieldsUpdated ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; jedi2.saberColor = "red" ; org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; boolean changed = oic.isFieldsUpdated ( jedi1 , jedi2 , java.util.Collections.singletonList ( "name" ) ) ; org.junit.Assert.assertFalse ( "No Change" , changed ) ; changed = oic.isFieldsUpdated ( jedi1 , jedi2 , java.util.Collections.singletonList ( "saberColor" ) ) ; org.junit.Assert.assertTrue ( "1 Change" , changed ) ; }
Source:
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 ) { boolean ha = getModel ( ) . getIsHighlyAvailable ( ) . getEntity ( ) ; getModel ( ) . getLease ( ) . setIsChangeable ( ha ) ; if ( ! ha ) { getModel ( ) . getLease ( ) . setSelectedItem ( null ) ; } }

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 ) { boolean ha = getModel ( ) . getIsHighlyAvailable ( ) . getEntity ( ) ; setVmLeasesAvailability ( ) ; if ( ! ha ) { getModel ( ) . getLease ( ) . setSelectedItem ( null ) ; } }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , 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.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
default void inputDetail ( ) { org.ovirt.api.metamodel.language.ApiLanguage.or ( org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( cluster ( ) . id ( ) ) , org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( cluster ( ) . name ( ) ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( clone ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( exclusive ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( template ( ) . name ( ) ) ; }

Target:
default void inputDetail ( ) { org.ovirt.api.metamodel.language.ApiLanguage.or ( org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( cluster ( ) . id ( ) ) , org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( cluster ( ) . name ( ) ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( clone ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( exclusive ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( template ( ) . name ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( registrationConfiguration ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object result1 ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > ) ( result1 ) ) ; profilesQuery.setModel ( clusterNetworks ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVnicProfilesByDcId ( profilesQuery , dcId ) ; }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object result1 ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > ) ( result1 ) ) ; managementNetworkName = org.ovirt.engine.ui.uicommonweb.Linq.findManagementNetwork ( clusterNetworks ) . getName ( ) ; profilesQuery.setModel ( clusterNetworks ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVnicProfilesByDcId ( profilesQuery , dcId ) ; }
Source:
public void testValidRemovedBondsWhenNotRemovingAnyBond ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Bond > emptyList ( ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , params , null , null , null ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testValidRemovedBondsWhenBondIsNotRequired ( ) throws java.lang.Exception { java.lang.String nicName = "nicName" ; bond.setName ( nicName ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setRemovedBonds ( java.util.Collections.singleton ( bond.getId ( ) ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( params , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > singletonList ( bond ) ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void addFeatureServerTime ( org.ovirt.engine.api.model.Features features ) { org.ovirt.engine.api.model.Feature feature = new org.ovirt.engine.api.model.Feature ( ) ; feature.setName ( "Display Server Time" ) ; feature.setApi ( new org.ovirt.engine.api.model.API ( ) ) ; feature.getApi ( ) . setTime ( org.ovirt.engine.api.restapi.types.DateMapper.map ( new java.util.Date ( ) , null ) ) ; features.getFeature ( ) . add ( feature ) ; }

Target:
private void addFeatureServerTime ( org.ovirt.engine.api.model.Features features ) { org.ovirt.engine.api.model.Feature feature = new org.ovirt.engine.api.model.Feature ( ) ; feature.setName ( "Display Server Time" ) ; feature.setApi ( new org.ovirt.engine.api.model.Api ( ) ) ; feature.getApi ( ) . setTime ( org.ovirt.engine.api.restapi.types.DateMapper.map ( new java.util.Date ( ) , null ) ) ; features.getFeature ( ) . add ( feature ) ; }
Source:
public void testDisplayTypes ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > supportedDisplays = OsRepositoryImpl.INSTANCE.getDisplayTypes ( ) . get ( 777 ) . get ( null ) ; boolean isSizeCorrect = ( supportedDisplays.size ( ) ) == 2 ; boolean containsSameElements = new java.util.HashSet < org.ovirt.engine.core.common.businessentities.DisplayType > ( supportedDisplays ) . equals ( new java.util.HashSet < org.ovirt.engine.core.common.businessentities.DisplayType > ( java.util.Arrays.asList ( DisplayType.qxl , DisplayType.vga ) ) ) ; org.junit.Assert.assertTrue ( isSizeCorrect ) ; org.junit.Assert.assertTrue ( containsSameElements ) ; }

Target:
public void testDisplayTypes ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.DisplayType > > supportedGraphicsAndDisplays = OsRepositoryImpl.INSTANCE.getGraphicsAndDisplays ( ) . get ( 777 ) . get ( null ) ; boolean isSizeCorrect = ( supportedGraphicsAndDisplays.size ( ) ) == 2 ; boolean containsSameElements = new java.util.HashSet ( supportedGraphicsAndDisplays ) . equals ( new java.util.HashSet ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.utils.Pair ( org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE , org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) , new org.ovirt.engine.core.common.utils.Pair ( org.ovirt.engine.core.common.businessentities.GraphicsType.VNC , org.ovirt.engine.core.common.businessentities.DisplayType.cirrus ) ) ) ) ; org.junit.Assert.assertTrue ( isSizeCorrect ) ; org.junit.Assert.assertTrue ( containsSameElements ) ; }
Source:
public void twoNetworkInterfacesWithNullIp ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > listOfInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; listOfInterfaces.add ( createVdsNetworkInterfaceWithStaticIp ( null ) ) ; listOfInterfaces.add ( createVdsNetworkInterfaceWithStaticIp ( null ) ) ; validateAndAssertResult ( listOfInterfaces , true ) ; }

Target:
public void twoNetworkInterfacesWithNullIp ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > listOfInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; listOfInterfaces.add ( org.ovirt.engine.core.common.validation.NoRepetitiveStaticIpInListConstraintTest.createVdsNetworkInterfaceWithStaticIp ( null ) ) ; listOfInterfaces.add ( org.ovirt.engine.core.common.validation.NoRepetitiveStaticIpInListConstraintTest.createVdsNetworkInterfaceWithStaticIp ( null ) ) ; validateAndAssertResult ( listOfInterfaces , true ) ; }
Source:
public void updateChangeConnectionType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; oldNFSConnection.setstorage_type ( StorageType.ISCSI ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getid ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE ) ; }

Target:
public void updateChangeConnectionType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections iscsiConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( iscsiConnection ) ; org.mockito.Mockito.when ( storageConnDao.get ( iscsiConnection.getid ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , parentParameters , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , parentParameters.getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }

Target:
protected void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus ) ; }
Source:
protected void updateHashName ( T model ) { java.lang.String hashName = model.getHashName ( ) ; org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget.getView ( ) . setHashName ( hashName ) ; org.ovirt.engine.ui.uicommonweb.UICommand openDocumentationCommand = model.getOpenDocumentationCommand ( ) ; if ( openDocumentationCommand != null ) { boolean isDocumentationAvailable = ( hashName != null ) && ( ( org.ovirt.engine.ui.common.uicommon.DocumentationPathTranslator.getPath ( hashName ) ) != null ) ; openDocumentationCommand.setIsAvailable ( isDocumentationAvailable ) ; updateHelpCommand ( ( isDocumentationAvailable ? openDocumentationCommand : null ) ) ; } }

Target:
protected void updateHashName ( T model ) { java.lang.String hashName = model.getHashName ( ) ; org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget.getView ( ) . setHashName ( hashName ) ; org.ovirt.engine.ui.uicommonweb.UICommand openDocumentationCommand = model.getOpenDocumentationCommand ( ) ; if ( openDocumentationCommand != null ) { boolean isDocumentationAvailable = ( hashName != null ) && ( ( org.ovirt.engine.ui.common.uicommon.ContextSensitiveHelpManager.getPath ( hashName ) ) != null ) ; openDocumentationCommand.setIsAvailable ( isDocumentationAvailable ) ; updateHelpCommand ( ( isDocumentationAvailable ? openDocumentationCommand : null ) ) ; } }
Source:
private static void addPermission ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.bll.PredefinedRoles role , org.ovirt.engine.core.common.VdcObjectType objectType ) { org.ovirt.engine.core.common.businessentities.Permissions perms = new org.ovirt.engine.core.common.businessentities.Permissions ( ) ; perms.setad_element_id ( userId ) ; perms.setObjectType ( objectType ) ; perms.setObjectId ( entityId ) ; perms.setrole_id ( role.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }

Target:
public static boolean shouldRemoveNetworkFromHostUponNetworkRemoval ( org.ovirt.engine.core.common.businessentities.network.Network persistedNetwork , org.ovirt.engine.core.compat.Version compatibilityVersion ) { return ( ( ! ( persistedNetwork.isExternal ( ) ) ) && ( org.ovirt.engine.core.utils.NetworkUtils.isLabeled ( persistedNetwork ) ) ) && ( org.ovirt.engine.core.bll.network.cluster.NetworkHelper.setupNetworkSupported ( compatibilityVersion ) ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.provider.ProviderValidator validator = new org.ovirt.engine.core.bll.provider.ProviderValidator ( getProvider ( ) ) ; return validate ( validator.nameAvailable ( ) ) ; }

Target:
protected boolean canDoAction ( ) { if ( ( getProvider ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_DOESNT_EXIST ) ; } org.ovirt.engine.core.bll.provider.ProviderProxy providerProxy = getProviderProxy ( ) ; if ( providerProxy == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_NOT_SUPPORTED , java.lang.String.format ( "$providerType %1$s" , getProvider ( ) . getType ( ) ) ) ; } org.ovirt.engine.core.bll.provider.ProviderValidator validator = getProviderProxy ( ) . getProviderValidator ( ) ; return ( validate ( validator.nameAvailable ( ) ) ) && ( validate ( validator.validateAddProvider ( ) ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { removeVnicProfiles ( ) ; removeFromClusters ( ) ; getCompensationContext ( ) . snapshotEntity ( getNetwork ( ) ) ; getNetworkDAO ( ) . remove ( getNetwork ( ) . getId ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { removeVnicProfiles ( ) ; removeFromClusters ( ) ; getCompensationContext ( ) . snapshotEntity ( getNetwork ( ) ) ; getNetworkDao ( ) . remove ( getNetwork ( ) . getId ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createIdParameterMapper ( org.ovirt.engine.core.compat.Guid id ) { return createGlusterHookIdParams ( id ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity getById ( org.ovirt.engine.core.compat.Guid id , boolean eagerLoad ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity glusterHook = getCallsHandler ( ) . executeRead ( "GetGlusterHookById" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.glusterHookRowMapper , createIdParameterMapper ( id ) . addValue ( "includeContent" , eagerLoad ) ) ; if ( eagerLoad ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > serverHooks = getCallsHandler ( ) . executeReadList ( "GetGlusterServerHooksById" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.glusterServerHookRowMapper , createIdParameterMapper ( id ) ) ; if ( serverHooks != null ) { glusterHook.setServerHooks ( serverHooks ) ; } } return glusterHook ; }
Source:
public void testPrimaryKeyValidation ( ) { org.ovirt.engine.core.common.businessentities.RepoImage newRepoFileMap = org.ovirt.engine.core.dao.RepoFileMetaDataDAOTest.getNewIsoRepoFile ( ) ; org.ovirt.engine.core.dao.RepoFileMetaDataDAOTest.getNewIsoRepoFile ( ) ; repoFileMetaDataDao.addRepoFileMap ( newRepoFileMap ) ; try { repoFileMetaDataDao.addRepoFileMap ( newRepoFileMap ) ; } catch ( java.lang.Exception e ) { org.junit.Assert.assertTrue ( true ) ; } }

Target:
public void testPrimaryKeyValidation ( ) { org.ovirt.engine.core.common.businessentities.storage.RepoImage newRepoFileMap = org.ovirt.engine.core.dao.RepoFileMetaDataDAOTest.getNewIsoRepoFile ( ) ; org.ovirt.engine.core.dao.RepoFileMetaDataDAOTest.getNewIsoRepoFile ( ) ; repoFileMetaDataDao.addRepoFileMap ( newRepoFileMap ) ; try { repoFileMetaDataDao.addRepoFileMap ( newRepoFileMap ) ; } catch ( java.lang.Exception e ) { org.junit.Assert.assertTrue ( true ) ; } }
Source:
protected void updateData ( ) { java.util.List < T > items = ( ( org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . getItems ( ) ) == null ) ? null : new java.util.ArrayList < T > ( org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . getItems ( ) ) ; if ( items != null ) { updateDataProvider ( items ) ; } }

Target:
protected void updateData ( ) { java.util.List < T > items = ( ( org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . getItems ( ) ) == null ) ? null : new java.util.ArrayList < T > ( org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . getItems ( ) ) ; if ( items != null ) { if ( ! ( org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . hasItemsSorted ( ) ) ) { java.util.Collections.sort ( items , getDefaultItemComparator ( ) ) ; } updateDataProvider ( items ) ; } }
Source:
public void testMoveWithStorageDomainName ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ( "Storage: name=" + ( NAMES [ 2 ] ) ) , SearchType.StorageDomain , getStorageDomain ( 2 ) ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setName ( NAMES [ 2 ] ) ; doTestMove ( storageDomain ) ; }

Target:
public void testMoveWithStorageDomainName ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetStorageDomainByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ 2 ] } , getStorageDomainStatic ( 2 ) ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setName ( NAMES [ 2 ] ) ; doTestMove ( storageDomain ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > getAllEventNotificationMethods ( ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) ; org.springframework.jdbc.core.simple.ParameterizedRowMapper < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > mapper = new org.springframework.jdbc.core.simple.ParameterizedRowMapper < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.EventNotificationMethod mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.EventNotificationMethod entity = new org.ovirt.engine.core.common.businessentities.EventNotificationMethod ( ) ; entity.setmethod_id ( rs.getInt ( "method_id" ) ) ; entity.setmethod_type ( EventNotificationMethods.EMAIL ) ; return entity ; } } ; return getCallsHandler ( ) . executeReadList ( "GetAllFromevent_notification_methods" , mapper , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.event_subscriber > getAllForSubscriber ( org.ovirt.engine.core.compat.Guid id ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "subscriber_id" , id ) ; return getCallsHandler ( ) . executeReadList ( "Getevent_subscriberBysubscriber_id" , org.ovirt.engine.core.dao.EventDAODbFacadeImpl.EventSubscriberRowMapper.instance , parameterSource ) ; }
Source:
public void testAllDomainsExistAndActiveOneInactive ( ) { domain1.setStatus ( StorageDomainStatus.Active ) ; domain2.setStatus ( StorageDomainStatus.Inactive ) ; domain3.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.allDomainsExistAndActive ( ) ; org.junit.Assert.assertThat ( "One domain should not be active" , result , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ) ; }

Target:
public void testAllDomainsExistAndActiveOneInactive ( ) { domain1.setStatus ( StorageDomainStatus.Active ) ; domain2.setStatus ( StorageDomainStatus.Inactive ) ; domain3.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.allDomainsExistAndActive ( ) ; org.hamcrest.MatcherAssert.assertThat ( "One domain should not be active" , result , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ) ; }
Source:
private boolean changesAreClusterCompatible ( ) { if ( ! ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToClusterInternalCommand.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.nonVmNetwork ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToClusterInternalCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) { addValidationMessage ( EngineMessage.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; return false ; } } return true ; }

Target:
private boolean changesAreClusterCompatible ( ) { if ( ! ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToClusterInternalCommand.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.nonVmNetwork ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToClusterInternalCommand.getCluster ( ) . getCompatibilityVersion ( ) ) ) ) { addValidationMessage ( EngineMessage.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; return false ; } } return true ; }
Source:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; initVmForSpace ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
protected org.ovirt.engine.api.model.Nic deprecatedPopulate ( org.ovirt.engine.api.model.Nic model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; addReportedDevices ( model , entity ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity ) ; } return model ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Nic nic ) { validateEnums ( org.ovirt.engine.api.model.Nic.class , nic ) ; validateParameters ( nic , "name" ) ; return performCreate ( VdcActionType.AddVmInterface , new org.ovirt.engine.core.common.action.AddVmInterfaceParameters ( vmId , map ( nic ) ) , new org.ovirt.engine.api.restapi.resource.NicResolver ( nic.getName ( ) ) ) ; }
Source:
private boolean updateIsoListFromVDSM ( org.ovirt.engine.core.compat.Guid repoStoragePoolId , org.ovirt.engine.core.compat.Guid repoStorageDomainId ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue fileStats = getFileStats ( repoStoragePoolId , repoStorageDomainId , org.ovirt.engine.core.bll.IsoDomainListSyncronizer.ISO_FILE_PATTERN , VDSCommandType.GetIsoList ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FileListRefreshed fileListRefreshed = new org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FileListRefreshed ( ) { @ java.lang.Override public void onFileListRefreshed ( org.ovirt.engine.core.compat.Guid poolId , java.util.Set < java.lang.String > isoList ) { org.ovirt.engine.core.bll.VmHandler.refreshVmsToolsVersion ( poolId , isoList ) ; } } ; return refreshVdsmFileList ( repoStoragePoolId , repoStorageDomainId , fileListRefreshed , ImageFileType.ISO , fileStats ) ; }

Target:
private boolean updateIsoListFromVDSM ( org.ovirt.engine.core.compat.Guid repoStoragePoolId , org.ovirt.engine.core.compat.Guid repoStorageDomainId ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue fileStats = getFileStats ( repoStoragePoolId , repoStorageDomainId , org.ovirt.engine.core.bll.IsoDomainListSyncronizer.ISO_FILE_PATTERN , VDSCommandType.GetIsoList ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FileListRefreshed fileListRefreshed = new org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FileListRefreshed ( ) { @ java.lang.Override public void onFileListRefreshed ( org.ovirt.engine.core.compat.Guid poolId , java.util.Set < java.lang.String > isoList ) { org.ovirt.engine.core.bll.VmHandler.refreshVmsToolsVersion ( poolId , isoList ) ; } } ; return refreshVdsmFileList ( repoStoragePoolId , repoStorageDomainId , fileListRefreshed , ImageFileType.ISO , fileStatsFromVDSReturnValue ( fileStats ) ) ; }
Source:
public void testValidUpdateOfEditableFieldOnDownVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; boolean updateIsValid = org.ovirt.engine.core.bll.VmHandler.isUpdateValid ( src , dest , VMStatus.Down , false ) ; org.junit.Assert.assertTrue ( "Update should be valid for different cluster IDs in the down state" , updateIsValid ) ; }

Target:
public void testValidUpdateOfEditableFieldOnDownVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; boolean updateIsValid = vmHandler.isUpdateValid ( src , dest , VMStatus.Down , false ) ; org.junit.Assert.assertTrue ( "Update should be valid for different cluster IDs in the down state" , updateIsValid ) ; }
Source:
public java.util.List getEmulatedMachinesList ( ) { java.util.List resultList = lst ( ) ; resultList.add ( "pc-0.10" ) ; resultList.add ( "pc-0.11" ) ; resultList.add ( "pc-0.12" ) ; resultList.add ( "pc-0.13" ) ; resultList.add ( "pc-0.14" ) ; resultList.add ( "pc-0.15" ) ; resultList.add ( "pc-1.0" ) ; resultList.add ( "pc" ) ; resultList.add ( "isapc" ) ; return resultList ; }

Target:
public java.util.List getEmulatedMachinesList ( ) { java.util.List resultList = lst ( ) ; resultList.add ( "pc-0.10" ) ; resultList.add ( "pc-0.11" ) ; resultList.add ( "pc-0.12" ) ; resultList.add ( "pc-0.13" ) ; resultList.add ( "pc-0.14" ) ; resultList.add ( "pc-0.15" ) ; resultList.add ( "pc-1.0" ) ; resultList.add ( "pc-1.0" ) ; resultList.add ( "rhel6.4.0" ) ; resultList.add ( "pc" ) ; resultList.add ( "isapc" ) ; return resultList ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; }
Source:
protected java.util.List < java.lang.Class < ? > > getValidationGroups ( ) { switch ( volume.getVolumeType ( ) ) { case REPLICATE : case DISTRIBUTED_REPLICATE : addValidationGroup ( org.ovirt.engine.core.common.validation.group.gluster.CreateReplicatedVolume.class ) ; break ; case STRIPE : case DISTRIBUTED_STRIPE : addValidationGroup ( org.ovirt.engine.core.common.validation.group.gluster.CreateStripedVolume.class ) ; break ; default : addValidationGroup ( org.ovirt.engine.core.common.validation.group.CreateEntity.class ) ; } return super . getValidationGroups ( ) ; }

Target:
protected java.util.List < java.lang.Class < ? > > getValidationGroups ( ) { addValidationGroup ( org.ovirt.engine.core.common.validation.group.CreateEntity.class ) ; if ( volume.getVolumeType ( ) . isReplicatedType ( ) ) { addValidationGroup ( org.ovirt.engine.core.common.validation.group.gluster.CreateReplicatedVolume.class ) ; } if ( volume.getVolumeType ( ) . isStripedType ( ) ) { addValidationGroup ( org.ovirt.engine.core.common.validation.group.gluster.CreateStripedVolume.class ) ; } return super . getValidationGroups ( ) ; }
Source:
public void Execute ( java.lang.Object ... parameters ) { if ( ( ! ( getIsAvailable ( ) ) ) || ( ! ( getIsExecutionAllowed ( ) ) ) ) { return ; } if ( ( target ) != null ) { if ( ( parameters == null ) || ( ( parameters.length ) == 0 ) ) { target.executeCommand ( this ) ; } else { target.executeCommand ( this , parameters ) ; } } }

Target:
public void execute ( java.lang.Object ... parameters ) { if ( ( ! ( getIsAvailable ( ) ) ) || ( ! ( getIsExecutionAllowed ( ) ) ) ) { return ; } if ( ( target ) != null ) { if ( ( parameters == null ) || ( ( parameters.length ) == 0 ) ) { target.executeCommand ( this ) ; } else { target.executeCommand ( this , parameters ) ; } } }