auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean canDoAction ( ) { return ( ( ( ( ( ( ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmInUpPausedDownStatus ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.canRunActionOnNonManagedVm ( ) ) ) && ( isDiskExist ( getDisk ( ) ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmNotInPreviewSnapshot ( ) ) ) && ( imageStorageValidation ( ) ) ) && ( virtIoScsiDiskValidation ( ) ) ; }

Target:
protected boolean canDoAction ( ) { performDbLoads ( ) ; return ( ( ( ( ( ( ( ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmInUpPausedDownStatus ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.canRunActionOnNonManagedVm ( ) ) ) && ( isDiskExist ( getDisk ( ) ) ) ) && ( interfaceDiskValidation ( ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmNotInPreviewSnapshot ( ) ) ) && ( imageStorageValidation ( ) ) ) && ( virtIoScsiDiskValidation ( ) ) ; }
Source:
public void test32BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_0 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_32_BIT ) + 1 ) ) ; mockOsRepository ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }

Target:
public void setup ( ) { mockVmPropertiesUtils ( ) ; mockOsRepository ( ) ; }
Source:
public static void GetProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
public static void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
public void testEchoStderr ( ) throws java.lang.Exception { java.lang.String content = "hello\nworld!\nother\ndata" ; java.io.InputStream stdin = new java.io.ByteArrayInputStream ( content.getBytes ( "UTF-8" ) ) ; java.io.ByteArrayOutputStream stdout = new java.io.ByteArrayOutputStream ( ) ; java.io.ByteArrayOutputStream stderr = new java.io.ByteArrayOutputStream ( ) ; client.executeCommand ( "cat >&2" , stdin , stdout , stderr ) ; assertEquals ( content , new java.lang.String ( stderr.toByteArray ( ) , "UTF-8" ) ) ; assertEquals ( 0 , stdout.size ( ) ) ; }

Target:
public void testEchoStderr ( ) throws java.lang.Exception { java.lang.String content = "hello\nworld!\nother\ndata" ; java.io.InputStream stdin = new java.io.ByteArrayInputStream ( content.getBytes ( "UTF-8" ) ) ; java.io.ByteArrayOutputStream stdout = new java.io.ByteArrayOutputStream ( ) ; java.io.ByteArrayOutputStream stderr = new java.io.ByteArrayOutputStream ( ) ; client.executeCommand ( "cat >&2" , stdin , stdout , stderr ) ; org.junit.Assert.assertEquals ( content , new java.lang.String ( stderr.toByteArray ( ) , "UTF-8" ) ) ; org.junit.Assert.assertEquals ( 0 , stdout.size ( ) ) ; }
Source:
public void liveMigrateDisk ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; org.junit.Assert.assertFalse ( command.getLiveMigrateDisksParametersList ( ) . isEmpty ( ) ) ; }

Target:
public void moveUnpluggedDiskVmDown ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Down , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId , false ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( command.getMoveDiskParametersList ( ) . size ( ) , 1 ) ; }
Source:
public static void GetStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public static void IsUSBEnabledByDefault ( 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private java.lang.String getHostName ( org.ovirt.engine.core.compat.Guid hostId ) { if ( ( hostName ) == null ) { org.ovirt.engine.core.common.businessentities.VdsStatic host = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStaticDao ( ) . get ( hostId ) ; hostName = ( host == null ) ? null : host.getName ( ) ; } return hostName ; }

Target:
private java.lang.String getHostName ( org.ovirt.engine.core.compat.Guid hostId ) { if ( ( hostName ) == null ) { org.ovirt.engine.core.common.businessentities.VdsStatic host = vdsStaticDao.get ( hostId ) ; hostName = ( host == null ) ? null : host.getName ( ) ; } return hostName ; }
Source:
public void testPoolSpiceProxy ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; entity.setVmPoolSpiceProxy ( org.ovirt.engine.api.restapi.types.VmMapperTest.POOL_SPICE_PROXY ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.VM ) ( null ) ) ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapperTest.POOL_SPICE_PROXY , model.getDisplay ( ) . getProxy ( ) ) ; }

Target:
public void stringToCpuTune ( ) { org.ovirt.engine.api.model.CpuTune cpuTune = org.ovirt.engine.api.restapi.types.VmMapper.stringToCpuTune ( "0#0" ) ; assertNotNull ( cpuTune ) ; assertNotNull ( cpuTune.getVcpuPin ( ) ) ; assertEquals ( 1 , cpuTune.getVcpuPin ( ) . size ( ) ) ; assertEquals ( 0 , ( ( int ) ( cpuTune.getVcpuPin ( ) . get ( 0 ) . getVcpu ( ) ) ) ) ; assertEquals ( "0" , cpuTune.getVcpuPin ( ) . get ( 0 ) . getCpuSet ( ) ) ; }
Source:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public boolean isQualifiedForSnapshotMerge ( ) { return ( ( ( ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringUp ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.RebootInProgress ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ; }

Target:
public boolean isQualifiedForLiveSnapshotMerge ( ) { return ( ( ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringUp ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.RebootInProgress ) ) ; }
Source:
public void canDoActionFailsWithDuplicateVolumeName ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( getVolume ( 2 , false ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getVolume ( 2 , false ) ) . when ( volumeDao ) . getByName ( clusterId , "vol1" ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NAME_ALREADY_EXISTS ) ; }

Target:
public void canDoActionFailsWithDuplicateVolumeName ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( getVolume ( 2 , false ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getVolume ( 2 , false ) ) . when ( volumeDao ) . getByName ( clusterId , "vol1" ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NAME_ALREADY_EXISTS ) ; }
Source:
public static void main ( java.lang.String [ ] args ) throws java.lang.Exception { java.io.FileOutputStream os = null ; try { os = new java.io.FileOutputStream ( args [ 0 ] ) ; org.ovirt.engine.core.utils.archivers.tar.Tar.doTar ( os , new java.io.File ( args [ 1 ] ) ) ; } finally { if ( os != null ) { try { os.close ( ) ; } catch ( java.io.IOException e ) { } } } }

Target:
public static void main ( java.lang.String [ ] args ) throws java.lang.Exception { try ( java.io.OutputStream os = new java.io.FileOutputStream ( args [ 0 ] ) ) { org.ovirt.engine.core.utils.archivers.tar.Tar.doTar ( os , new java.io.File ( args [ 1 ] ) ) ; } }
Source:
public boolean exists ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus status ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , vmId ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( status ) ) ; return getCallsHandler ( ) . executeRead ( "CheckIfSnapshotExistsByVmIdAndStatus" , createBooleanMapper ( ) , parameterSource ) ; }

Target:
public boolean exists ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus status ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , vmId ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( status ) ) ; return getCallsHandler ( ) . executeRead ( "CheckIfSnapshotExistsByVmIdAndStatus" , org.springframework.jdbc.core.SingleColumnRowMapper.newInstance ( java.lang.Boolean.class ) , parameterSource ) ; }
Source:
public void testGetConnectableFileStorageConnectionsByStorageType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > conns = dao.getConnectableStorageConnectionsByStorageType ( FixturesTool.STORAGE_POOL_MIXED_TYPES , StorageType.NFS ) ; org.junit.Assert.assertNotNull ( conns ) ; org.junit.Assert.assertEquals ( 1 , conns.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections conn : conns ) { org.junit.Assert.assertEquals ( StorageType.NFS , conn.getstorage_type ( ) ) ; } }

Target:
public void testGetConnectableFileStorageConnectionsByStorageType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > conns = dao.getConnectableStorageConnectionsByStorageType ( FixturesTool.STORAGE_POOL_MIXED_TYPES , StorageType.NFS ) ; org.junit.Assert.assertNotNull ( conns ) ; org.junit.Assert.assertEquals ( 1 , conns.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections conn : conns ) { org.junit.Assert.assertEquals ( StorageType.NFS , conn.getStorageType ( ) ) ; } }
Source:
public void testNotRemovingManagementNetwork ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator networkAttachmentValidatorSpy = org.mockito.Mockito.spy ( createNetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ) ) ; org.mockito.Mockito.doReturn ( networkValidatorMock ) . when ( networkAttachmentValidatorSpy ) . getNetworkValidator ( ) ; org.ovirt.engine.core.bll.ValidationResult propagatedResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK , "a" ) ; org.mockito.Mockito.when ( networkValidatorMock.notRemovingManagementNetwork ( ) ) . thenReturn ( propagatedResult ) ; org.junit.Assert.assertThat ( "ValidationResult is not correctly propagated" , networkAttachmentValidatorSpy.notRemovingManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK , "a" ) ) ; }

Target:
public void testNotRemovingManagementNetwork ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator networkAttachmentValidatorSpy = org.mockito.Mockito.spy ( createNetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ) ) ; org.mockito.Mockito.doReturn ( networkValidatorMock ) . when ( networkAttachmentValidatorSpy ) . getNetworkValidator ( ) ; org.ovirt.engine.core.bll.ValidationResult propagatedResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK , "a" ) ; org.mockito.Mockito.when ( networkValidatorMock.notRemovingManagementNetwork ( ) ) . thenReturn ( propagatedResult ) ; org.junit.Assert.assertThat ( "ValidationResult is not correctly propagated" , networkAttachmentValidatorSpy.notRemovingManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK , "a" ) ) ; }
Source:
private void updateSnapshotDisks ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.DiskImage > filterDisksByStorageType ( disks , Disk.DiskStorageType.IMAGE ) ) ; java.util.Collections.sort ( diskImages , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; getSnapshotDisks ( ) . setItems ( diskImages ) ; }

Target:
private void updateSnapshotDisks ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.DiskImage > filterNonSnapableDisks ( disks ) ) ; java.util.Collections.sort ( diskImages , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; getSnapshotDisks ( ) . setItems ( diskImages ) ; }
Source:
public void updateGlusterHookInSync ( org.ovirt.engine.core.compat.Guid id , boolean inSync ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterHookInsync" , getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "in_sync" , inSync ) ) ; }

Target:
public void saveGlusterServerHook ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverHook ) { getCallsHandler ( ) . executeModification ( "InsertGlusterServerHook" , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , serverHook.getHookId ( ) ) . addValue ( "server_id" , serverHook.getServerId ( ) ) . addValue ( "hook_status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( serverHook.getStatus ( ) ) ) . addValue ( "content_type" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( serverHook.getContentType ( ) ) ) . addValue ( "checksum" , serverHook.getChecksum ( ) ) ) ; }
Source:
public static void UnLockVm ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDAO ( ) . get ( vmId ) ; if ( ( vm.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVmStatus , new org.ovirt.engine.core.common.vdscommands.SetVmStatusVDSCommandParameters ( vmId , org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ; } else { org.ovirt.engine.core.bll.VmHandler.log.errorFormat ( "Trying to unlock vm {0} in status {1} - not moving to down!" , vm.getvm_name ( ) , vm.getstatus ( ) ) ; } }

Target:
public static void UnLockVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVmStatus , new org.ovirt.engine.core.common.vdscommands.SetVmStatusVDSCommandParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ; vm.setstatus ( VMStatus.Down ) ; }
Source:
public void testkDuplicateKeys ( ) throws java.io.FileNotFoundException { java.lang.String baseDir = java.lang.System.getProperty ( "basedir" ) ; org.junit.Assume.assumeNotNull ( baseDir ) ; java.lang.String fileName = "AppErrors.properties" ; java.io.File file = new java.io.File ( ( ( baseDir + "/src/main/resources/org/ovirt/engine/ui/frontend/" ) + fileName ) ) ; org.ovirt.engine.core.utils.DuplicateKeysCheck.assertNoDuplicateKeys ( file.getAbsolutePath ( ) ) ; }

Target:
public void testDuplicateKeys ( ) throws java.io.FileNotFoundException { java.lang.String baseDir = java.lang.System.getProperty ( "basedir" ) ; org.junit.Assume.assumeNotNull ( baseDir ) ; java.io.File file = new java.io.File ( baseDir , "src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties" ) ; org.ovirt.engine.core.utils.DuplicateKeysCheck.assertNoDuplicateKeys ( file.getAbsolutePath ( ) ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( ! ( org.ovirt.engine.core.bll.ApproveVdsCommand.getSucceeded ( ) ) ) { if ( ( _failureLogTypeValue ) == ( org.ovirt.engine.core.common.AuditLogType.VDS_INSTALL_FAILED ) ) { AddCustomValue ( "FailedInstallMessage" , getErrorMessage ( _vdsInstaller.getErrorMessage ( ) ) ) ; } return _failureLogTypeValue ; } else { return org.ovirt.engine.core.common.AuditLogType.VDS_APPROVE ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( ! ( org.ovirt.engine.core.bll.ApproveVdsCommand.getSucceeded ( ) ) ) { if ( ( _failureLogTypeValue ) == ( org.ovirt.engine.core.common.AuditLogType.VDS_INSTALL_FAILED ) ) { AddCustomValue ( "FailedInstallMessage" , getErrorMessage ( _failureMessage ) ) ; } return _failureLogTypeValue ; } else { return org.ovirt.engine.core.common.AuditLogType.VDS_APPROVE ; } }
Source:
public void canDoActionFailsDiffInterface ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 , getBricks ( volumeId1 , 2 ) , 0 , 4 , false ) ) ; prepareMocks ( cmd ) ; prepareInterfaceMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void validateFailsDiffInterface ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 , getBricks ( volumeId1 , 2 ) , 0 , 4 , false ) ) ; prepareMocks ( cmd ) ; prepareInterfaceMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
private boolean registerLibvirtSecrets ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets , boolean clearUnusedSecrets ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.RegisterLibvirtSecrets , new org.ovirt.engine.core.common.vdscommands.RegisterLibvirtSecretsVDSParameters ( vds.getId ( ) , libvirtSecrets , clearUnusedSecrets ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.storage.CINDERStorageHelper.log.error ( "Failed to register libvirt secret on vds {}." , vds.getName ( ) ) ; return false ; } return true ; }

Target:
private boolean registerLibvirtSecretsImpl ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets , boolean clearUnusedSecrets ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.RegisterLibvirtSecrets , new org.ovirt.engine.core.common.vdscommands.RegisterLibvirtSecretsVDSParameters ( vds.getId ( ) , libvirtSecrets , clearUnusedSecrets ) ) ; return returnValue.getSucceeded ( ) ; }
Source:
public static void GetAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public void canDoActionDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( ) ; initVm ( ) ; command.getImage ( ) . setimageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }

Target:
public void canDoActionDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( ) ; initVm ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }
Source:
protected void removeTaskFromDB ( ) { try { if ( ( coco.removeByVdsmTaskId ( getVdsmTaskId ( ) ) ) != 0 ) { org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.infoFormat ( "BaseAsyncTask::removeTaskFromDB: Removed task {0} from DataBase" , getVdsmTaskId ( ) ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.error ( java.lang.String.format ( "BaseAsyncTask::removeTaskFromDB: Removing task %1$s from DataBase threw an exception." , getVdsmTaskId ( ) ) , e ) ; } }

Target:
protected void removeTaskFromDB ( ) { try { if ( ( coco.removeByVdsmTaskId ( getVdsmTaskId ( ) ) ) != 0 ) { org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.info ( "BaseAsyncTask::removeTaskFromDB: Removed task '{}' from DataBase" , getVdsmTaskId ( ) ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.error ( "BaseAsyncTask::removeTaskFromDB: Removing task '{}' from DataBase threw an exception: {}" , getVdsmTaskId ( ) , e.getMessage ( ) ) ; org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.debug ( "Exception" , e ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStatus" ) . withParameter ( "volName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolName" , slaveVolumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionList" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }
Source:
public void testExecuteNoTaskHandlers ( ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameterMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) ; org.mockito.Mockito.when ( parameterMock.getTransactionScopeOption ( ) ) . thenReturn ( TransactionScopeOption.Required ) ; org.ovirt.engine.core.bll.CommandBase < org.ovirt.engine.core.common.action.VdcActionParametersBase > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.CommandBaseTest.CommandBaseDummy ( parameterMock ) ) ; command.executeAction ( ) ; org.mockito.Mockito.verify ( command ) . executeCommand ( ) ; }

Target:
public void testExecuteNoTaskHandlers ( ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameterMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) ; org.mockito.Mockito.when ( parameterMock.getTransactionScopeOption ( ) ) . thenReturn ( TransactionScopeOption.Required ) ; org.ovirt.engine.core.bll.CommandBase < org.ovirt.engine.core.common.action.VdcActionParametersBase > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.CommandBaseTest.CommandBaseDummy ( parameterMock ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; command.executeAction ( ) ; org.mockito.Mockito.verify ( command ) . executeCommand ( ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
public static void getMaxNumOfCPUsPerSocket ( 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.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterSnapshotInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName , java.lang.String snapshotName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue ; if ( snapshotName == null ) { xmlRpcReturnValue = vdsServer.glusterSnapshotInfo ( "" , volumeName ) ; } else { xmlRpcReturnValue = vdsServer.glusterSnapshotInfo ( snapshotName , volumeName ) ; } org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , volumeName , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeConfigListXmlRpc glusterVolumeGeoRepConfigList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeConfigListXmlRpc ( vdsServer.glusterVolumeGeoRepConfigList ( volumeName , slaveHost , slaveVolumeName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult interfaceIsBondOrNull ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.NETWORK_INTERFACE_IS_NOT_BOND ) . when ( ( ( ( iface ) != null ) && ( ! ( iface.isBond ( ) ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult interfaceIsBondOrNull ( ) { java.lang.String ifaceName = ( ( iface ) == null ) ? "null" : iface.getName ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.HostInterfaceValidator.VAR_NETWORK_INTERFACE_IS_NOT_BOND_ENTITY , ifaceName ) ) . when ( ( ( ( iface ) != null ) && ( ! ( iface.isBond ( ) ) ) ) ) ; }
Source:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain domain = createDataStorageDomain ( status , name ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Arrays.asList ( domain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return domain ; }

Target:
public void shouldElectActiveSharedDataDomain ( ) { final org.ovirt.engine.core.common.businessentities.StorageDomain domain = prepareSharedStorageDomainForElection ( StorageDomainStatus.Active , "shared domain name" ) ; org.mockito.Mockito.when ( hostedEngineHelper.isHostedEngineStorageDomain ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertEquals ( domain , cmd.electNewMaster ( ) ) ; }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.GetVmTemplatesDisksParameters ( templateId ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VM vm = null ; org.ovirt.engine.core.common.businessentities.VmPool vmpool = vmPoolDao.getByName ( org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getParameters ( ) . getName ( ) ) ; if ( vmpool != null ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue getVmRet = backend.runInternalQuery ( QueryType.GetVmDataByPoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmpool.getVmPoolId ( ) ) ) ; if ( getVmRet != null ) { vm = getVmRet.getReturnValue ( ) ; } } org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getQueryReturnValue ( ) . setReturnValue ( vm ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VM vm = null ; org.ovirt.engine.core.common.businessentities.VmPool vmpool = vmPoolDao.getByName ( org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getParameters ( ) . getName ( ) ) ; if ( vmpool != null ) { org.ovirt.engine.core.common.queries.QueryReturnValue getVmRet = backend.runInternalQuery ( QueryType.GetVmDataByPoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmpool.getVmPoolId ( ) ) ) ; if ( getVmRet != null ) { vm = getVmRet.getReturnValue ( ) ; } } org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getQueryReturnValue ( ) . setReturnValue ( vm ) ; }
Source:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getAAAProfilesEntriesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void replaceWithNullItem ( ) { java.util.List < java.lang.Object > items = java.util.Collections.singletonList ( null ) ; java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_NAME , items ) ; validateReplacementsContainsExpectedProperties ( replacements , items ) ; org.junit.Assert.assertTrue ( validateReplacementContains ( replacements , "null" ) ) ; }

Target:
public void replaceWithNullItem ( ) { java.util.List < java.lang.Object > items = java.util.Collections.singletonList ( null ) ; java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_NAME , items ) ; validateReplacementsContainsExpectedProperties ( replacements , items ) ; org.junit.jupiter.api.Assertions.assertTrue ( validateReplacementContains ( replacements , "null" ) ) ; }
Source:
public void testRedundantMessages ( ) throws java.io.IOException { org.ovirt.engine.core.utils.EnumTranslationProperties props = new org.ovirt.engine.core.utils.EnumTranslationProperties ( enumClass ) ; try ( java.io.InputStream is = new java.io.FileInputStream ( file ) ) { props.load ( is ) ; } catch ( org.ovirt.engine.core.utils.MissingEnumTranslationException exception ) { org.junit.Assert.fail ( ( ( ( "Check for redundant keys in " + ( file.getAbsolutePath ( ) ) ) + " failed: " ) + ( exception.getMessage ( ) ) ) ) ; } }

Target:
public void testRedundantMessages ( ) throws java.io.IOException { org.ovirt.engine.core.utils.EnumTranslationProperties props = new org.ovirt.engine.core.utils.EnumTranslationProperties ( enumClass ) ; try ( java.io.InputStream is = new java.io.FileInputStream ( file ) ) { props.load ( is ) ; } catch ( org.ovirt.engine.core.utils.MissingEnumTranslationException exception ) { org.junit.jupiter.api.Assertions.fail ( ( ( ( "Check for redundant keys in " + ( file.getAbsolutePath ( ) ) ) + " failed: " ) + ( exception.getMessage ( ) ) ) ) ; } }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNetworkIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.compat.Guid networkId = attachment.getNetworkId ( ) ; java.lang.String networkName = attachment.getNetworkName ( ) ; org.ovirt.engine.core.compat.Guid violatingEntityId = attachment.getId ( ) ; return validateCoherentIdentification ( ( violatingEntityId == null ? null : violatingEntityId.toString ( ) ) , networkId , networkName , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY , networkBusinessEntityMap ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNetworkIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.compat.Guid networkId = attachment.getNetworkId ( ) ; java.lang.String networkName = attachment.getNetworkName ( ) ; org.ovirt.engine.core.compat.Guid violatingEntityId = attachment.getId ( ) ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( java.lang.String.valueOf ( violatingEntityId ) , networkId , networkName , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY , networkBusinessEntityMap ) ; }
Source:
private static void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.errors.VdcFault fault ) { if ( ( org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) ) != null ) { fault.setMessage ( org.ovirt.engine.ui.frontend.Frontend.vdsmErrorsTranslator.TranslateErrorTextSingle ( fault.getMessage ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runActionExecutionFailed ( actionType , fault ) ; } }

Target:
private static void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.errors.VdcFault fault ) { if ( ( org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) ) != null ) { java.lang.String translatedMessage = org.ovirt.engine.ui.frontend.Frontend.vdsmErrorsTranslator.TranslateErrorTextSingle ( ( ( fault.getError ( ) ) == null ? fault.getMessage ( ) : fault.getError ( ) . toString ( ) ) ) ; fault.setMessage ( translatedMessage ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runActionExecutionFailed ( actionType , fault ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.StorageDomainStatic getByName ( java.lang.String name , org.ovirt.engine.core.compat.Guid userId , boolean filtered ) { return getCallsHandler ( ) . executeRead ( "Getstorage_domain_staticByNameFiltered" , org.ovirt.engine.core.dao.StorageDomainStaticDAODbFacadeImpl.StorageDomainStaticRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "name" , name ) . addValue ( "user_id" , userId ) . addValue ( "filtered" , filtered ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.StorageDomainStatic getByName ( java.lang.String name , org.ovirt.engine.core.compat.Guid userId , boolean filtered ) { return getCallsHandler ( ) . executeRead ( "Getstorage_domain_staticByNameFiltered" , org.ovirt.engine.core.dao.StorageDomainStaticDAODbFacadeImpl.StorageDomainStaticRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "name" , name ) . addValue ( "user_id" , userId ) . addValue ( "is_filtered" , filtered ) ) ; }
Source:
public void setRowData ( int start , java.util.List < ? extends T > values ) { super . setRowData ( start , values ) ; selectionModel.resolveChanges ( ) ; updateTableControls ( ) ; }

Target:
public void setRowData ( int start , java.util.List < ? extends T > values ) { super . setRowData ( start , values ) ; selectionModel.resolveChanges ( ) ; updateTableControls ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { tableContainer.getElement ( ) . setScrollTop ( tableContainerVerticalScrollPosition ) ; } } ) ; }