auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void remove ( org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking , org.codehaus.jackson.JsonNode id , org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse response ) { this . runningCalls.remove ( id ) ; removeRequestFromTracking ( id ) ; if ( ( tracking != null ) && ( ( tracking.getClient ( ) ) != null ) ) { tracking.getCall ( ) . addResponse ( response ) ; } }

Target:
private void remove ( org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking , org.codehaus.jackson.JsonNode id , org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse response ) { try ( org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper wrapper = new org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper ( this . lock ) ) { org.ovirt.vdsm.jsonrpc.client.internal.JsonRpcCall call = this . runningCalls.remove ( id ) ; if ( call != null ) { call.addResponse ( response ) ; } removeRequestFromTracking ( id ) ; if ( ( tracking != null ) && ( ( tracking.getClient ( ) ) != null ) ) { tracking.getCall ( ) . addResponse ( response ) ; } } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "Progress" . equals ( pcArgs.PropertyName ) ) { if ( ( modelProvider.getModel ( ) . getProgress ( ) ) != null ) { if ( ( getTable ( ) ) != null ) { getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; } } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "Progress" . equals ( pcArgs.propertyName ) ) { if ( ( modelProvider.getModel ( ) . getProgress ( ) ) != null ) { if ( ( getTable ( ) ) != null ) { getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; } } } }
Source:
private void deleteSnapshots ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > snaphosts ) { java.util.List < org.ovirt.engine.core.compat.Guid > deletedIds = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot : snaphosts ) { deletedIds.add ( snapshot.getId ( ) ) ; } getGlusterVolumeSnapshotDao ( ) . removeAll ( deletedIds ) ; }

Target:
private void deleteSnapshots ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > snaphosts ) { java.util.List < org.ovirt.engine.core.compat.Guid > deletedIds = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot : snaphosts ) { deletedIds.add ( snapshot.getId ( ) ) ; } volumeSnapshotDao.removeAll ( deletedIds ) ; }
Source:
public void coresPerSocketChanged ( ) { int coresPerSocket = extractIntFromListModel ( getModel ( ) . getCoresPerSocket ( ) ) ; int totalCpuCores = getTotalCpuCores ( ) ; if ( ( coresPerSocket == 0 ) || ( totalCpuCores == 0 ) ) { return ; } getModel ( ) . getNumOfSockets ( ) . setSelectedItem ( ( totalCpuCores / coresPerSocket ) ) ; }

Target:
public boolean isNumOfSocketsCorrect ( int totalCpuCores ) { int numOfSockets = extractIntFromListModel ( getModel ( ) . getNumOfSockets ( ) ) ; int coresPerSocket = extractIntFromListModel ( getModel ( ) . getCoresPerSocket ( ) ) ; int threadsPerCore = extractIntFromListModel ( getModel ( ) . getThreadsPerCore ( ) ) ; return totalCpuCores == ( ( coresPerSocket * numOfSockets ) * threadsPerCore ) ; }
Source:
public void maintenance ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { pb.add ( new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( a.getId ( ) , getEntity ( ) . getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.DeactivateStorageDomain , pb ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { confirmationModel.stopProgress ( ) ; setWindow ( null ) ; }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public static void isMTUOverrideSupported ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MTUOverrideSupported ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public static void GetLocalFSPath ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RhevhLocalFSPath , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetStorageDomainMaxNameLength ( 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 ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public java.lang.Void runInTransaction ( ) { detachStorageDomainWithEntities ( masterDomain ) ; getCompensationContext ( ) . snapshotEntity ( masterDomain.getStorageStaticData ( ) ) ; masterDomain.setStorageDomainType ( StorageDomainType.Data ) ; getDbFacade ( ) . getStorageDomainStaticDao ( ) . update ( masterDomain.getStorageStaticData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( masterDomain.getStoragePoolIsoMapData ( ) ) ; masterDomain.setStatus ( StorageDomainStatus.Locked ) ; getDbFacade ( ) . getStoragePoolIsoMapDao ( ) . update ( masterDomain.getStoragePoolIsoMapData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }

Target:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }
Source:
public boolean handle ( java.util.List < org.ovirt.engine.api.extensions.ExtMap > queryResults ) { boolean result = true ; for ( org.ovirt.engine.api.extensions.ExtMap queryResult : queryResults ) { if ( ( directoryUsers.size ( ) ) < ( org.ovirt.engine.core.aaa.AuthzUtils.QUERIES_RESULTS_LIMIT ) ) { directoryUsers.add ( org.ovirt.engine.core.aaa.AuthzUtils.mapPrincipalRecord ( extension , queryResult ) ) ; } else { result = false ; break ; } } return result ; }

Target:
public boolean handle ( java.util.List < org.ovirt.engine.api.extensions.ExtMap > queryResults ) { boolean result = true ; for ( org.ovirt.engine.api.extensions.ExtMap queryResult : queryResults ) { if ( ( groups.size ( ) ) < ( org.ovirt.engine.core.aaa.AuthzUtils.QUERIES_RESULTS_LIMIT ) ) { groups.add ( queryResult ) ; } else { result = false ; } } return result ; }
Source:
public static 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 static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { 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.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
public static java.lang.String map ( org.ovirt.engine.api.model.AccessProtocol accessProtocol , java.lang.String template ) { switch ( accessProtocol ) { case GLUSTER : return AccessProtocol.GLUSTER.value ( ) ; case NFS : return AccessProtocol.NFS.value ( ) ; case CIFS : return AccessProtocol.CIFS.value ( ) ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.AccessProtocol map ( org.ovirt.engine.api.model.AccessProtocol accessProtocol , java.lang.String template ) { switch ( accessProtocol ) { case GLUSTER : return org.ovirt.engine.api.model.AccessProtocol.GLUSTER ; case NFS : return org.ovirt.engine.api.model.AccessProtocol.NFS ; case CIFS : return org.ovirt.engine.api.model.AccessProtocol.CIFS ; default : return null ; } }
Source:
private static java.lang.String createAliasReplacements ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ... disks ) { java.lang.StringBuilder msg = new java.lang.StringBuilder ( "$diskAliases " ) . append ( disks [ 0 ] . getDiskAlias ( ) ) ; for ( int i = 1 ; i < ( disks.length ) ; ++ i ) { msg.append ( ", " ) . append ( disks [ i ] . getDiskAlias ( ) ) ; } return msg.toString ( ) ; }

Target:
private static java.lang.String createAliasReplacements ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ... disks ) { return java.util.Arrays.stream ( disks ) . map ( DiskImage :: getDiskAlias ) . collect ( java.util.stream.Collectors.joining ( ", " , "$diskAliases " , "" ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storages = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; if ( ( storages != null ) && ( ( storages.size ( ) ) > 0 ) ) { handleDomainAlreadyExists ( storageListModel , storages ) ; } else { storageListModel.saveNewNfsStorage ( ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storages = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; if ( ( storages != null ) && ( ( storages.size ( ) ) > 0 ) ) { handleDomainAlreadyExists ( storageListModel , storages ) ; } else { storageListModel.saveNewPosixStorage ( ) ; } }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( parameters.getActionType ( ) , parameters ) ; command.insertAsyncTaskPlaceHolders ( ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }

Target:
public java.util.Map < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > getVmIconDefaults ( ) { final org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = runInternalQuery ( VdcQueryType.GetVmIconDefaults , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ; return queryReturnValue.getReturnValue ( ) ; }
Source:
private void mockStorageDomainValidator ( ) { org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( cmd ) . getStorageDomainValidator ( ) ; org.mockito.Mockito.when ( storageDomainValidator.isDiscardAfterDeleteLegalForExistingStorageDomain ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( storageDomainValidator.isDiscardAfterDeleteSupportedByDcVersion ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( ValidationResult.VALID ) ; }

Target:
private void mockStorageDomainValidator ( ) { org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( cmd ) . getStorageDomainValidator ( ) ; org.mockito.Mockito.when ( storageDomainValidator.isDiscardAfterDeleteLegalForExistingStorageDomain ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( storageDomainValidator.isDiscardAfterDeleteSupportedByDcVersion ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( ValidationResult.VALID ) ; }
Source:
public void testGetAllForStoragePoolAndStatusesForAllStatuses ( ) { prepareHostWithDifferentStatus ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllForStoragePoolAndStatuses ( existingVds.getStoragePoolId ( ) , null ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.VDSStatus > statuses = result.stream ( ) . map ( VDS :: getStatus ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; assertCorrectGetAllResult ( result ) ; org.junit.Assert.assertTrue ( "more than one different status expected" , ( ( statuses.size ( ) ) > 1 ) ) ; }

Target:
public void testGetAllForStoragePoolAndStatusesForAllStatuses ( ) { prepareHostWithDifferentStatus ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllForStoragePoolAndStatuses ( existingVds.getStoragePoolId ( ) , null ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.VDSStatus > statuses = result.stream ( ) . map ( VDS :: getStatus ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; assertCorrectGetAllResult ( result ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( statuses.size ( ) ) > 1 ) , "more than one different status expected" ) ; }
Source:
public void volumesListIsEmpty ( ) { mockVdsCommand ( VDSCommandType.GetImagesList , successfulReturnValue ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.hostedengine.HostedEngineConfigFetcherTest.IMAGE_ID ) ) ) ; mockVdsCommand ( VDSCommandType.GetVolumesList , successfulReturnValue ( java.util.Collections.emptyList ( ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VDSCommandType.GetImagesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetVolumesList , org.mockito.Mockito.times ( 1 ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }

Target:
public void volumesListIsEmpty ( ) { mockVdsCommand ( VDSCommandType.GetImagesList , successfulReturnValue ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.hostedengine.HostedEngineConfigFetcherTest.IMAGE_ID ) ) ) ; mockVdsCommand ( VDSCommandType.GetVolumesList , successfulReturnValue ( java.util.Collections.emptyList ( ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VDSCommandType.GetImagesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetVolumesList , org.mockito.Mockito.times ( 1 ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }
Source:
private void watchdogModelSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getWatchdogModel ( ) . getSelectedItem ( ) ) == null ) { getWatchdogAction ( ) . setIsChangable ( false ) ; getWatchdogAction ( ) . setSelectedItem ( null ) ; } else { getWatchdogAction ( ) . setIsChangable ( true ) ; } }

Target:
private void watchdogModelSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getWatchdogModel ( ) . getSelectedItem ( ) ) == null ) { getWatchdogAction ( ) . setIsChangeable ( false ) ; getWatchdogAction ( ) . setSelectedItem ( null ) ; } else { getWatchdogAction ( ) . setIsChangeable ( true ) ; } }
Source:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; iface.setVmName ( getVm ( ) . getName ( ) ) ; }

Target:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; iface.setVmName ( getVm ( ) . getName ( ) ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesSubtract ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesToSubtract ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > subtract = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel.getDiskImageById ( image.getId ( ) , imagesToSubtract ) ) == null ) { subtract.add ( image ) ; } } return subtract ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesSubtract ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesToSubtract ) { java.util.Set < org.ovirt.engine.core.compat.Guid > idsToSubtract = imagesToSubtract.stream ( ) . map ( DiskImage :: getImageId ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; return images.stream ( ) . filter ( new org.ovirt.engine.ui.uicommonweb.Linq.IdsPredicate < > ( idsToSubtract ) . negate ( ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
protected boolean entityExists ( ) { org.ovirt.engine.core.compat.Guid entityId = org.ovirt.engine.core.bll.AbstractRngDeviceCommand.getParameters ( ) . getRngDevice ( ) . getVmId ( ) ; if ( org.ovirt.engine.core.bll.AbstractRngDeviceCommand.getParameters ( ) . isVm ( ) ) { return ( org.ovirt.engine.core.bll.AbstractRngDeviceCommand.getVmDAO ( ) . get ( entityId ) ) != null ; } else { return ( org.ovirt.engine.core.bll.AbstractRngDeviceCommand.getVmTemplateDAO ( ) . get ( entityId ) ) != null ; } }

Target:
boolean isFeatureSupported ( org.ovirt.engine.core.compat.Version clusterVersion ) { return org.ovirt.engine.core.common.FeatureSupported.virtIoRngSupported ( clusterVersion ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.aaa.DbUser getUserById ( org.ovirt.engine.core.compat.Guid userId ) { org.ovirt.engine.core.common.queries.IdQueryParameters queryParameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue userQueryResponse = runQuery ( QueryType.GetDbUserByUserId , queryParameters ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser returnValue = null ; if ( ( userQueryResponse != null ) && ( userQueryResponse.getSucceeded ( ) ) ) { returnValue = userQueryResponse.getReturnValue ( ) ; } return returnValue ; }

Target:
public org.ovirt.engine.core.common.businessentities.aaa.DbUser getUserById ( org.ovirt.engine.core.compat.Guid userId ) { org.ovirt.engine.core.common.queries.IdQueryParameters queryParameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) ; org.ovirt.engine.core.common.queries.QueryReturnValue userQueryResponse = runQuery ( QueryType.GetDbUserByUserId , queryParameters ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser returnValue = null ; if ( ( userQueryResponse != null ) && ( userQueryResponse.getSucceeded ( ) ) ) { returnValue = userQueryResponse.getReturnValue ( ) ; } return returnValue ; }
Source:
public org.ovirt.engine.core.bll.host.provider.HostProviderProxy findEngineProvider ( ) { engineHostName = resolveEngineHostName ( ) ; if ( ( engineHostName ) == null ) { return null ; } java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > hostProviders = dbFacade.getProviderDao ( ) . getAllByTypes ( ProviderType.FOREMAN ) ; org.ovirt.engine.core.bll.host.provider.HostProviderProxy proxy ; for ( org.ovirt.engine.core.common.businessentities.Provider < ? > provider : hostProviders ) { proxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( provider ) ; if ( proxy.isContentHostExist ( engineHostName ) ) { return proxy ; } } org.ovirt.engine.core.bll.host.provider.foreman.EngineForemanProviderFinder.log.error ( "Failed to find host on any provider by host name '{}' " , engineHostName ) ; return null ; }

Target:
public org.ovirt.engine.core.bll.host.provider.HostProviderProxy findEngineProvider ( ) { engineHostName = resolveEngineHostName ( ) ; if ( ( engineHostName ) == null ) { return null ; } java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > hostProviders = dbFacade.getProviderDao ( ) . getAllByTypes ( ProviderType.FOREMAN ) ; org.ovirt.engine.core.bll.host.provider.HostProviderProxy proxy ; for ( org.ovirt.engine.core.common.businessentities.Provider < ? > provider : hostProviders ) { proxy = providerProxyFactory.create ( provider ) ; if ( proxy.isContentHostExist ( engineHostName ) ) { return proxy ; } } org.ovirt.engine.core.bll.host.provider.foreman.EngineForemanProviderFinder.log.error ( "Failed to find host on any provider by host name '{}' " , engineHostName ) ; return null ; }
Source:
public static void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
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 ; }

Target:
public void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > > aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; 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 ) ; }
Source:
protected boolean validateImages ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getstorage_pool_id ( ) , Guid.Empty , true , true , true , true , true , true , true , true , null ) ; }

Target:
protected boolean validateImagesAndVMStates ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getstorage_pool_id ( ) , Guid.Empty , hasImages ( ) , hasImages ( ) , hasImages ( ) , hasImages ( ) , true , true , true , true , null ) ; }
Source:
private java.lang.String getMessage ( java.util.Map < java.lang.String , java.lang.Object > map ) { return java.lang.String.format ( "Files [scanned: %1$s, moved: %2$s, failed: %3$s], Total size moved: %4$s" , map.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterTasksListReturnForXmlRpc.FILES_SCANNED ) , map.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterTasksListReturnForXmlRpc.FILES_MOVED ) , map.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterTasksListReturnForXmlRpc.FILES_FAILED ) , map.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterTasksListReturnForXmlRpc.TOTAL_SIZE_MOVED ) ) ; }

Target:
private java.lang.String getMessage ( java.util.Map < java.lang.String , java.lang.Object > map ) { return java.lang.String.format ( "Files [scanned: %1$s, moved: %2$s, failed: %3$s], Total size moved: %4$s" , map.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterTasksListReturnForXmlRpc.FILES_SCANNED ) , map.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterTasksListReturnForXmlRpc.FILES_MOVED ) , map.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterTasksListReturnForXmlRpc.FILES_FAILED ) , formatTotalSizeMoved ( java.lang.Long.parseLong ( map.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterTasksListReturnForXmlRpc.TOTAL_SIZE_MOVED ) . toString ( ) ) ) ) ; }
Source:
public void canDoActionThinProvisioningSpaceCheckFailsSize ( ) { final int availableSize = 4 ; final int usedSize = 6 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
public void canDoActionSpaceValidationSucceeds ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
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:
protected org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator getStorageDomainValidator ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { return new org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator ( storageDomain ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ! ( org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils.isTaskOfType ( volume , GlusterTaskType.REMOVE_BRICK ) ) ) || ( ! ( org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils.isTaskStatus ( volume , JobExecutionStatus.STARTED ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_NOT_STARTED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ! ( org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils.isTaskOfType ( volume , GlusterTaskType.REMOVE_BRICK ) ) ) || ( ! ( ( org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils.isTaskStatus ( volume , JobExecutionStatus.STARTED ) ) || ( org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils.isTaskStatus ( volume , JobExecutionStatus.FINISHED ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_NOT_STARTED ) ; } return true ; }
Source:
private org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > createCommand ( ) { org.ovirt.engine.core.common.action.RunVmParams param = new org.ovirt.engine.core.common.action.RunVmParams ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; command = new org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > ( param ) ; return org.powermock.api.mockito.PowerMockito.spy ( command ) ; }

Target:
protected void mockVmRunHandler ( ) { org.mockito.Mockito.doReturn ( vmRunHandler ) . when ( command ) . getVmRunHandler ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( vmRunHandler ) . performImageChecksForRunningVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) , org.mockito.Matchers.anyListOf ( java.lang.String.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.action.RunVmParams.class ) , org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.Disk.class ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( vmRunHandler ) . isVmInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmImageDisks ( ) { if ( ( cachedVmImageDisks ) == null ) { cachedVmImageDisks = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getVmDisks ( ) , true , false , false ) ; } return cachedVmImageDisks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmImageDisks ( ) { if ( ( cachedVmImageDisks ) == null ) { cachedVmImageDisks = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getVmDisks ( ) , true , false , false ) ; cachedVmImageDisks.addAll ( org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( getVmDisks ( ) , true ) ) ; } return cachedVmImageDisks ; }
Source:
private void testResolveHostNetworkAddress ( java.util.function.Function < org.ovirt.engine.core.bll.network.NetworkConfigurator , java.lang.String > function , java.lang.String networkName ) { injectorRule.bind ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil.class , managementNetworkUtil ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; nic.setNetworkName ( networkName ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.getInterfaces ( ) . add ( nic ) ; org.junit.Assert.assertThat ( function.apply ( new org.ovirt.engine.core.bll.network.NetworkConfigurator ( vds , null ) ) , org.hamcrest.CoreMatchers.nullValue ( ) ) ; }

Target:
public void setUp ( ) { injectorRule.bind ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil.class , managementNetworkUtil ) ; nic.setNetworkName ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.NETWORK_NAME1 ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.getInterfaces ( ) . add ( nic ) ; underTest = new org.ovirt.engine.core.bll.network.NetworkConfigurator ( vds , org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.COMMAND_CONTEXT ) ; }
Source:
private java.lang.String getDiskIsBeingMigratedMessage ( ) { if ( ( cachedDiskIsBeingMigratedMessage ) == null ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_BEING_MIGRATED.name ( ) ) ; if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) != null ) { builder.append ( java.lang.String.format ( "$DiskName %1$s" , getDiskAlias ( ) ) ) ; } cachedDiskIsBeingMigratedMessage = builder.toString ( ) ; } return cachedDiskIsBeingMigratedMessage ; }

Target:
private java.lang.String getDiskIsBeingMigratedMessage ( ) { if ( ( cachedDiskIsBeingMigratedMessage ) == null ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_BEING_MIGRATED.name ( ) ) ; if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) != null ) { builder.append ( java.lang.String.format ( "$DiskName %1$s" , getDiskAlias ( ) ) ) ; } cachedDiskIsBeingMigratedMessage = builder.toString ( ) ; } return cachedDiskIsBeingMigratedMessage ; }
Source:
public static void pauseUploads ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { org.ovirt.engine.core.common.businessentities.storage.ImageTransferUpdates updates = new org.ovirt.engine.core.common.businessentities.storage.ImageTransferUpdates ( ) ; updates.setPhase ( ImageTransferPhase.PAUSED_USER ) ; org.ovirt.engine.core.common.action.UploadImageStatusParameters parameters = new org.ovirt.engine.core.common.action.UploadImageStatusParameters ( ) ; parameters.setUpdates ( updates ) ; parameters.setDiskId ( image.getId ( ) ) ; list.add ( parameters ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.UploadImageStatus , list ) ; }

Target:
public static void pauseUploads ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { org.ovirt.engine.core.common.businessentities.storage.ImageTransfer updates = new org.ovirt.engine.core.common.businessentities.storage.ImageTransfer ( ) ; updates.setPhase ( ImageTransferPhase.PAUSED_USER ) ; org.ovirt.engine.core.common.action.TransferImageStatusParameters parameters = new org.ovirt.engine.core.common.action.TransferImageStatusParameters ( ) ; parameters.setUpdates ( updates ) ; parameters.setDiskId ( image.getId ( ) ) ; list.add ( parameters ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.TransferImageStatus , list ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.SelectedItemChangedEventDefinition ) ) && ( sender == ( getDataCenter ( ) ) ) ) { DataCenter_SelectedItemChanged ( ) ; } else if ( ( ev.matchesDefinition ( ListModel.SelectedItemChangedEventDefinition ) ) && ( sender == ( getCluster ( ) ) ) ) { Cluster_SelectedItemChanged ( ) ; } else if ( sender == ( getConsoleAddressEnabled ( ) ) ) { consoleAddressChanged ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getDataCenter ( ) ) ) ) { DataCenter_SelectedItemChanged ( ) ; } else if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getCluster ( ) ) ) ) { Cluster_SelectedItemChanged ( ) ; } else if ( sender == ( getConsoleAddressEnabled ( ) ) ) { consoleAddressChanged ( ) ; } }
Source:
public void testRemoveNotExisting ( ) throws java.lang.Exception { setUpGetNotExistingEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendStorageServerConnectionResource.HOST , GUIDS [ 1 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNotExisting ( ) throws java.lang.Exception { setUpGetNotExistingEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendStorageServerConnectionResource.HOST , GUIDS [ 1 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected void setObjectName ( java.lang.Object object , java.lang.String name , boolean isSuffix ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( object ) ) ; if ( isSuffix ) { vm.setVmName ( ( ( vm.getVmName ( ) ) + name ) ) ; } else { vm.setVmName ( name ) ; } }

Target:
protected void setObjectName ( java.lang.Object object , java.lang.String name , boolean isSuffix ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . getVm ( ) ; if ( isSuffix ) { vm.setVmName ( ( ( vm.getVmName ( ) ) + name ) ) ; } else { vm.setVmName ( name ) ; } }
Source:
private void checkResults ( java.util.List < org.ovirt.engine.core.common.businessentities.profiles.CpuProfile > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 2 , result.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.profiles.CpuProfile cpuProfile : result ) { org.junit.Assert.assertEquals ( FixturesTool.CLUSTER_RHEL6_ISCSI , cpuProfile.getClusterId ( ) ) ; } }

Target:
private void checkResults ( java.util.List < org.ovirt.engine.core.common.businessentities.profiles.CpuProfile > result ) { org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , result.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.profiles.CpuProfile cpuProfile : result ) { org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.CLUSTER_RHEL6_ISCSI , cpuProfile.getClusterId ( ) ) ; } }
Source:
public static void GetUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.ArchitectureType getArchitecture ( ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( getVdsGroup ( ) . getcpu_name ( ) ) ) { return org.ovirt.engine.core.bll.CpuFlagsManagerHandler.getArchitectureByCpuName ( getVdsGroup ( ) . getcpu_name ( ) , getVdsGroup ( ) . getcompatibility_version ( ) ) ; } else if ( ( getVdsGroup ( ) . getArchitecture ( ) ) == null ) { return org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ; } return getVdsGroup ( ) . getArchitecture ( ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.ArchitectureType getArchitecture ( ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( getVdsGroup ( ) . getCpuName ( ) ) ) { return org.ovirt.engine.core.bll.CpuFlagsManagerHandler.getArchitectureByCpuName ( getVdsGroup ( ) . getCpuName ( ) , getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; } else if ( ( getVdsGroup ( ) . getArchitecture ( ) ) == null ) { return org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ; } return getVdsGroup ( ) . getArchitecture ( ) ; }
Source:
public static void getDocumentationBaseURL ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static int getOptimizeSchedulerForSpeedPendingRequests ( ) { return ( ( java.lang.Integer ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.SpeedOptimizationSchedulingThreshold , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ) ) ; }