auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.Cluster > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public void persistCommandAssociatedEntities ( java.util.Collection < org.ovirt.engine.core.common.businessentities.CommandAssociatedEntity > cmdAssociatedEntities ) { if ( org.apache.commons.collections.CollectionUtils.isEmpty ( cmdAssociatedEntities ) ) { return ; } javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . insertCommandAssociatedEntities ( cmdAssociatedEntities ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }

Target:
public void persistCommandAssociatedEntities ( java.util.Collection < org.ovirt.engine.core.common.businessentities.CommandAssociatedEntity > cmdAssociatedEntities ) { if ( org.apache.commons.collections.CollectionUtils.isEmpty ( cmdAssociatedEntities ) ) { return ; } javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { commandEntityDao.insertCommandAssociatedEntities ( cmdAssociatedEntities ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getVdsToRun ( org.ovirt.engine.core.common.businessentities.VDSType [ ] types , org.ovirt.engine.core.compat.Guid groupId , org.ovirt.engine.core.common.businessentities.VDSStatus status , int minNrOfCpus ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; for ( final org.ovirt.engine.core.common.businessentities.VDSType type : types ) { result.addAll ( getVdsToRun ( type , groupId , status , minNrOfCpus ) ) ; } return result ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getAllOfTypes ( org.ovirt.engine.core.common.businessentities.VDSType [ ] types ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSType type : types ) { list.addAll ( getAllOfType ( type ) ) ; } return list ; }
Source:
public void removeQuotaFromCache ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.compat.Guid > quotaList ) { org.ovirt.engine.core.bll.quota.QuotaManager.lock.writeLock ( ) . lock ( ) ; try { if ( ! ( org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.containsKey ( storagePoolId ) ) ) { return ; } synchronized ( org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.get ( storagePoolId ) ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.Quota > map = org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.get ( storagePoolId ) ; for ( org.ovirt.engine.core.compat.Guid quotaId : quotaList ) { map.remove ( quotaId ) ; } } } finally { org.ovirt.engine.core.bll.quota.QuotaManager.lock.writeLock ( ) . unlock ( ) ; } }

Target:
public void removeQuotaFromCache ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.compat.Guid > quotaList ) { lock.writeLock ( ) . lock ( ) ; try { if ( ! ( storagePoolQuotaMap.containsKey ( storagePoolId ) ) ) { return ; } synchronized ( storagePoolQuotaMap.get ( storagePoolId ) ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.Quota > map = storagePoolQuotaMap.get ( storagePoolId ) ; for ( org.ovirt.engine.core.compat.Guid quotaId : quotaList ) { map.remove ( quotaId ) ; } } } finally { lock.writeLock ( ) . unlock ( ) ; } }
Source:
public void testAddSetAndUploadIconFailure ( ) { final org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }

Target:
public void testAddSetAndUploadIconFailure ( ) { final org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImageBase > presets = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImageBase > ) ( returnValue ) ) ; diskModel1.getPreset ( ) . setItems ( presets ) ; org.ovirt.engine.core.common.businessentities.DiskImageBase preset = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; preset.setvolume_type ( VolumeType.Preallocated ) ; preset.setvolume_format ( VolumeFormat.RAW ) ; diskModel1.getPreset ( ) . setSelectedItem ( preset ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImageBase > presets = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImageBase > ) ( returnValue ) ) ; diskModel1.getPreset ( ) . setItems ( presets ) ; diskModel1.getPreset ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( presets ) ) ; }
Source:
public void setUp ( ) { connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; connection.setStorageType ( StorageType.ISCSI ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.storage.StorageConnectionValidator ( connection ) ) ; domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setStorageType ( StorageType.ISCSI ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; domain.setStatus ( StorageDomainStatus.Maintenance ) ; domain.setStorageDomainSharedStatus ( StorageDomainSharedStatus.Inactive ) ; }

Target:
public void setUp ( ) { connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( org.ovirt.engine.core.bll.validator.storage.StorageConnectionValidatorTest.CONNECTION_ID_FOR_VALIDATION ) ; connection.setStorageType ( StorageType.ISCSI ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.storage.StorageConnectionValidator ( connection ) ) ; domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setStorageType ( StorageType.ISCSI ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; domain.setStatus ( StorageDomainStatus.Maintenance ) ; domain.setStorageDomainSharedStatus ( StorageDomainSharedStatus.Inactive ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isISCSIConnectionAndDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { org.ovirt.engine.core.bll.ValidationResult validationResult = isSameStorageType ( storageDomain ) ; if ( ! ( validationResult.isValid ( ) ) ) { return validationResult ; } org.ovirt.engine.core.common.businessentities.StorageType connectionStorageType = connection.getstorage_type ( ) ; org.ovirt.engine.core.common.businessentities.StorageType storageDomainType = storageDomain.getStorageType ( ) ; if ( ( ! ( connectionStorageType.equals ( StorageType.ISCSI ) ) ) || ( ! ( storageDomainType.equals ( StorageType.ISCSI ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_ACTION_IS_SUPPORTED_ONLY_FOR_ISCSI_DOMAINS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isISCSIConnectionAndDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { org.ovirt.engine.core.bll.ValidationResult validationResult = isSameStorageType ( storageDomain ) ; if ( ! ( validationResult.isValid ( ) ) ) { return validationResult ; } org.ovirt.engine.core.common.businessentities.storage.StorageType connectionStorageType = connection.getstorage_type ( ) ; org.ovirt.engine.core.common.businessentities.storage.StorageType storageDomainType = storageDomain.getStorageType ( ) ; if ( ( ! ( connectionStorageType.equals ( StorageType.ISCSI ) ) ) || ( ! ( storageDomainType.equals ( StorageType.ISCSI ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_ACTION_IS_SUPPORTED_ONLY_FOR_ISCSI_DOMAINS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void initMaximalVmMemSize32OS ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaximalVmMemSize32OS ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; vmModel.set_MaxMemSize32 ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; } } , getHash ( ) ) ) ; }

Target:
public void setSerialNumberPolicy ( org.ovirt.engine.ui.uicommonweb.models.vms.SerialNumberPolicyModel value ) { this . serialNumberPolicy = value ; }
Source:
public void clusterWithNoServiceEnabled ( ) { createCommandWithNoService ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_AT_LEAST_ONE_SERVICE_MUST_BE_ENABLED ) ; }

Target:
public void clusterWithNoServiceEnabled ( ) { createCommandWithNoService ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_AT_LEAST_ONE_SERVICE_MUST_BE_ENABLED ) ; }
Source:
protected void unregisterLibvirtSecret ( ) { if ( ( getStorageDomain ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostsInStatusUp = getAllRunningVdssInPool ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hostsInStatusUp ) { org.ovirt.engine.core.bll.storage.CINDERStorageHelper.unregisterLibvirtSecrets ( getStorageDomain ( ) , vds , java.util.Collections.singletonList ( getParameters ( ) . getLibvirtSecret ( ) ) ) ; } } else { log.info ( "Libvirt secret '{}' hasn't been unregistered since storage domain '{}' is not Active" , getParameters ( ) . getLibvirtSecret ( ) . getId ( ) , getStorageDomain ( ) . getName ( ) ) ; } }

Target:
protected void unregisterLibvirtSecret ( ) { if ( ( getStorageDomain ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostsInStatusUp = getAllRunningVdssInPool ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hostsInStatusUp ) { org.ovirt.engine.core.bll.storage.connection.CINDERStorageHelper.unregisterLibvirtSecrets ( getStorageDomain ( ) , vds , java.util.Collections.singletonList ( getParameters ( ) . getLibvirtSecret ( ) ) ) ; } } else { log.info ( "Libvirt secret '{}' hasn't been unregistered since storage domain '{}' is not Active" , getParameters ( ) . getLibvirtSecret ( ) . getId ( ) , getStorageDomain ( ) . getName ( ) ) ; } }
Source:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void volumeType_SelectedItemChanged ( ) { if ( ( ( ( getVolumeType ( ) . getSelectedItem ( ) ) == null ) || ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) ) || ( ( getStorageDomain ( ) . getSelectedItem ( ) ) == null ) ) { return ; } org.ovirt.engine.core.common.businessentities.VolumeType volumeType = getVolumeType ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.StorageType storageType = getStorageDomain ( ) . getSelectedItem ( ) . getStorageType ( ) ; updateVolumeFormat ( volumeType , storageType ) ; updateShareable ( volumeType , storageType ) ; }

Target:
protected void volumeType_SelectedItemChanged ( ) { if ( ( ( ( getVolumeType ( ) . getSelectedItem ( ) ) == null ) || ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) ) || ( ( getStorageDomain ( ) . getSelectedItem ( ) ) == null ) ) { return ; } org.ovirt.engine.core.common.businessentities.storage.VolumeType volumeType = getVolumeType ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.storage.StorageType storageType = getStorageDomain ( ) . getSelectedItem ( ) . getStorageType ( ) ; updateShareable ( volumeType , storageType ) ; }
Source:
private boolean isOptionEnabledOnVolume ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , org.ovirt.engine.core.common.utils.ListUtils.PredicateFilter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > predicate ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > filteredOptions = new java.util.ArrayList ( volume.getOptions ( ) ) ; filteredOptions = org.ovirt.engine.core.common.utils.ListUtils.filter ( filteredOptions , predicate ) ; return ! ( filteredOptions.isEmpty ( ) ) ; }

Target:
private boolean isOptionEnabledOnVolume ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > predicate ) { return ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( volume.getOptions ( ) , predicate ) ) != null ; }
Source:
private static java.lang.String getPciRealloc ( org.ovirt.engine.core.common.utils.CpuVendor cpuVendor , boolean pciRealloc ) { if ( ! pciRealloc ) { return "" ; } switch ( cpuVendor ) { case AMD : case INTEL : return "pci=realloc " ; case IBM : return "" ; default : throw new java.lang.RuntimeException ( ( "Unknown CpuType: " + cpuVendor ) ) ; } }

Target:
private static java.lang.String getPciRealloc ( org.ovirt.engine.core.common.utils.CpuVendor cpuVendor , boolean pciRealloc ) { if ( ! pciRealloc ) { return "" ; } switch ( cpuVendor ) { case AMD : case INTEL : return "pci=realloc " ; case IBM : case IBMS390 : return "" ; default : throw new java.lang.RuntimeException ( ( "Unknown CpuType: " + cpuVendor ) ) ; } }
Source:
public void PostOnSaveInternal ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { Cancel ( ) ; if ( model.getIsNew ( ) ) { setGuideContext ( returnValue.getActionReturnValue ( ) ) ; UpdateActionAvailability ( ) ; getGuideCommand ( ) . Execute ( ) ; } } }

Target:
public void postOnSaveInternal ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; if ( model.getIsNew ( ) ) { setGuideContext ( returnValue.getActionReturnValue ( ) ) ; updateActionAvailability ( ) ; getGuideCommand ( ) . execute ( ) ; } } }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getNonEmptyDiskList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage newDiskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskList.add ( newDiskImage ) ; return diskList ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getNonEmptyDiskList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage newDiskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; newDiskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ; diskList.add ( newDiskImage ) ; return diskList ; }
Source:
public void onResponseReceived ( com.google.gwt.http.client.Request request , com.google.gwt.http.client.Response response ) { try { if ( ( ( response.getStatusCode ( ) ) == ( com.google.gwt.http.client.Response.SC_OK ) ) && ( org.ovirt.engine.ui.uicompat.ReportParser.getInstance ( ) . parseReport ( response.getText ( ) ) ) ) { resourceMap = org.ovirt.engine.ui.uicompat.ReportParser.getInstance ( ) . getResourceMap ( ) ; dashboardMap = org.ovirt.engine.ui.uicompat.ReportParser.getInstance ( ) . getDashboardMap ( ) ; isCommunityEdition = org.ovirt.engine.ui.uicompat.ReportParser.getInstance ( ) . isCommunityEdition ( ) ; } } catch ( com.google.gwt.xml.client.impl.DOMParseException e ) { } finally { setXmlInitialized ( ) ; } }

Target:
public void onResponseReceived ( com.google.gwt.http.client.Request request , com.google.gwt.http.client.Response response ) { if ( ( response.getStatusCode ( ) ) == ( com.google.gwt.http.client.Response.SC_OK ) ) { reportsWebappDeployed = true ; parseReportsXML ( ) ; } }
Source:
private void PostInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.Guid.Empty ) ) ) ) ; }

Target:
private void PostInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.Guid.Empty ) ) ) ) ; }
Source:
public void addQuotaPermissionSubject ( java.util.List < org.ovirt.engine.core.common.PermissionSubject > quotaPermissionList ) { if ( ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) ) != null ) && ( ( getQuotaId ( ) ) != null ) ) && ( ! ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) . getQuotaEnforcementType ( ) . equals ( QuotaEnforcementTypeEnum.DISABLED ) ) ) ) { if ( canPerformQuotaValidation ( ) ) { quotaPermissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( getQuotaId ( ) , org.ovirt.engine.core.common.VdcObjectType.Quota , org.ovirt.engine.core.common.businessentities.ActionGroup.CONSUME_QUOTA ) ) ; } } }

Target:
public void addQuotaPermissionSubject ( java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > quotaPermissionList ) { if ( ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) ) != null ) && ( ( getQuotaId ( ) ) != null ) ) && ( ! ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) . getQuotaEnforcementType ( ) . equals ( QuotaEnforcementTypeEnum.DISABLED ) ) ) ) { if ( canPerformQuotaValidation ( ) ) { quotaPermissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getQuotaId ( ) , org.ovirt.engine.core.common.VdcObjectType.Quota , org.ovirt.engine.core.common.businessentities.ActionGroup.CONSUME_QUOTA ) ) ; } } }
Source:
protected org.ovirt.engine.core.common.businessentities.VM getVmFromConfiguration ( ) { org.ovirt.engine.core.common.businessentities.VM result = null ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshot.getId ( ) ) ) ; if ( queryReturnValue.getSucceeded ( ) ) { result = queryReturnValue.getReturnValue ( ) ; } return result ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM getVmFromConfiguration ( ) { org.ovirt.engine.core.common.businessentities.VM result = null ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshot.getId ( ) ) ) ; if ( queryReturnValue.getSucceeded ( ) ) { result = queryReturnValue.getReturnValue ( ) ; } return result ; }
Source:
public void onSuccess ( java.lang.Boolean isNameUnique ) { if ( ! isNameUnique ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel VmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( getWindow ( ) ) ) ; VmModel.getInvalidityReasons ( ) . clear ( ) ; VmModel.getName ( ) . getInvalidityReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . nameMustBeUniqueInvalidReason ( ) ) ; VmModel.getName ( ) . setIsValid ( false ) ; VmModel.setIsValid ( false ) ; VmModel.fireValidationCompleteEvent ( ) ; } else { postNameUniqueCheck ( ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.VM result ) { org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel runOnceModel = new org.ovirt.engine.ui.uicommonweb.models.vms.WebadminRunOnceModel ( result , this ) ; setWindow ( runOnceModel ) ; runOnceModel.init ( ) ; }
Source:
public void validateVmMemoryCanStartOnVdsVmTooBigButLowOverhead ( ) { vm.setMinAllocatedMem ( 8865 ) ; vm.setVmMemSizeMb ( 8865 ) ; vds.setGuestOverhead ( 0 ) ; boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertEquals ( vmPassedMemoryRequirement , true ) ; }

Target:
public void validateVmMemoryCantStartOnVdsVmTooBig ( ) { vm.setMinAllocatedMem ( 8865 ) ; vm.setVmMemSizeMb ( 8865 ) ; boolean vmPassedMemoryRequirement = slaValidator.hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertFalse ( vmPassedMemoryRequirement ) ; }
Source:
public void rollbackQuota ( ) { if ( canPerformQuotaValidation ( ) ) { org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . rollbackQuota ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) , org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . getQuotaListFromParameters ( getOldStorageQuotaListParameters ( ) ) ) ; org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . rollbackQuota ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) , org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . getQuotaListFromParameters ( getUpdatedStorageQuotaListParameters ( ) ) ) ; } }

Target:
public org.ovirt.engine.core.compat.Guid getQuotaId ( ) { if ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskInfo ( ) ) != null ) && ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) == ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) ) ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getQuotaId ( ) ; } return null ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isReadOnlyPropertyCompatibleWithInterface ( ) { if ( java.lang.Boolean.TRUE.equals ( disk.getReadOnly ( ) ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface = diskVmElement.getDiskInterface ( ) ; if ( diskInterface == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.IDE ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR , java.lang.String.format ( "$interface %1$s" , diskInterface ) ) ; } if ( disk.isScsiPassthrough ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.SCSI_PASSTHROUGH_IS_NOT_SUPPORTED_FOR_READ_ONLY_DISK ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isReadOnlyPropertyCompatibleWithInterface ( ) { if ( java.lang.Boolean.TRUE.equals ( diskVmElement.isReadOnly ( ) ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface = diskVmElement.getDiskInterface ( ) ; if ( diskInterface == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.IDE ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR , java.lang.String.format ( "$interface %1$s" , diskInterface ) ) ; } if ( disk.isScsiPassthrough ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.SCSI_PASSTHROUGH_IS_NOT_SUPPORTED_FOR_READ_ONLY_DISK ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity insertTestSnapshot ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity ( ) ; snapshot.setSnapshotId ( snapshotId ) ; snapshot.setClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.CLUSTER_ID ) ; snapshot.setSnapshotName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.NEW_SNAPSHOT_NAME ) ; snapshot.setVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; snapshot.setDescription ( "test-description" ) ; snapshot.setStatus ( GlusterSnapshotStatus.STARTED ) ; snapshot.setCreatedAt ( new java.util.Date ( ) ) ; dao.save ( snapshot ) ; return snapshot ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity insertTestSnapshot ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity ( ) ; snapshot.setSnapshotId ( snapshotId ) ; snapshot.setClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.CLUSTER_ID ) ; snapshot.setSnapshotName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.NEW_SNAPSHOT_NAME ) ; snapshot.setVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; snapshot.setDescription ( "test-description" ) ; snapshot.setStatus ( GlusterSnapshotStatus.ACTIVATED ) ; snapshot.setCreatedAt ( new java.util.Date ( ) ) ; dao.save ( snapshot ) ; return snapshot ; }
Source:
protected abstract void setDefaultInterface ( ) ;

Target:
public void setDefaultInterface ( ) { org.ovirt.engine.core.compat.Guid vmId = getVmId ( ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( vmId ) ) { getDiskInterface ( ) . setSelectedItem ( DiskInterface.VirtIO ) ; } else { getDiskInterface ( ) . setSelectedItem ( getDisk ( ) . getDiskVmElementForVm ( vmId ) . getDiskInterface ( ) ) ; } }
Source:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public static void getStorageDomainListByTemplate ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public void sendMessage ( byte [ ] message ) { send ( new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . send ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_DESTINATION , this . getRequestQueue ( ) ) . withContent ( message ) . build ( ) ) ; }

Target:
public void sendMessage ( byte [ ] message ) { send ( new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . send ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_DESTINATION , this . getRequestQueue ( ) ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_REPLY_TO , getResponseQueue ( ) ) . withContent ( message ) . build ( ) ) ; }
Source:
public void getDiskSnapshotForVmSnapshotSameSnapshot ( ) { org.ovirt.engine.core.common.businessentities.DiskImage result = dao.getDiskSnapshotForVmSnapshot ( existingEntity.getId ( ) , existingEntity.getVmSnapshotId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingEntity.getId ( ) , result.getId ( ) ) ; org.junit.Assert.assertEquals ( existingEntity.getVmSnapshotId ( ) , result.getVmSnapshotId ( ) ) ; }

Target:
public void getDiskSnapshotForVmSnapshotSameSnapshot ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage result = dao.getDiskSnapshotForVmSnapshot ( existingEntity.getId ( ) , existingEntity.getVmSnapshotId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingEntity.getId ( ) , result.getId ( ) ) ; org.junit.Assert.assertEquals ( existingEntity.getVmSnapshotId ( ) , result.getVmSnapshotId ( ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { setWindow ( null ) ; setGuideContext ( returnValue.getActionReturnValue ( ) ) ; updateActionAvailability ( ) ; getGuideCommand ( ) . execute ( ) ; } else { cancel ( ) ; } super . executed ( result ) ; }

Target:
protected void selectedItemsChanged ( ) { super . selectedItemsChanged ( ) ; updateActionsAvailability ( ) ; }
Source:
public java.lang.String getStringRepresentation ( ) { if ( ! ( valid ) ) { return null ; } java.lang.String authority = "" ; authority += host ; if ( ! ( port.isEmpty ( ) ) ) { authority += ':' + ( port ) ; } return authority ; }

Target:
public java.lang.String getStringRepresentation ( ) { if ( ! ( valid ) ) { return null ; } java.lang.String authority = org.ovirt.engine.ui.uicommonweb.UriAuthority.EMPTY_STRING ; authority += host ; if ( ! ( port.isEmpty ( ) ) ) { authority += ( org.ovirt.engine.ui.uicommonweb.UriAuthority.COLON ) + ( port ) ; } return authority ; }
Source:
private static java.lang.String TranslateBoolValue ( java.lang.String value ) { java.lang.String result ; if ( ( value.equalsIgnoreCase ( org.ovirt.engine.core.utils.pm.VdsFencingOptions.TRUE_STRING ) ) || ( value.equalsIgnoreCase ( org.ovirt.engine.core.utils.pm.VdsFencingOptions.FALSE_STRING ) ) ) { if ( java.lang.Boolean.parseBoolean ( value ) ) { result = org.ovirt.engine.core.utils.pm.VdsFencingOptions.YES ; } else { result = org.ovirt.engine.core.utils.pm.VdsFencingOptions.NO ; } } else { result = value ; } return result ; }

Target:
private static java.lang.String TranslateBoolValue ( java.lang.String value ) { java.lang.String result ; if ( ( value.equalsIgnoreCase ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.TRUE_STRING ) ) || ( value.equalsIgnoreCase ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.FALSE_STRING ) ) ) { if ( java.lang.Boolean.parseBoolean ( value ) ) { result = org.ovirt.engine.core.utils.pm.VdsFenceOptions.YES ; } else { result = org.ovirt.engine.core.utils.pm.VdsFenceOptions.NO ; } } else { result = value ; } return result ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { deactivate ( ) ; java.util.List < java.lang.String > consoleDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; activate ( ) ; updateWatchdog ( vmBase ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { deactivate ( ) ; java.util.List < java.lang.String > consoleDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; activate ( ) ; postDoUpdateManagedFieldsFrom ( vmBase ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getBroker ( ) . disconnectStoragePool ( org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getParameters ( ) . getvds_spm_id ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getBroker ( ) . disconnectStoragePool ( org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getParameters ( ) . getVdsSpmId ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public void validateVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { initStorageDomain ( srcStorageId ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToAnyNonDownVm ( org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }

Target:
public void validateVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { initStorageDomain ( srcStorageId ) ; initStorageDomain ( dstStorageId ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToAnyNonDownVm ( org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }
Source:
public void testListGlobalLimit ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaCluster ( getClusterGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; org.ovirt.engine.api.model.QuotaClusterLimits clusterLimits = collection.list ( ) ; assertClusterLimitsFound ( clusterLimits , 1 ) ; org.ovirt.engine.api.model.QuotaClusterLimit clusterLimit = clusterLimits.getQuotaClusterLimits ( ) . get ( 0 ) ; assertEquals ( 20 , clusterLimit.getVcpuLimit ( ) . intValue ( ) ) ; }

Target:
public void testListGlobalLimit ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaCluster ( getClusterGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; org.ovirt.engine.api.model.QuotaClusterLimits clusterLimits = collection.list ( ) ; assertClusterLimitsFound ( clusterLimits , 1 ) ; org.ovirt.engine.api.model.QuotaClusterLimit clusterLimit = clusterLimits.getQuotaClusterLimits ( ) . get ( 0 ) ; org.junit.Assert.assertEquals ( 20 , clusterLimit.getVcpuLimit ( ) . intValue ( ) ) ; }
Source:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworksResourceTest.DATA_CENTER_ID } , getEntityList ( ) , failure ) ; } }

Target:
private java.util.List < org.ovirt.engine.api.model.Network > getEntityList ( ) { java.util.List < org.ovirt.engine.api.model.Network > entities = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } return entities ; }
Source:
protected java.lang.Long getRawValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { if ( ( object.getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.RepoImage ) { return ( ( org.ovirt.engine.core.common.businessentities.RepoImage ) ( object.getEntity ( ) ) ) . getSize ( ) ; } else if ( ( object.getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.DiskImage ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object.getEntity ( ) ) ) . getSizeInGigabytes ( ) ; } return null ; }

Target:
protected java.lang.Long getRawValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { if ( ( object.getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.storage.RepoImage ) { return ( ( org.ovirt.engine.core.common.businessentities.storage.RepoImage ) ( object.getEntity ( ) ) ) . getSize ( ) ; } else if ( ( object.getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.storage.DiskImage ) { return ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object.getEntity ( ) ) ) . getSizeInGigabytes ( ) ; } return null ; }
Source:
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 ) ) . intValue ( ) : 1000 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVmsInPool , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClustersByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }