auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.lang.Void runInTransaction ( ) { diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setParentId ( Guid.Empty ) ; diskImage.setImageTemplateId ( Guid.Empty ) ; org.ovirt.engine.core.bll.ImagesHandler.setDiskAlias ( diskImage , getVm ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.addDiskImage ( diskImage , getVmId ( ) ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setParentId ( Guid.Empty ) ; diskImage.setImageTemplateId ( Guid.Empty ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.setDiskAlias ( diskImage , getVm ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.addDiskImage ( diskImage , getVmId ( ) ) ; return null ; }
Source:
public double getSizeForDisk ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { double sizeForDisk = diskImage.getCapacity ( ) ; if ( ( diskImage.getVolumeFormat ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ) ) { if ( storageDomain.getStorageType ( ) . isFileDomain ( ) ) { sizeForDisk = org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator.EMPTY_QCOW_HEADER_SIZE ; } else { sizeForDisk = org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator.INITIAL_BLOCK_ALLOCATION_SIZE ; } } else if ( ( diskImage.getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) { sizeForDisk = org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator.EMPTY_QCOW_HEADER_SIZE ; } return sizeForDisk ; }

Target:
public double getSizeForDisk ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { double sizeForDisk = diskImage.getCapacity ( ) ; if ( ( diskImage.getVolumeFormat ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.COW ) ) { if ( storageDomain.getStorageType ( ) . isFileDomain ( ) ) { sizeForDisk = org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator.EMPTY_QCOW_HEADER_SIZE ; } else { sizeForDisk = org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator.INITIAL_BLOCK_ALLOCATION_SIZE ; } } else if ( ( diskImage.getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Sparse ) ) { sizeForDisk = org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator.EMPTY_QCOW_HEADER_SIZE ; } return sizeForDisk ; }
Source:
public void snapshotExistsByGuidReturnsInvalidResultWhenNoSnapshot ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.mockito.Mockito.when ( snapshotDao.exists ( vmId , snapshotId ) ) . thenReturn ( false ) ; validateInvalidResult ( validator.snapshotExists ( vmId , snapshotId ) , VdcBllMessages.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST ) ; }

Target:
public void snapshotExistsByGuidReturnsInvalidResultWhenNoSnapshot ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.mockito.Mockito.when ( snapshotDao.exists ( vmId , snapshotId ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.snapshots.SnapshotsValidatorTest.validateInvalidResult ( validator.snapshotExists ( vmId , snapshotId ) , VdcBllMessages.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST ) ; }
Source:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private static void CacheConfigValues ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ; aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( returnValue != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cachedConfigValuesPreConvert.putAll ( ( ( java.util.HashMap < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > , java.lang.Object > ) ( returnValue ) ) ) ; } return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cachedConfigValuesPreConvert ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetConfigurationValues , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
private static void cacheConfigValues ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ; aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( returnValue != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cachedConfigValuesPreConvert.putAll ( ( ( java.util.HashMap < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > , java.lang.Object > ) ( returnValue ) ) ) ; } return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cachedConfigValuesPreConvert ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetConfigurationValues , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void setItems ( java.lang.Iterable value ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( value != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Disk > cast ( value ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; super . setItems ( disks ) ; updateActionAvailability ( ) ; }

Target:
public void setItems ( java.util.Collection value ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( value != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Disk > cast ( value ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; super . setItems ( disks ) ; updateActionAvailability ( ) ; }
Source:
public static void IsBackendAvailable ( 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 ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( true ) ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > GetEventNotificationTypeList ( ) { java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > ret = new java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > ( ) ; for ( org.ovirt.engine.core.common.EventNotificationEntity entity : org.ovirt.engine.core.common.EventNotificationEntity.values ( ) ) { if ( entity != ( org.ovirt.engine.core.common.EventNotificationEntity.UNKNOWN ) ) { ret.add ( entity ) ; } } return ret ; }
Source:
public void getRedirectServletReportsPage ( 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 ) ) : "" ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public boolean isSkipFencingIfSDActiveSupported ( java.lang.String version ) { boolean result = false ; if ( version != null ) { java.lang.Boolean b = ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.SkipFencingIfSDActiveSupported , version ) ) ) ; result = ( b != null ) && b ; } return result ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) . mput ( Schema.UserKeys.UNLOCK_TIME , new java.util.Date ( ) . getTime ( ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) . mput ( Schema.UserKeys.UNLOCK_TIME , java.lang.System.currentTimeMillis ( ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }
Source:
private void initDetachableFields ( ) { detachableModels = java.util.Arrays.asList ( new org.ovirt.engine.ui.uicommonweb.models.Model [ ] { model.getMemSize ( ) , model.getTotalCPUCores ( ) , model.getNumOfSockets ( ) , model.getCoresPerSocket ( ) , model.getIsHighlyAvailable ( ) , model.getMigrationMode ( ) , model.getOverrideMigrationDowntime ( ) , model.getMigrationDowntime ( ) , model.getPriority ( ) , model.getMinAllocatedMemory ( ) , model.getMemoryBalloonDeviceEnabled ( ) } ) ; }

Target:
private void initDetachableFields ( ) { detachableModels = java.util.Arrays.asList ( new org.ovirt.engine.ui.uicommonweb.models.Model [ ] { model.getMemSize ( ) , model.getTotalCPUCores ( ) , model.getNumOfSockets ( ) , model.getCoresPerSocket ( ) , model.getIsHighlyAvailable ( ) , model.getMigrationMode ( ) , model.getOverrideMigrationDowntime ( ) , model.getMigrationDowntime ( ) , model.getPriority ( ) , model.getMinAllocatedMemory ( ) , model.getMemoryBalloonDeviceEnabled ( ) , model.getNumOfIoThreads ( ) , model.getIoThreadsEnabled ( ) } ) ; }
Source:
private void revertCinderDisks ( java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { for ( org.ovirt.engine.core.compat.Guid childCmdId : childCmdIds ) { org.ovirt.engine.core.common.action.ImagesContainterParametersBase commandParameters = ( ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase ) ( org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandEntity ( childCmdId ) . getCommandParameters ( ) ) ) ; org.ovirt.engine.core.compat.Guid destinationImageId = commandParameters.getDestinationImageId ( ) ; org.ovirt.engine.core.compat.Guid storageDomainId = commandParameters.getStorageDomainId ( ) ; removeCinderDisk ( destinationImageId , storageDomainId ) ; } }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { org.ovirt.engine.core.bll.CommandBase < ? > commandBase = getCommand ( cmdId ) ; commandBase.getParameters ( ) . setTaskGroupSuccess ( false ) ; commandBase.endAction ( ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.StoragePool dc ) { setEnumTitle ( dc.getstatus ( ) ) ; switch ( dc.getstatus ( ) ) { case Contend : return getApplicationResources ( ) . waitImage ( ) ; case Maintenance : return getApplicationResources ( ) . maintenanceImage ( ) ; case NotOperational : case Problematic : case Uninitialized : return getApplicationResources ( ) . downImage ( ) ; case Up : return getApplicationResources ( ) . upImage ( ) ; default : break ; } return null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.StoragePool dc ) { setEnumTitle ( dc.getstatus ( ) ) ; switch ( dc.getstatus ( ) ) { case Contend : return getApplicationResources ( ) . waitImage ( ) ; case Maintenance : return getApplicationResources ( ) . maintenanceImage ( ) ; case NotOperational : case NonResponsive : case Uninitialized : return getApplicationResources ( ) . downImage ( ) ; case Up : return getApplicationResources ( ) . upImage ( ) ; default : break ; } return null ; }
Source:
protected void executeCommand ( ) { MoveVdssToGoingToMaintananceMode ( ) ; MigrateAllVdss ( ) ; for ( org.ovirt.engine.core.compat.Guid id : _vdsGroupIds ) { java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDAO ( ) . getAllForCluster ( id ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : networks ) { org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.SetNetworkStatus ( id , net ) ; } } org.ovirt.engine.core.bll.MaintananceNumberOfVdssCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { MoveVdssToGoingToMaintananceMode ( ) ; MigrateAllVdss ( ) ; for ( org.ovirt.engine.core.compat.Guid id : _vdsGroupIds ) { java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForCluster ( id ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : networks ) { org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.SetNetworkStatus ( id , net ) ; } } org.ovirt.engine.core.bll.MaintananceNumberOfVdssCommand.setSucceeded ( true ) ; }
Source:
private boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.isInternalExecution ( ) ) || ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.RestartVds ) ) ) ? 0 : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getVds ( ) . getName ( ) , getRequestedAuditEvent ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addCanDoActionMessage ( EngineMessage.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.addCanDoActionMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }

Target:
private boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.isInternalExecution ( ) ) || ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.RestartVds ) ) ) ? 0 : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getVds ( ) . getName ( ) , getRequestedAuditEvent ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addValidationMessage ( EngineMessage.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.addValidationMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }
Source:
public void init ( ) { startProgress ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmListByClusterName ( new org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.affinity_groups.model.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList ) { java.util.List < org.ovirt.engine.core.compat.Guid > vmIds = getAffinityGroup ( ) . getVmIds ( ) ; getVmsSelectionModel ( ) . init ( vmList , ( vmIds != null ? vmIds : new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ) ; stopProgress ( ) ; } } ) , clusterName ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList ) { java.util.List < org.ovirt.engine.core.compat.Guid > vmIds = getAffinityGroup ( ) . getVmIds ( ) ; getVmsSelectionModel ( ) . init ( vmList , ( vmIds != null ? vmIds : new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ) ; stopProgressOnVmsAndHostsInit ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImage ( ) { if ( ( diskImage ) == null ) { diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupWithDataCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupWithDataCommand.getParameters ( ) . getImageGroupID ( ) ) ) ) ; } return diskImage ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImage ( ) { if ( ( diskImage ) == null ) { diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( diskDao.get ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupWithDataCommand.getParameters ( ) . getImageGroupID ( ) ) ) ) ; } return diskImage ; }
Source:
public static void GetDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }

Target:
public static void GetWatchdogByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetWatchdog , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private void addStatistics ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity , javax.ws.rs.core.UriInfo ui ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.VmStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.VmStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.utils.LinkHelper.addLinks ( ui , statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }

Target:
private void addStatistics ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.api.restapi.resource.VM entity , javax.ws.rs.core.UriInfo ui ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.VmStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.VmStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.utils.LinkHelper.addLinks ( ui , statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }
Source:
public java.lang.Void deleteDisk ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { return execute ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) { proxy.deleteVolume ( cinderDisk.getImageId ( ) . toString ( ) ) ; return null ; } } ) ; }

Target:
public boolean deleteVolume ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { return execute ( new java.util.concurrent.Callable < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean call ( ) { try { proxy.deleteVolume ( cinderDisk.getImageId ( ) . toString ( ) ) ; return true ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException ex ) { if ( ( ex.getStatus ( ) ) == ( org.apache.commons.httpclient.HttpStatus.SC_NOT_FOUND ) ) { return false ; } throw ex ; } } } ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ( pools.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { diskHotpluggableInterfacesMap = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; }
Source:
public void validateSucceedsWhenHasPeersThrowsException ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterUtil.getPeers ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenThrow ( new java.lang.RuntimeException ( ) ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }

Target:
public void validateSucceedsWhenHasPeersThrowsException ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterUtil.getPeers ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenThrow ( new java.lang.RuntimeException ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( command.validate ( ) ) ; }
Source:
public void testSaveMemoryPciPassthroughFailure ( ) { setUpGeneralValidations ( ) ; cmd.getParameters ( ) . setSaveMemory ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ) . when ( vmValidator ) . vmNotHavingPciPassthroughDevices ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertThat ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) , org.hamcrest.Matchers.hasItem ( EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES.name ( ) ) ) ; }

Target:
public void testSaveMemoryPciPassthroughFailure ( ) { setUpGeneralValidations ( ) ; cmd.getParameters ( ) . setSaveMemory ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ) . when ( vmValidator ) . vmNotHavingPciPassthroughDevices ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertThat ( cmd.getReturnValue ( ) . getValidationMessages ( ) , org.hamcrest.Matchers.hasItem ( EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES.name ( ) ) ) ; }
Source:
public void testListAllContent ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.util.List < java.lang.String > populates = new java.util.ArrayList < java.lang.String > ( ) ; populates.add ( "true" ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( BackendResource.POPULATE ) ) . andReturn ( populates ) . anyTimes ( ) ; setUpGetPayloadExpectations ( 3 ) ; setUpGetBallooningExpectations ( 3 ) ; setUpGetCertuficateExpectations ( 3 ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }

Target:
public void testList ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( returnValue ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; model.getBaseTemplate ( ) . setItems ( java.util.Collections.singletonList ( template ) ) ; model.getBaseTemplate ( ) . setSelectedItem ( template ) ; model.getBaseTemplate ( ) . setIsChangable ( false ) ; }
Source:
public void testInActiveDomainInList ( ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase param = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ) ; org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand < org.ovirt.engine.core.common.action.StoragePoolParametersBase > cmd = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommandTest.createCommand ( param ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain tempStorageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; tempStorageDomains.setStatus ( StorageDomainStatus.InActive ) ; domainsList.add ( tempStorageDomains ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > listReturned = cmd.getActiveOrLockedDomainList ( domainsList ) ; org.junit.Assert.assertTrue ( listReturned.isEmpty ( ) ) ; }

Target:
public void testInactiveDomainInList ( ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase param = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ) ; org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand < org.ovirt.engine.core.common.action.StoragePoolParametersBase > cmd = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommandTest.createCommand ( param ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain tempStorageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; tempStorageDomains.setStatus ( StorageDomainStatus.Inactive ) ; domainsList.add ( tempStorageDomains ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > listReturned = cmd.getActiveOrLockedDomainList ( domainsList ) ; org.junit.Assert.assertTrue ( listReturned.isEmpty ( ) ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateManagementParameters.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateManagementParameters.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void canRemoveLastBrick ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedVolume ( volumeId1 , 1 ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( volumeEntity.getBricks ( ) , volumeEntity , 1 , false ) ; org.junit.Assert.assertFalse ( validationResult.isValid ( ) ) ; org.junit.Assert.assertEquals ( EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_REMOVE_ALL_BRICKS_FROM_VOLUME , validationResult.getMessage ( ) ) ; }

Target:
public void canRemoveLastBrick ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedVolume ( volumeId1 , 1 ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( volumeEntity.getBricks ( ) , volumeEntity , 1 , false ) ; org.junit.Assert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_REMOVE_ALL_BRICKS_FROM_VOLUME ) ) ; }
Source:
public static org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel createNewSnapshotModel ( org.ovirt.engine.ui.uicommonweb.ICommandTarget cancelCommandTarget ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ( ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . createSnapshotTitle ( ) ) ; model.setHelpTag ( HelpTag.create_snapshot ) ; model.setHashName ( "create_snapshot" ) ; model.setCancelCommand ( new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , cancelCommandTarget ) . setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) . setIsCancel ( true ) ) ; return model ; }

Target:
public static org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel createNewSnapshotModel ( org.ovirt.engine.ui.uicommonweb.ICommandTarget cancelCommandTarget ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ( ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . createSnapshotTitle ( ) ) ; model.setHelpTag ( HelpTag.create_snapshot ) ; model.setHashName ( "create_snapshot" ) ; model.setCancelCommand ( org.ovirt.engine.ui.uicommonweb.UICommand.createCancelUiCommand ( "Cancel" , cancelCommandTarget ) ) ; return model ; }
Source:
private void auditLogHotSetCpusCandos ( org.ovirt.engine.core.common.action.HotSetNumerOfCpusParameters params ) { if ( ! ( setNumberOfCpusResult.getCanDoAction ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand ( params ) ; java.util.List < java.lang.String > canDos = org.ovirt.engine.core.bll.UpdateVmCommand.getBackend ( ) . getErrorsTranslator ( ) . TranslateErrorText ( setNumberOfCpusResult.getCanDoActionMessages ( ) ) ; logable.addCustomValue ( HotSetNumberOfCpusCommand.LOGABLE_FIELD_ERROR_MESSAGE , org.apache.commons.lang.StringUtils.join ( canDos , "," ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.FAILED_HOT_SET_NUMBER_OF_CPUS ) ; } }

Target:
private void auditLogHotSetCpusCandos ( org.ovirt.engine.core.common.action.HotSetNumerOfCpusParameters params ) { if ( ! ( setNumberOfCpusResult.getCanDoAction ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand ( params ) ; java.util.List < java.lang.String > canDos = org.ovirt.engine.core.bll.UpdateVmCommand.getBackend ( ) . getErrorsTranslator ( ) . TranslateErrorText ( setNumberOfCpusResult.getCanDoActionMessages ( ) ) ; logable.addCustomValue ( HotSetNumberOfCpusCommand.LOGABLE_FIELD_ERROR_MESSAGE , org.apache.commons.lang.StringUtils.join ( canDos , "," ) ) ; auditLogDirector.log ( logable , AuditLogType.FAILED_HOT_SET_NUMBER_OF_CPUS ) ; } }
Source:
public void sortDisks ( ) { if ( ( disks ) != null ) { java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskModelByAliasComparer ( ) ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Disks" ) ) ; } }

Target:
public void sortDisks ( ) { if ( ( disks ) != null ) { java.util.Collections.sort ( disks , java.util.Comparator.comparing ( ( d ) -> d.getDisk ( ) . getDiskAlias ( ) ) ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Disks" ) ) ; } }
Source:
public void testAddLunDiskMissingType ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . setType ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "HostStorage" , "testAddLunDiskMissingType" , "type" ) ; } }

Target:
public void testAddLunDiskMissingId ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setId ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddLunDiskMissingId" , "id" ) ; } }
Source:
public void attestationServerNotConfiguredProperly ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AttestationServer , StringUtils.EMPTY ) ; org.mockito.Mockito.when ( cluster.supportsTrustedService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.attestationServerConfigured ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_GROUP_CANNOT_SET_TRUSTED_ATTESTATION_SERVER_NOT_CONFIGURED ) ) ; }

Target:
public void attestationServerNotConfiguredProperly ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AttestationServer , StringUtils.EMPTY ) ; org.mockito.Mockito.when ( cluster.supportsTrustedService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.attestationServerConfigured ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CLUSTER_CANNOT_SET_TRUSTED_ATTESTATION_SERVER_NOT_CONFIGURED ) ) ; }
Source:
public com.google.gwt.dom.client.Element getElement ( ) { return ( ( com.google.gwt.dom.client.Element ) ( elem ) ) ; }

Target:
public void onBrowserEvent ( com.google.gwt.cell.client.Cell.Context context , final com.google.gwt.dom.client.Element elem , T object , com.google.gwt.dom.client.NativeEvent event ) { super . onBrowserEvent ( context , elem , object , event ) ; if ( BrowserEvents.MOUSEOVER.equals ( event.getType ( ) ) ) { com.google.gwt.safehtml.shared.SafeHtml tooltipHtml = getTooltip ( object ) ; if ( ! ( "" . equals ( tooltipHtml.asString ( ) ) ) ) { tooltipPanel.setText ( getTooltip ( object ) ) ; } } tooltipPanel.handleNativeBrowserEvent ( elem , event ) ; }
Source:
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 ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }

Target:
public void shouldValidateSingleNodePinning ( ) { vm.setvNumaNodeList ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 0 , java.util.Collections.singletonList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; org.junit.Assert.assertTrue ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { lockInteractionManager.hideLoadingIndicator ( ) ; getView ( ) . setErrorMessage ( loginModel.getMessage ( ) ) ; org.ovirt.engine.ui.common.presenter.AbstractLoginPopupPresenterWidget.logger.warning ( ( ( "Login failed for user [" + ( loginModel.getUserName ( ) . getEntity ( ) ) ) + "]" ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { lockInteractionManager.hideLoadingIndicator ( ) ; formatAndSetErrorMessage ( loginModel.getMessage ( ) ) ; org.ovirt.engine.ui.common.presenter.AbstractLoginPopupPresenterWidget.logger.warning ( ( ( "Login failed for user [" + ( loginModel.getUserName ( ) . getEntity ( ) ) ) + "]" ) ) ; }
Source:
public void qosCommitmentMissingNicSpeed ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosCommitmentNicSetup ( ( ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) / 2 ) , null ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_INVALID_INTERFACE_SPEED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createBond ( java.lang.String name , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , name , true , null , null , null , networkName , true , null , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; mockCalculateBaseNicWhenBaseNicIsPassed ( bond ) ; return bond ; }
Source:
public java.lang.Void runInTransaction ( ) { removeVnicProfiles ( ) ; getCompensationContext ( ) . snapshotEntity ( getNetwork ( ) ) ; getNetworkDAO ( ) . remove ( getNetwork ( ) . getId ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { removeVnicProfiles ( ) ; removeFromClusters ( ) ; getCompensationContext ( ) . snapshotEntity ( getNetwork ( ) ) ; getNetworkDAO ( ) . remove ( getNetwork ( ) . getId ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
private void logDeviceInformation ( org.ovirt.engine.core.compat.Guid vmId , java.util.Map device ) { java.lang.String message = "Received a {0} Device without an address when processing VM {1} devices, skipping device" ; java.lang.String deviceType = org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.getDeviceType ( device ) ; if ( shouldLogDeviceDetails ( deviceType ) ) { java.util.Map < java.lang.String , java.lang.Object > deviceInfo = device ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( ( message + ": {2}" ) , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId , deviceInfo ) ; } else { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( message , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId ) ; } }

Target:
private void logDeviceInformation ( org.ovirt.engine.core.compat.Guid vmId , java.util.Map device ) { java.lang.String message = "Received a {0} Device without an address when processing VM {1} devices, skipping device" ; java.lang.String deviceType = ( ( java.lang.String ) ( device.get ( VdsProperties.Device ) ) ) ; if ( shouldLogDeviceDetails ( deviceType ) ) { java.util.Map < java.lang.String , java.lang.Object > deviceInfo = device ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( ( message + ": {2}" ) , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId , deviceInfo ) ; } else { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( message , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( ( succeeded ? ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( retVal.getActionReturnValue ( ) ) ) : null ) , succeeded ) ; }

Target:
private boolean isActionSucceeded ( org.ovirt.engine.core.common.action.VdcReturnValueBase retVal ) { return ( retVal != null ) && ( retVal.getSucceeded ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImagesForVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allDisks = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) , true , true , true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ) ; allDisks.addAll ( cinderDisks ) ; return allDisks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImagesForVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allDisks = new java.util.ArrayList ( getDiskImages ( disks ) ) ; allDisks.addAll ( org.ovirt.engine.core.bll.ImagesHandler.getCinderLeafImages ( disks , true ) ) ; return allDisks ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { getView ( ) . edit ( model ) ; }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { getView ( ) . spiceSelected ( event.getValue ( ) ) ; getView ( ) . setWanOptionsVisible ( ( ( wanOptionsAvailable ) && ( event.getValue ( ) ) ) ) ; getView ( ) . rdpSelected ( ( ! ( event.getValue ( ) ) ) ) ; }