auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void runningFailed ( ) { try { decreasePendingVms ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RemoveAsyncRunningCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.RunVmCommandBase.setCommandShouldBeLogged ( false ) ; _isRerun = false ; org.ovirt.engine.core.bll.RunVmCommandBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmPoolOnStopVm ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }

Target:
protected void runningFailed ( ) { try { decreasePendingVm ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RemoveAsyncRunningCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.RunVmCommandBase.setCommandShouldBeLogged ( false ) ; _isRerun = false ; org.ovirt.engine.core.bll.RunVmCommandBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmPoolOnStopVm ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }
Source:
private boolean canPerformQuotaValidation ( ) { if ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) == ( _oldDisk.getDiskStorageType ( ) ) ) { if ( ! ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( _oldDisk ) ) . getQuotaId ( ) . equals ( getQuotaId ( ) ) ) ) { return true ; } } return false ; }

Target:
private boolean isQuotaValidationNeeded ( ) { return ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) == ( _oldDisk.getDiskStorageType ( ) ) ; }
Source:
public static void getDefaultSpmPriority ( 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 ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public void getStorageDomainList ( 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.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
private static java.util.List < org.ovirt.engine.ui.frontend.server.dashboard.HistoryNode > getHourlyStorageHistory ( org.ovirt.engine.ui.frontend.server.dashboard.GlobalUtilizationResourceSummary entity , javax.sql.DataSource dwhDataSource ) throws java.sql.SQLException , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { java.util.List < org.ovirt.engine.ui.frontend.server.dashboard.HistoryNode > history = new java.util.ArrayList < > ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.dao.StorageDomainDwhDAO dao = new org.ovirt.engine.ui.frontend.server.dashboard.dao.StorageDomainDwhDAO ( dwhDataSource ) ; java.util.List < org.ovirt.engine.ui.frontend.server.dashboard.models.ResourceUsage > usageList = dao.getHourlyStorageHistory ( ) ; for ( org.ovirt.engine.ui.frontend.server.dashboard.models.ResourceUsage usage : usageList ) { history.add ( new org.ovirt.engine.ui.frontend.server.dashboard.HistoryNode ( usage.getEpoch ( ) , ( ( usage.getStorageValue ( ) ) / 1024 ) ) ) ; } return history ; }

Target:
private static java.util.List < org.ovirt.engine.ui.frontend.server.dashboard.HistoryNode > getHourlyStorageHistory ( javax.sql.DataSource dwhDataSource ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { java.util.List < org.ovirt.engine.ui.frontend.server.dashboard.HistoryNode > history = new java.util.ArrayList < > ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.dao.StorageDomainDwhDao dao = new org.ovirt.engine.ui.frontend.server.dashboard.dao.StorageDomainDwhDao ( dwhDataSource ) ; java.util.List < org.ovirt.engine.ui.frontend.server.dashboard.models.ResourceUsage > usageList = dao.getHourlyStorageHistory ( ) ; for ( org.ovirt.engine.ui.frontend.server.dashboard.models.ResourceUsage usage : usageList ) { history.add ( new org.ovirt.engine.ui.frontend.server.dashboard.HistoryNode ( usage.getEpoch ( ) , ( ( usage.getStorageValue ( ) ) / 1024 ) ) ) ; } return history ; }
Source:
protected void setImageStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus imageStatus , org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { if ( ( diskImage != null ) && ( ( diskImage.getImageStatus ( ) ) != imageStatus ) ) { diskImage.setImageStatus ( imageStatus ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( diskImage.getImage ( ) . getId ( ) , imageStatus ) ; } }

Target:
protected void setImageStatus ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus imageStatus , org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { if ( ( diskImage != null ) && ( ( diskImage.getImageStatus ( ) ) != imageStatus ) ) { diskImage.setImageStatus ( imageStatus ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( diskImage.getImage ( ) . getId ( ) , imageStatus ) ; } }
Source:
public void testMoveBySdId ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , getEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.MoveDisks , org.ovirt.engine.core.common.action.MoveDisksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } ) ) ; verifyActionResponse ( ( ( org.ovirt.engine.api.resource.VmDiskResource ) ( resource ) ) . move ( setUpMoveParams ( false ) ) ) ; }

Target:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.api.model.Disk entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , entity ) ; } }
Source:
private boolean isBalloonActiveOnHost ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getDbFacade ( ) . getVdsGroupDao ( ) . get ( vds.getVdsGroupId ( ) ) ; return ( cluster != null ) && ( cluster.isEnableBallooning ( ) ) ; }

Target:
private void saveVmJobsToDb ( ) { getDbFacade ( ) . getVmJobDao ( ) . updateAllInBatch ( vmJobsToUpdate.values ( ) ) ; if ( ! ( vmJobIdsToRemove.isEmpty ( ) ) ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.Required , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { getDbFacade ( ) . getVmJobDao ( ) . removeAll ( vmJobIdsToRemove ) ; return null ; } } ) ; } }
Source:
public static void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , 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 static void init ( ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.osRepository = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDeviceDao ( ) ; }

Target:
public static void init ( ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.osRepository = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.vmDeviceDao = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDeviceDao ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.vmDao = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDao ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.clusterDao = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getClusterDao ( ) ; }
Source:
public java.lang.String get ( java.lang.Object key ) { if ( key == null ) { return null ; } java.lang.String enumName = type.toString ( ) ; enumName = enumName.substring ( ( ( enumName.lastIndexOf ( "." ) ) + 1 ) , enumName.length ( ) ) ; java.lang.String trasnlatedEnum = enums.getString ( ( ( enumName + "___" ) + ( key.toString ( ) ) ) ) ; return trasnlatedEnum ; }

Target:
public java.lang.String get ( java.lang.Object key ) { if ( key == null ) { return null ; } java.lang.String enumName = type.toString ( ) ; enumName = enumName.substring ( ( ( enumName.lastIndexOf ( "." ) ) + 1 ) , enumName.length ( ) ) ; java.lang.String translatedEnum = enums.getString ( ( ( enumName + "___" ) + ( key.toString ( ) ) ) ) ; return translatedEnum ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; repoFileMetaDataDao = dbFacade.getRepoFileMetaDataDao ( ) ; }

Target:
public void testRemoveByRemoveIsoDomain ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.SHARED_ISO_STORAGE_DOMAIN_FOR_SP2_AND_SP3 , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertFalse ( listOfRepoFiles.isEmpty ( ) ) ; storageDomainDao.remove ( FixturesTool.SHARED_ISO_STORAGE_DOMAIN_FOR_SP2_AND_SP3 ) ; listOfRepoFiles = getActiveIsoDomain ( ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertTrue ( listOfRepoFiles.isEmpty ( ) ) ; }
Source:
public void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean doRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.SearchParameters params = new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , ( doRefresh ? params : params.withoutRefresh ( ) ) , aQuery ) ; }

Target:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
protected void doTestGet ( java.lang.String base ) { setUpGetSystemVersionExpectations ( ) ; setUpGetSystemStatisticsExpectations ( ) ; verifyResponse ( resource.get ( ) ) ; }

Target:
private void setupExpectations ( org.ovirt.engine.core.common.mode.ApplicationMode appMode , java.lang.String [ ] relationships ) { org.easymock.EasyMock.expect ( current.get ( org.ovirt.engine.core.common.mode.ApplicationMode.class ) ) . andReturn ( appMode ) . anyTimes ( ) ; resource.setUriInfo ( setUpUriInfo ( ( ( org.ovirt.engine.api.restapi.resource.BackendApiResourceTest.URI_BASE ) + "/" ) , relationships ) ) ; setUpGetSystemVersionExpectations ( ) ; setUpGetSystemStatisticsExpectations ( ) ; }
Source:
public void testRemoveBricksInBatch ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick1 = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick2 = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID2 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = new java.util.ArrayList < > ( ) ; bricks.add ( existingBrick1 ) ; bricks.add ( existingBrick2 ) ; dao.removeAllInBatch ( bricks ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newEnity1 = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newEnity2 = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID2 ) ; org.junit.Assert.assertNull ( newEnity1 ) ; org.junit.Assert.assertNull ( newEnity2 ) ; }

Target:
public void testRemoveBricksInBatch ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick1 = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick2 = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID2 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = new java.util.ArrayList < > ( ) ; bricks.add ( existingBrick1 ) ; bricks.add ( existingBrick2 ) ; dao.removeAllInBatch ( bricks ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newEnity1 = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newEnity2 = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID2 ) ; org.junit.jupiter.api.Assertions.assertNull ( newEnity1 ) ; org.junit.jupiter.api.Assertions.assertNull ( newEnity2 ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc cloneImageStructure ( java.lang.String spUUID , java.lang.String srcDomUUID , java.lang.String imgGUID , java.lang.String dstDomUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Image.cloneStructure" ) . withParameter ( "imageID" , imgGUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , srcDomUUID ) . withParameter ( "dstSdUUID" , dstDomUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn cloneImageStructure ( java.lang.String spUUID , java.lang.String srcDomUUID , java.lang.String imgGUID , java.lang.String dstDomUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Image.cloneStructure" ) . withParameter ( "imageID" , imgGUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , srcDomUUID ) . withParameter ( "dstSdUUID" , dstDomUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn ( response ) ; }
Source:
private void setImportedVms ( org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm > importedVms ) { this . importedVms = importedVms ; }

Target:
public void loadVmsFromExportDomain ( ) { startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExportDomain , new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getDataCenters ( ) . getSelectedItem ( ) . getId ( ) , exportDomain.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { updateVms ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) ; } } ) ) ; }
Source:
public void testMoveWithStorageDomainName ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ( "Storage: name=" + ( NAMES [ 2 ] ) ) , SearchType.StorageDomain , getStorageDomain ( 2 ) ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setName ( NAMES [ 2 ] ) ; doTestMove ( storageDomain ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomainStatic getStorageDomainStatic ( int idx ) { org.ovirt.engine.api.restapi.resource.StorageDomainStatic dom = new org.ovirt.engine.api.restapi.resource.StorageDomainStatic ( ) ; dom.setId ( GUIDS [ idx ] ) ; dom.setStorageName ( NAMES [ idx ] ) ; return dom ; }
Source:
private boolean checkCreateInstancePermission ( org.ovirt.engine.core.bll.utils.PermissionSubject permSubject ) { final java.util.List < org.ovirt.engine.core.common.VdcObjectType > overriddenPermissionObjectTypes = java.util.Arrays.asList ( VdcObjectType.VdsGroups , VdcObjectType.VmTemplate ) ; final boolean instanceCreateObjectType = overriddenPermissionObjectTypes.contains ( permSubject.getObjectType ( ) ) ; if ( ! instanceCreateObjectType ) { return false ; } final org.ovirt.engine.core.bll.utils.PermissionSubject alteredPermissionSubject = new org.ovirt.engine.core.bll.utils.PermissionSubject ( permSubject.getObjectId ( ) , permSubject.getObjectType ( ) , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_INSTANCE , permSubject.getMessage ( ) ) ; return checkSinglePermission ( alteredPermissionSubject , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getValidationMessages ( ) ) ; }

Target:
private boolean checkCreateInstancePermission ( org.ovirt.engine.core.bll.utils.PermissionSubject permSubject ) { final java.util.List < org.ovirt.engine.core.common.VdcObjectType > overriddenPermissionObjectTypes = java.util.Arrays.asList ( VdcObjectType.VdsGroups , VdcObjectType.VmTemplate ) ; final boolean instanceCreateObjectType = overriddenPermissionObjectTypes.contains ( permSubject.getObjectType ( ) ) ; if ( ! instanceCreateObjectType ) { return false ; } final org.ovirt.engine.core.bll.utils.PermissionSubject alteredPermissionSubject = new org.ovirt.engine.core.bll.utils.PermissionSubject ( permSubject.getObjectId ( ) , permSubject.getObjectType ( ) , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_INSTANCE , permSubject.getMessage ( ) ) ; return checkSinglePermission ( alteredPermissionSubject , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.utils.VdsCommandsHelper.runVdsCommandWithFailover ( VDSCommandType.AllocateVolume , new org.ovirt.engine.core.common.vdscommands.AllocateVolumeVDSCommandParameters ( org.ovirt.engine.core.bll.AllocateImageGroupVolumeCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.AllocateImageGroupVolumeCommand.getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.bll.AllocateImageGroupVolumeCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.AllocateImageGroupVolumeCommand.getParameters ( ) . getSize ( ) ) , org.ovirt.engine.core.bll.AllocateImageGroupVolumeCommand.getParameters ( ) . getStoragePoolId ( ) , this ) ; org.ovirt.engine.core.bll.AllocateImageGroupVolumeCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.utils.VdsCommandsHelper.runVdsCommandWithFailover ( VDSCommandType.AllocateVolume , new org.ovirt.engine.core.common.vdscommands.AllocateVolumeVDSCommandParameters ( org.ovirt.engine.core.bll.AllocateImageGroupVolumeCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.AllocateImageGroupVolumeCommand.getParameters ( ) . getJobId ( ) , org.ovirt.engine.core.bll.AllocateImageGroupVolumeCommand.getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.bll.AllocateImageGroupVolumeCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.AllocateImageGroupVolumeCommand.getParameters ( ) . getSize ( ) ) , org.ovirt.engine.core.bll.AllocateImageGroupVolumeCommand.getParameters ( ) . getStoragePoolId ( ) , this ) ; org.ovirt.engine.core.bll.AllocateImageGroupVolumeCommand.setSucceeded ( true ) ; }
Source:
public static org.ovirt.engine.core.aaa.DirectoryUser findPrincipalById ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.lang.String id , final boolean groupsResolving , final boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > users = org.ovirt.engine.core.aaa.AuthzUtils.findPrincipalsByIds ( extension , namespace , java.util.Arrays.asList ( id ) , groupsResolving , groupsResolvingRecursive ) ; if ( users.isEmpty ( ) ) { return null ; } return users.get ( 0 ) ; }

Target:
public static java.util.List < org.ovirt.engine.api.extensions.ExtMap > queryGroupRecords ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { org.ovirt.engine.api.extensions.ExtMap inputMap = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.GROUP ) . mput ( Authz.InvokeKeys.QUERY_FLAGS , org.ovirt.engine.core.aaa.AuthzUtils.queryFlagValue ( groupsResolving , groupsResolvingRecursive ) ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) . mput ( Authz.InvokeKeys.NAMESPACE , namespace ) ; return org.ovirt.engine.core.aaa.AuthzUtils.populateGroups ( extension , namespace , inputMap ) ; }
Source:
public void newProfile ( ) { if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profileModel = new org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel ( this , org.ovirt.engine.core.compat.Version.v3_3 ) ; setWindow ( profileModel ) ; initNetworkList ( profileModel ) ; }

Target:
public void newProfile ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel treeSelectedItem = ( ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel ) ( org.ovirt.engine.ui.uicommonweb.models.CommonModel.getInstance ( ) . getSystemTree ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel treeSelectedDc = org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel.findAncestor ( SystemTreeItemType.DataCenter , treeSelectedItem ) ; final org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profileModel = new org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel ( this , ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( treeSelectedDc.getEntity ( ) ) ) . getcompatibility_version ( ) ) ; setWindow ( profileModel ) ; initNetworkList ( profileModel ) ; }
Source:
private void updateVnicsFromParams ( final org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters ) { if ( ( parameters.size ( ) ) == 0 ) { callback.vnicCreated ( vmId ) ; return ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.UpdateVmInterface , parameters , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { callback.vnicCreated ( vmId ) ; } } , this ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RemoveVmInterface , removeVnicParameters , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { callback.vnicCreated ( vmId ) ; } } , this ) ; }
Source:
public boolean isProxyHostAvailable ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.bll.FenceProxyLocator proxyHostLocator = getProxyLocator ( vds ) ; if ( ! ( proxyHostLocator.isProxyHostAvailable ( ) ) ) { messages.add ( VdcBllMessages.VDS_NO_VDS_PROXY_FOUND.name ( ) ) ; return false ; } else { return true ; } }

Target:
public boolean isProxyHostAvailable ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.bll.pm.FenceProxyLocator proxyHostLocator = getProxyLocator ( vds ) ; if ( ! ( proxyHostLocator.isProxyHostAvailable ( ) ) ) { messages.add ( VdcBllMessages.VDS_NO_VDS_PROXY_FOUND.name ( ) ) ; return false ; } else { return true ; } }
Source:
private java.lang.String getManagementOptions ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { java.lang.String managementOptions = "" ; if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Primary ) ) { managementOptions = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getDefaultAgentOptions ( _vds.getPmType ( ) , _vds.getPmOptions ( ) ) ; } else if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Secondary ) ) { managementOptions = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getDefaultAgentOptions ( _vds.getPmSecondaryType ( ) , _vds.getPmSecondaryOptions ( ) ) ; } return managementOptions ; }

Target:
private java.lang.String getOptions ( org.ovirt.engine.core.common.businessentities.FenceAgent agent ) { org.ovirt.engine.core.common.businessentities.ArchitectureType architectureType = architectureHelper.getArchitecture ( _vds.getStaticData ( ) ) ; java.lang.String managementOptions = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getDefaultAgentOptions ( agent.getType ( ) , ( ( agent.getOptions ( ) ) == null ? "" : agent.getOptions ( ) ) , architectureType ) ; return managementOptions ; }
Source:
public static void GetAllProviders ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { 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 ( ) , 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.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
public void setUp ( ) { tested = org.mockito.Mockito.spy ( new org.ovirt.engine.ui.common.system.ClientStorageImpl ( org.ovirt.engine.ui.common.system.ClientStorageImplTest.KEY_PREFIX ) { @ java.lang.Override void initStorage ( ) { } } ) ; org.mockito.Mockito.doNothing ( ) . when ( tested ) . setLocalItemImpl ( org.mockito.ArgumentMatchers.any ( java.lang.String.class ) , org.mockito.ArgumentMatchers.any ( java.lang.String.class ) ) ; org.mockito.Mockito.doNothing ( ) . when ( tested ) . setSessionItemImpl ( org.mockito.ArgumentMatchers.any ( java.lang.String.class ) , org.mockito.ArgumentMatchers.any ( java.lang.String.class ) ) ; }

Target:
public void setUp ( ) { tested = org.mockito.Mockito.spy ( new org.ovirt.engine.ui.common.system.ClientStorageImpl ( org.ovirt.engine.ui.common.system.ClientStorageImplTest.KEY_PREFIX ) { @ java.lang.Override void initStorage ( ) { } } ) ; org.mockito.Mockito.doNothing ( ) . when ( tested ) . setLocalItemImpl ( org.mockito.ArgumentMatchers.anyString ( ) , org.mockito.ArgumentMatchers.anyString ( ) ) ; org.mockito.Mockito.doNothing ( ) . when ( tested ) . setSessionItemImpl ( org.mockito.ArgumentMatchers.anyString ( ) , org.mockito.ArgumentMatchers.anyString ( ) ) ; }
Source:
private void bindFrontendInfrastructure ( ) { bind ( org.ovirt.engine.ui.frontend.Frontend.class ) . in ( com.google.inject.Singleton.class ) ; requestStaticInjection ( Frontend.InstanceHolder.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.VdcOperationManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.OperationProcessor.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.CommunicationProvider.class ) . to ( org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
private void bindFrontendInfrastructure ( ) { bind ( org.ovirt.engine.ui.frontend.Frontend.class ) . in ( com.google.inject.Singleton.class ) ; requestStaticInjection ( Frontend.InstanceHolder.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.VdcOperationManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.OperationProcessor.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.CommunicationProvider.class ) . to ( org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.ExternalSubnet > ( ) ; } return source ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > filterTemplatesByArchitecture ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > list , org.ovirt.engine.core.common.businessentities.ArchitectureType architecture ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > filteredList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : list ) { if ( ( template.getId ( ) . equals ( Guid.Empty ) ) || ( template.getClusterArch ( ) . equals ( architecture ) ) ) { filteredList.add ( template ) ; } } return filteredList ; }
Source:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( ) ; cpuExists ( ) ; cpuManufacturersMatch ( ) ; org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDAO2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; org.mockito.Mockito.when ( storagePoolDAO2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDAO2 ) . when ( cmd ) . getStoragePoolDAO ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }

Target:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDAO2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; org.mockito.Mockito.when ( storagePoolDAO2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDAO2 ) . when ( cmd ) . getStoragePoolDAO ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.equals ( ListModel.SelectedItemChangedEventDefinition ) ) && ( sender == ( getNetwork ( ) ) ) ) { Network_SelectedItemChanged ( null ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.equals ( ListModel.SelectedItemChangedEventDefinition ) ) && ( sender == ( getNetwork ( ) ) ) ) { Network_SelectedItemChanged ( null ) ; } }
Source:
public void canDisableVirtioScsiSuccess ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; org.junit.Assert.assertThat ( validator.canDisableVirtioScsi ( java.util.Collections.singletonList ( disk ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void canDisableVirtioScsiSuccess ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( disk.getId ( ) , vm.getId ( ) ) ; dve.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setDiskVmElements ( java.util.Collections.singletonList ( dve ) ) ; org.junit.Assert.assertThat ( validator.canDisableVirtioScsi ( java.util.Collections.singletonList ( disk ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public java.lang.String renderNullSafe ( java.lang.Object object ) { return ( ( org.ovirt.engine.core.common.businessentities.Quota ) ( object ) ) . getQuotaName ( ) ; }

Target:
private void initListBoxEditors ( ) { destClusterEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ) ; destClusterQuotaEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.Quota > ( ) ) ; destStorageEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer ( ) ) ; cpuProfileEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.profiles.CpuProfile > ( ) ) ; }
Source:
public void removeAllIllegalDisks ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.compat.Guid vmId ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ) { if ( ( diskImage.getimageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.ILLEGAL ) ) { org.ovirt.engine.core.bll.ImagesHandler.removeDiskImage ( diskImage , vmId ) ; } } }

Target:
public void removeAllIllegalDisks ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.compat.Guid vmId ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ) { if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.ILLEGAL ) ) { org.ovirt.engine.core.bll.ImagesHandler.removeDiskImage ( diskImage , vmId ) ; } } }
Source:
public void diskImagesAlreadyExistOneExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( null ) . when ( validator ) . getExistingDisk ( disk2.getId ( ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk1 ) ) ) ) ) ; }

Target:
public void diskImagesAlreadyExistOneExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( null ) . when ( validator ) . getExistingDisk ( disk2.getId ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk1 ) ) ) ) ) ; }
Source:
public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Frontend: sucessfully executed RunAction, determining result!" ) ; org.ovirt.engine.ui.frontend.Frontend.handleActionResult ( actionType , parameters , result , callback , state , showErrorDialog ) ; }

Target:
public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from logoff." ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , result ) ; if ( ( org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoginHandler ( ) ) != null ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoginHandler ( ) . onLogout ( ) ; } }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = getDbFacade ( ) . getDiskDao ( ) . get ( getParameters ( ) . getObjectId ( ) ) ; if ( disk == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; return false ; } if ( ! ( disk.getDiskStorageType ( ) . isInternal ( ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_DISK_OPERATION ) ; return false ; } this . disk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; return super . validate ( ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = diskDao.get ( getParameters ( ) . getObjectId ( ) ) ; if ( disk == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; return false ; } if ( ! ( disk.getDiskStorageType ( ) . isInternal ( ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_DISK_OPERATION ) ; return false ; } this . disk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; return super . validate ( ) ; }
Source:
private static java.lang.String getIommu ( org.ovirt.engine.core.common.utils.CpuVendor cpuVendor , boolean iommu ) { if ( ! iommu ) { return "" ; } switch ( cpuVendor ) { case AMD : return "amd_iommu=on " ; case INTEL : return "intel_iommu=on " ; case IBM : return "" ; default : throw new java.lang.RuntimeException ( ( "Unknown CpuType: " + cpuVendor ) ) ; } }

Target:
private static java.lang.String getIommu ( org.ovirt.engine.core.common.utils.CpuVendor cpuVendor , boolean iommu ) { if ( ! iommu ) { return "" ; } switch ( cpuVendor ) { case AMD : return "amd_iommu=on " ; case INTEL : return "intel_iommu=on " ; case IBM : case IBMS390 : return "" ; default : throw new java.lang.RuntimeException ( ( "Unknown CpuType: " + cpuVendor ) ) ; } }
Source:
protected boolean isVirtioScsiEnabled ( ) { java.lang.Boolean virtioScsiEnabled = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isVirtioScsiEnabled ( ) ; boolean isOsSupportedForVirtIoScsi = org.ovirt.engine.core.bll.validator.VmValidationUtils.isDiskInterfaceSupportedByOs ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) , DiskInterface.VirtIO_SCSI ) ; return virtioScsiEnabled != null ? virtioScsiEnabled : ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) && isOsSupportedForVirtIoScsi ; }

Target:
protected boolean isVirtioScsiEnabled ( ) { java.lang.Boolean virtioScsiEnabled = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isVirtioScsiEnabled ( ) ; boolean isOsSupportedForVirtIoScsi = org.ovirt.engine.core.bll.validator.VmValidationUtils.isDiskInterfaceSupportedByOs ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) , DiskInterface.VirtIO_SCSI ) ; return virtioScsiEnabled != null ? virtioScsiEnabled : ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) && isOsSupportedForVirtIoScsi ; }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }

Target:
public java.lang.Void runInTransaction ( ) { buildChildCommandInfos ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > entry : childCommandInfoMap.entrySet ( ) ) { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.utils.BackendUtils.getBackendCommandObjectsHandler ( log ) . createAction ( entry.getValue ( ) . getFirst ( ) , entry.getValue ( ) . getSecond ( ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; childCommandsMap.put ( entry.getKey ( ) , command ) ; } return null ; }