auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean isCurrentTaskLookedFor ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.bll.tasks.SPMAsyncTask task ) { return ( ( ( task instanceof org.ovirt.engine.core.bll.tasks.CommandAsyncTask ) && ( id.equals ( task.getParameters ( ) . getEntityInfo ( ) . getId ( ) ) ) ) && ( ( task.getState ( ) ) != ( AsyncTaskState.Cleared ) ) ) && ( ( task.getState ( ) ) != ( AsyncTaskState.ClearFailed ) ) ; }

Target:
private boolean isCurrentTaskLookedFor ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task ) { return ( ( ( task instanceof org.ovirt.engine.core.bll.tasks.CommandAsyncTask ) && ( id.equals ( task.getParameters ( ) . getEntityInfo ( ) . getId ( ) ) ) ) && ( ( task.getState ( ) ) != ( AsyncTaskState.Cleared ) ) ) && ( ( task.getState ( ) ) != ( AsyncTaskState.ClearFailed ) ) ; }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId ) , aQuery ) ; }

Target:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId , filterOutExistingHosts , searchFilter ) , aQuery ) ; }
Source:
public void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( 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.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void validateImageNotFound ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void moveShareableDiskToGlusterDomain ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }
Source:
private void changeRawToCowIfSparseOnBlockDevice ( org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.core.common.businessentities.DiskImage image ) { if ( ( ( storageType.isBlockDomain ( ) ) && ( ( image.getVolumeFormat ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ) ) ) && ( ( image.getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { image.setvolumeFormat ( VolumeFormat.COW ) ; } }

Target:
private void changeRawToCowIfSparseOnBlockDevice ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { if ( ( ( storageType.isBlockDomain ( ) ) && ( ( image.getVolumeFormat ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.RAW ) ) ) && ( ( image.getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Sparse ) ) ) { image.setvolumeFormat ( VolumeFormat.COW ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > getAllForVm ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userId , boolean filtered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , id ) . addValue ( "user_id" , userId ) . addValue ( "is_filtered" , filtered ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > results = getCallsHandler ( ) . executeReadList ( "GetVmNetworkInterfaceViewByVmId" , org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoImpl.VmNetworkInterfaceRowMapper.INSTANCE , parameterSource ) ; java.util.Collections.sort ( results , new org.ovirt.engine.core.common.businessentities.comparators.InterfaceComparerByMAC ( ) ) ; return results ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > getAllForVm ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userId , boolean filtered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , id ) . addValue ( "user_id" , userId ) . addValue ( "is_filtered" , filtered ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > results = getCallsHandler ( ) . executeReadList ( "GetVmNetworkInterfaceViewByVmId" , org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoImpl.VmNetworkInterfaceRowMapper.INSTANCE , parameterSource ) ; java.util.Collections.sort ( results , java.util.Comparator.comparing ( VmNetworkInterface :: getMacAddress ) ) ; return results ; }
Source:
private void updateController ( ) { this . controller = modelProvider.getModel ( ) ; org.ovirt.engine.ui.uicommonweb.models.GridTimer modelTimer = getModelTimer ( ) ; modelTimer.setRefreshRate ( readRefreshRate ( ) ) ; modelTimer.addValueChangeHandler ( new com.google.gwt.event.logical.shared.ValueChangeHandler < java.lang.String > ( ) { @ java.lang.Override public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { onRefresh ( event.getValue ( ) ) ; } } ) ; }

Target:
public void setCurrentRefreshRate ( int newRefreshRate ) { saveRefreshRate ( newRefreshRate ) ; getModelTimer ( ) . setRefreshRate ( readRefreshRate ( ) ) ; updateTimer ( ) ; }
Source:
protected org.ovirt.engine.api.model.StorageDomain map ( org.ovirt.engine.core.common.businessentities.storage_domains entity , org.ovirt.engine.api.model.StorageDomain template ) { org.ovirt.engine.api.model.StorageDomain model = super . map ( entity , template ) ; if ( ! ( isFiltered ( ) ) ) { switch ( entity.getstorage_type ( ) ) { case ISCSI : mapVolumeGroupIscsi ( model , entity ) ; break ; case FCP : mapVolumeGroupFcp ( model , entity ) ; break ; case NFS : case LOCALFS : case POSIXFS : mapNfsOrLocalOrPosix ( model , entity ) ; break ; } } return model ; }

Target:
protected org.ovirt.engine.api.model.StorageDomain map ( org.ovirt.engine.api.model.StorageDomain entity , org.ovirt.engine.api.model.StorageDomain template ) { org.ovirt.engine.api.model.StorageDomain model = super . map ( entity , template ) ; if ( ! ( isFiltered ( ) ) ) { switch ( entity.getStorageType ( ) ) { case ISCSI : mapVolumeGroupIscsi ( model , entity ) ; break ; case FCP : mapVolumeGroupFcp ( model , entity ) ; break ; case NFS : case LOCALFS : case POSIXFS : mapNfsOrLocalOrPosix ( model , entity ) ; break ; } } return model ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > createDiskImageList ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setImageId ( diskImageId ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( storageDomainId ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImageList = new java.util.ArrayList < > ( ) ; diskImageList.add ( disk ) ; return diskImageList ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > createDiskImageList ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setImageId ( diskImageId ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( storageDomainId ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImageList = new java.util.ArrayList < > ( ) ; diskImageList.add ( disk ) ; return diskImageList ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getView ( ) . toggleProfilesVisibility ( ( ( java.lang.Boolean ) ( model.getIsVmNetwork ( ) . getEntity ( ) ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "IsAvailable" . equals ( ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ) ) { getView ( ) . toggleProfilesVisibility ( model.getProfiles ( ) . getIsAvailable ( ) ) ; } }
Source:
protected org.ovirt.engine.core.bll.ValidationResult mtuValid ( ) { return ( ( getNetwork ( ) . getMtu ( ) ) == 0 ) || ( org.ovirt.engine.core.bll.validator.FeatureSupported.mtuSpecification ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getStoragePool ( ) . getcompatibility_version ( ) ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_MTU_OVERRIDE_NOT_SUPPORTED ) ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult mtuValid ( ) { return ( ( getNetwork ( ) . getMtu ( ) ) == 0 ) || ( org.ovirt.engine.core.common.FeatureSupported.mtuSpecification ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getStoragePool ( ) . getcompatibility_version ( ) ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_MTU_OVERRIDE_NOT_SUPPORTED ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc shutdown ( java.lang.String vmId , java.lang.String timeout , java.lang.String message , boolean reboot ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.shutdown" ) . withParameter ( "vmID" , vmId ) . withOptionalParameter ( "delay" , timeout ) . withOptionalParameter ( "message" , message ) . withParameter ( "reboot" , reboot ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn shutdown ( java.lang.String vmId , java.lang.String timeout , java.lang.String message , boolean reboot ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.shutdown" ) . withParameter ( "vmID" , vmId ) . withOptionalParameter ( "delay" , timeout ) . withOptionalParameter ( "message" , message ) . withParameter ( "reboot" , reboot ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public void testRetryWithDifferentException ( ) throws java.lang.Exception { java.util.concurrent.Callable < java.lang.Object > callable = org.mockito.Mockito.mock ( java.util.concurrent.Callable.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy policy = new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy ( 5 , 3 , 10 , java.lang.IllegalArgumentException.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable < java.lang.Object > retryable = new org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable ( callable , policy ) ; org.mockito.Mockito.stub ( callable.call ( ) ) . toThrow ( new java.io.IOException ( ) ) ; retryable.call ( ) ; }

Target:
public void testRetryWithDifferentException ( ) throws java.lang.Exception { java.util.concurrent.Callable < java.lang.Object > callable = org.mockito.Mockito.mock ( java.util.concurrent.Callable.class ) ; org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy policy = new org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy ( 5 , 3 , 10 , java.lang.IllegalArgumentException.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable < java.lang.Object > retryable = new org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable ( callable , policy ) ; org.mockito.Mockito.stub ( callable.call ( ) ) . toThrow ( new java.io.IOException ( ) ) ; retryable.call ( ) ; }
Source:
public org.ovirt.engine.api.model.Tags list ( ) { org.ovirt.engine.api.model.Tags ret = new org.ovirt.engine.api.model.Tags ( ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : getCollection ( ) ) { ret.getTags ( ) . add ( addLinks ( populate ( map ( tag ) , tag ) ) ) ; } return ret ; }

Target:
public org.ovirt.engine.core.common.businessentities.Tags list ( ) { org.ovirt.engine.core.common.businessentities.Tags ret = new org.ovirt.engine.core.common.businessentities.Tags ( ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : getCollection ( ) ) { ret.getTags ( ) . add ( addLinks ( populate ( map ( tag ) , tag ) ) ) ; } return ret ; }
Source:
public java.util.List < org.ovirt.engine.core.compat.Guid > runFilters ( java.util.List < java.lang.String > filterNames , java.util.List < org.ovirt.engine.core.compat.Guid > hostIDs , org.ovirt.engine.core.compat.Guid vmID , java.util.Map < java.lang.String , java.lang.String > propertiesMap ) { try { org.apache.xmlrpc.client.XmlRpcClient client = new org.apache.xmlrpc.client.XmlRpcClient ( ) ; client.setConfig ( config ) ; java.lang.Object result = client.execute ( org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.FILTER , createFilterArgs ( filterNames , hostIDs , vmID , propertiesMap ) ) ; return parseFilterResults ( result ) ; } catch ( org.apache.xmlrpc.XmlRpcException e ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.log.error ( ( "Could not communicate with the external scheduler while filtering " + e ) ) ; return null ; } }

Target:
public java.util.List < org.ovirt.engine.core.compat.Guid > runFilters ( java.util.List < java.lang.String > filterNames , java.util.List < org.ovirt.engine.core.compat.Guid > hostIDs , org.ovirt.engine.core.compat.Guid vmID , java.util.Map < java.lang.String , java.lang.String > propertiesMap ) { try { org.apache.xmlrpc.client.XmlRpcClient client = new org.apache.xmlrpc.client.XmlRpcClient ( ) ; client.setConfig ( config ) ; java.lang.Object result = client.execute ( org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.FILTER , createFilterArgs ( filterNames , hostIDs , vmID , propertiesMap ) ) ; return parseFilterResults ( result ) ; } catch ( org.apache.xmlrpc.XmlRpcException e ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.log.error ( "Could not communicate with the external scheduler while filtering" , e ) ; return hostIDs ; } }
Source:
private void rollBackQuota ( ) { if ( ! ( org.ovirt.engine.core.bll.CommandBase.isInternalExecution ( ) ) ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > consumptionParameters = getQuotaConsumptionParameters ( ) ; if ( consumptionParameters != null ) { for ( org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter parameter : consumptionParameters ) { getQuotaManager ( ) . removeQuotaFromCache ( org.ovirt.engine.core.bll.CommandBase.getStoragePool ( ) . getId ( ) , parameter.getQuotaGuid ( ) ) ; } } } }

Target:
private void rollbackQuota ( ) { if ( isQuotaChanged ( ) ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > consumptionParameters = getQuotaConsumptionParameters ( ) ; if ( consumptionParameters != null ) { for ( org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter parameter : consumptionParameters ) { getQuotaManager ( ) . removeQuotaFromCache ( org.ovirt.engine.core.bll.CommandBase.getStoragePool ( ) . getId ( ) , parameter.getQuotaGuid ( ) ) ; } } } }
Source:
public void testValidateModifiedBondSlaves_whenSlaveIsNotValid ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidateModifiedBondSlaves ( bond , null , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) , false , VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveIsNotValid ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ) ; }
Source:
private void mockDiskImageDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > diskImageList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setstorage_ids ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ) ) ; diskImageList.add ( diskImage ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( spyCommand ) . getDiskDAO ( ) ; org.mockito.Mockito.when ( diskDao.getAllForVm ( vmId ) ) . thenReturn ( diskImageList ) ; }

Target:
private void mockDiskImageDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > diskImageList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setstorage_ids ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ) ) ; diskImageList.add ( diskImage ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( spyCommand ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.getAllForVm ( vmId ) ) . thenReturn ( diskImageList ) ; }
Source:
protected void InitDetailModels ( ) { super . InitDetailModels ( ) ; org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; setDetailModels ( list ) ; }

Target:
protected void InitDetailModels ( ) { super . InitDetailModels ( ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; setDetailModels ( list ) ; }
Source:
public void shouldValidateSingleNodePinning ( ) { vm.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }

Target:
public void shouldValidateSingleNodePinning ( ) { vm.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 0 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }
Source:
public void getDbGroupsByUserId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.aaa.DbGroup > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.aaa.DbGroup > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.DbGroup > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDbGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
private void getIrsImageList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean forceRefresh , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageFileType , org.ovirt.engine.ui.frontend.IAsyncConverter converterCallBack ) { aQuery.converterCallback = converterCallBack ; org.ovirt.engine.core.common.queries.GetImagesListByStoragePoolIdParameters parameters = new org.ovirt.engine.core.common.queries.GetImagesListByStoragePoolIdParameters ( storagePoolId , imageFileType ) ; parameters.setForceRefresh ( forceRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetImagesListByStoragePoolId , parameters , aQuery ) ; }
Source:
public void getGlusterVolumeGeoRepStatusForMasterVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId ) { 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.GlusterGeoRepSession > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeGeoRepSessions , new org.ovirt.engine.core.common.queries.IdQueryParameters ( masterVolumeId ) , aQuery ) ; }

Target:
public void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public void canDoActionFailedVirtIODisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockSpiceSupportMatrix ( ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 0 ) ) . thenReturn ( "RHEL6" ) ; createNotVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED.toString ( ) ) ) ; }

Target:
public void canDoActionChecksIfHotPlugDiskSnapshotIsSupported ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; cretaeVirtIODisk ( ) ; initStorageDomain ( ) ; command.getParameters ( ) . setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command.canDoAction ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.times ( 1 ) ) . isHotPlugDiskSnapshotSupported ( ) ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success , java.lang.Object taskReturn , boolean replay ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , taskReturn , null , replay ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success , java.lang.Object taskReturn , boolean replay ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , taskReturn , null , replay , org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.CANT_DO ) ; }
Source:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { setPayload ( model ) ; setBallooning ( model ) ; setConsoleDevice ( model ) ; setVirtioScsiController ( model ) ; setCertificateInfo ( model ) ; setVmOvfConfiguration ( model , entity ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { setPayload ( model ) ; setBallooning ( model ) ; setConsoleDevice ( model ) ; setVirtioScsiController ( model ) ; setCertificateInfo ( model ) ; setVmOvfConfiguration ( model , entity ) ; setRngDevice ( model ) ; return model ; }
Source:
public java.lang.String getHeaderHtml ( ) { if ( ( getDefaultImage ( ) ) == null ) { return org.ovirt.engine.ui.common.widget.table.column.AbstractImageResourceColumn.CONSTANTS.empty ( ) ; } return org.ovirt.engine.ui.common.widget.table.column.AbstractImageResourceColumn.TEMPLATES.imageWithTitle ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( getDefaultImage ( ) ) . getHTML ( ) ) , getDefaultTitle ( ) ) . asString ( ) ; }

Target:
public java.lang.String getHeaderHtml ( ) { if ( ( getDefaultImage ( ) ) == null ) { return org.ovirt.engine.ui.common.widget.table.column.AbstractImageResourceColumn.constants.empty ( ) ; } return org.ovirt.engine.ui.common.widget.table.column.AbstractImageResourceColumn.templates.headerImage ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( getDefaultImage ( ) ) . getHTML ( ) ) ) . asString ( ) ; }
Source:
public void setUp ( ) { super . setUp ( ) ; cmd.getParameters ( ) . setSourceRepoImageId ( getRepoImageId ( ) ) ; cmd.getParameters ( ) . setSourceStorageDomainId ( getRepoStorageDomainId ( ) ) ; cmd.getParameters ( ) . setStoragePoolId ( getStoragePoolId ( ) ) ; cmd.getParameters ( ) . setStorageDomainId ( getStorageDomainId ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateSpaceRequirements ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }

Target:
public void setUp ( ) { super . setUp ( ) ; cmd.getParameters ( ) . setSourceRepoImageId ( repoImageId ) ; cmd.getParameters ( ) . setSourceStorageDomainId ( repoStorageDomainId ) ; cmd.getParameters ( ) . setStoragePoolId ( storagePoolId ) ; cmd.getParameters ( ) . setStorageDomainId ( storageDomainId ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateSpaceRequirements ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }
Source:
private void updateShareable ( org.ovirt.engine.core.common.businessentities.storage.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { if ( ( storageType.isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Sparse ) ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.shareableDiskNotSupportedByConfiguration ( ) ) ; getIsShareable ( ) . setIsChangable ( false ) ; getIsShareable ( ) . setEntity ( false ) ; } else { getIsShareable ( ) . setIsChangable ( isEditEnabled ( ) ) ; } }

Target:
private void updateShareable ( org.ovirt.engine.core.common.businessentities.storage.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { if ( ( storageType.isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Sparse ) ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.shareableDiskNotSupportedByConfiguration ( ) ) ; getIsShareable ( ) . setIsChangeable ( false ) ; getIsShareable ( ) . setEntity ( false ) ; } else { getIsShareable ( ) . setIsChangeable ( isEditEnabled ( ) ) ; } }
Source:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private boolean validateSpaceRequirements ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator ( storageDomain ) ; return ( storageDomainValidator.isDomainWithinThresholds ( ) . isValid ( ) ) && ( storageDomainValidator.hasSpaceForClonedDisks ( disksList ) . isValid ( ) ) ; }

Target:
private boolean validateSpaceRequirements ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = getStorageDomainValidator ( storageDomain ) ; return ( storageDomainValidator.isDomainWithinThresholds ( ) . isValid ( ) ) && ( storageDomainValidator.hasSpaceForClonedDisks ( disksList ) . isValid ( ) ) ; }
Source:
private org.ovirt.engine.api.model.KatelloErrata mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.Erratum > entities ) { org.ovirt.engine.api.model.KatelloErrata collection = new org.ovirt.engine.api.model.KatelloErrata ( ) ; for ( org.ovirt.engine.core.common.businessentities.Erratum entity : entities ) { collection.getKatelloErrata ( ) . add ( addLinks ( populate ( map ( entity ) , entity ) ) ) ; } return collection ; }

Target:
private org.ovirt.engine.api.model.KatelloErrata mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.Erratum > entities ) { org.ovirt.engine.api.model.KatelloErrata collection = new org.ovirt.engine.api.model.KatelloErrata ( ) ; for ( org.ovirt.engine.core.common.businessentities.Erratum entity : entities ) { collection.getKatelloErrata ( ) . add ( addLinks ( populate ( map ( entity ) , entity ) , org.ovirt.engine.api.model.Host.class ) ) ; } return collection ; }
Source:
public void getClasses ( ) throws java.io.IOException , java.lang.ClassNotFoundException { java.util.List < java.lang.Class < ? > > classes = org.ovirt.engine.api.utils.ReflectionHelper.getClasses ( org.ovirt.engine.api.utils.ReflectionHelper.class . getPackage ( ) . getName ( ) ) ; junit.framework.Assert.assertFalse ( "ReflectionHelper's package can not be empty since at least Reflectionhelper is in it" , classes.isEmpty ( ) ) ; junit.framework.Assert.assertTrue ( "ReflectionHelper's should be in it's own package" , classes.contains ( org.ovirt.engine.api.utils.ReflectionHelper.class ) ) ; }

Target:
public void getClasses ( ) throws java.io.IOException , java.lang.ClassNotFoundException { java.util.List < java.lang.Class < ? > > classes = org.ovirt.engine.api.utils.ReflectionHelper.getClasses ( org.ovirt.engine.api.utils.ReflectionHelper.class . getPackage ( ) . getName ( ) ) ; org.junit.Assert.assertFalse ( "ReflectionHelper's package can not be empty since at least Reflectionhelper is in it" , classes.isEmpty ( ) ) ; org.junit.Assert.assertTrue ( "ReflectionHelper's should be in it's own package" , classes.contains ( org.ovirt.engine.api.utils.ReflectionHelper.class ) ) ; }
Source:
private static org.apache.commons.httpclient.HttpClient createHttpClient ( int clientRetries ) { org.apache.commons.httpclient.HttpClient client = new org.apache.commons.httpclient.HttpClient ( new org.apache.commons.httpclient.MultiThreadedHttpConnectionManager ( ) ) ; int retries = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.vdsRetries ) ; org.apache.commons.httpclient.HttpMethodRetryHandler handler = new org.apache.commons.httpclient.DefaultHttpMethodRetryHandler ( retries , false ) ; org.apache.commons.httpclient.params.HttpClientParams parameters = client.getParams ( ) ; parameters.setParameter ( HttpMethodParams.RETRY_HANDLER , handler ) ; return client ; }

Target:
private static org.apache.commons.httpclient.HttpClient createHttpClient ( int clientRetries , int connectionTimeout ) { org.apache.commons.httpclient.params.HttpConnectionManagerParams params = new org.apache.commons.httpclient.params.HttpConnectionManagerParams ( ) ; params.setConnectionTimeout ( connectionTimeout ) ; org.apache.commons.httpclient.MultiThreadedHttpConnectionManager httpConnectionManager = new org.apache.commons.httpclient.MultiThreadedHttpConnectionManager ( ) ; httpConnectionManager.setParams ( params ) ; org.apache.commons.httpclient.HttpClient client = new org.apache.commons.httpclient.HttpClient ( httpConnectionManager ) ; int retries = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.vdsRetries ) ; org.apache.commons.httpclient.HttpMethodRetryHandler handler = new org.apache.commons.httpclient.DefaultHttpMethodRetryHandler ( retries , false ) ; org.apache.commons.httpclient.params.HttpClientParams parameters = client.getParams ( ) ; parameters.setParameter ( HttpMethodParams.RETRY_HANDLER , handler ) ; return client ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetNicsExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplateInterface , org.ovirt.engine.core.common.action.RemoveVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateNicResourceTest.TEMPLATE_ID , org.ovirt.engine.api.restapi.resource.BackendTemplateNicResourceTest.NIC_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetNicsExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmTemplateInterface , org.ovirt.engine.core.common.action.RemoveVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateNicResourceTest.TEMPLATE_ID , org.ovirt.engine.api.restapi.resource.BackendTemplateNicResourceTest.NIC_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public java.lang.String PriorityToString ( int value ) { java.lang.String priorityStr ; int highPriority = org.ovirt.engine.ui.uicommonweb.DataProvider.GetMaxVmPriority ( ) ; int roundedPriority = org.ovirt.engine.ui.uicommonweb.DataProvider.RoundPriority ( value ) ; if ( roundedPriority == 1 ) { priorityStr = "Low" ; } else if ( roundedPriority == ( highPriority / 2 ) ) { priorityStr = "Medium" ; } else if ( roundedPriority == highPriority ) { priorityStr = "High" ; } else { priorityStr = "Unknown" ; } return priorityStr ; }

Target:
public java.lang.String PriorityToString ( int value ) { java.lang.String priorityStr ; int highPriority = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetMaxVmPriority ( ) ; int roundedPriority = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.RoundPriority ( value ) ; if ( roundedPriority == 1 ) { priorityStr = "Low" ; } else if ( roundedPriority == ( highPriority / 2 ) ) { priorityStr = "Medium" ; } else if ( roundedPriority == highPriority ) { priorityStr = "High" ; } else { priorityStr = "Unknown" ; } return priorityStr ; }
Source:
public void setup ( ) { cluster1 = createCluster ( ) ; cluster2 = createCluster ( ) ; org.mockito.Mockito.when ( clusterDao.getWithoutMigratingVms ( ) ) . thenReturn ( java.util.Arrays.asList ( cluster1 , cluster2 ) ) ; org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.Matchers.eq ( cluster1 ) ) ) . thenReturn ( vm1 ) ; org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.Matchers.eq ( cluster2 ) ) ) . thenReturn ( vm2 ) ; arem.wakeup ( ) ; }

Target:
public void setup ( ) { cluster1 = createCluster ( ) ; cluster2 = createCluster ( ) ; org.mockito.Mockito.when ( clusterDao.getWithoutMigratingVms ( ) ) . thenReturn ( java.util.Arrays.asList ( cluster1 , cluster2 ) ) ; org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.ArgumentMatchers.eq ( cluster1 ) ) ) . thenReturn ( vm1 ) ; org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.ArgumentMatchers.eq ( cluster2 ) ) ) . thenReturn ( vm2 ) ; arem.wakeup ( ) ; }
Source:
protected void executeCommand ( ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.action.ManageNetworkClustersParameters > paramsByClusterId = mapParametersByClusterId ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.action.ManageNetworkClustersParameters > singleClusterInput : paramsByClusterId.entrySet ( ) ) { final org.ovirt.engine.core.compat.Guid clusterId = singleClusterInput.getKey ( ) ; if ( isSetupNetworkSupported ( clusterId ) ) { final org.ovirt.engine.core.common.action.ManageNetworkClustersParameters param = singleClusterInput.getValue ( ) ; processSingleClusterChanges ( param ) ; } } setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.action.ManageNetworkClustersParameters > paramsByClusterId = mapParametersByClusterId ( ) ; for ( org.ovirt.engine.core.common.action.ManageNetworkClustersParameters param : paramsByClusterId.values ( ) ) { processSingleClusterChanges ( param ) ; } setSucceeded ( true ) ; }
Source:
private void addSelectionHandler ( final com.google.gwt.user.client.ui.Button button ) { final com.google.gwt.view.client.MultiSelectionModel < org.ovirt.engine.ui.uicommonweb.models.EntityModel > selectionModel = getSelectionModelForButton ( button ) ; selectionModel.addSelectionChangeHandler ( new com.google.gwt.view.client.SelectionChangeEvent.Handler ( ) { @ java.lang.Override public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { button.setEnabled ( ( ! ( selectionModel.getSelectedSet ( ) . isEmpty ( ) ) ) ) ; } } ) ; }

Target:
private void addSelectionHandler ( boolean topTable ) { final com.google.gwt.view.client.MultiSelectionModel < org.ovirt.engine.ui.uicommonweb.models.EntityModel > selectionModel = getSelectionModel ( topTable ) ; final com.google.gwt.user.client.ui.ButtonBase button = getButton ( topTable ) ; selectionModel.addSelectionChangeHandler ( new com.google.gwt.view.client.SelectionChangeEvent.Handler ( ) { @ java.lang.Override public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { button.setEnabled ( ( ! ( selectionModel.getSelectedSet ( ) . isEmpty ( ) ) ) ) ; } } ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.LdapGroup getAdGroup ( ) { if ( ( ( mGroup ) == null ) && ( ! ( getGroupId ( ) . equals ( Guid.Empty ) ) ) ) { mGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAdGroupDao ( ) . get ( getGroupId ( ) ) ; } return mGroup ; }

Target:
protected org.ovirt.engine.core.common.businessentities.LdapGroup getAdGroup ( ) { if ( ( ( mGroup ) == null ) && ( ! ( getGroupId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.common.businessentities.DbGroup dbGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbGroupDao ( ) . get ( getGroupId ( ) ) ; mGroup = new org.ovirt.engine.core.common.businessentities.LdapGroup ( dbGroup ) ; } return mGroup ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( "GlusterVolumeSnapshotConfig {" ) ; sb.append ( "clusterId=" ) ; sb.append ( getClusterId ( ) ) ; sb.append ( ", volumeId=" ) ; sb.append ( getVolumeId ( ) ) ; sb.append ( ", paramName=" ) ; sb.append ( getParamName ( ) ) ; sb.append ( ", paramValue=" ) ; sb.append ( getParamValue ( ) ) ; sb.append ( "}" ) ; return sb.toString ( ) ; }

Target:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "clusterId" , getClusterId ( ) ) . append ( "volumeId" , getVolumeId ( ) ) . append ( "paramName" , getParamName ( ) ) . append ( "paramValue" , getParamValue ( ) ) . build ( ) ; }
Source:
protected void executeVdsIdCommand ( ) { org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.infoFormat ( "AddVds - entered , starting logic to add VDS {0}" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.infoFormat ( "AddVds - VDS {0} was added, will try to add it to the resource manager" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . AddVds ( vds , false ) ; }

Target:
protected void executeVdsIdCommand ( ) { org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.info ( "AddVds - entered , starting logic to add VDS '{}'" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.info ( "AddVds - VDS '{}' was added, will try to add it to the resource manager" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . AddVds ( vds , false ) ; }