auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getNewCommand ( ) ) ) { return newNetworkPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getEditCommand ( ) ) ) { return editNetworkPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( windowModel instanceof org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.NewHostNetworkQosModel ) { return addQosPopupProvider.get ( ) ; } if ( lastExecutedCommand == ( getModel ( ) . getNewCommand ( ) ) ) { return newNetworkPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getEditCommand ( ) ) ) { return editNetworkPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
protected boolean setAndValidateDiskProfiles ( ) { java.util.Map < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageByImageId ( parameters.getImageId ( ) ) ; map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePool ( ) . getcompatibility_version ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { java.util.Map < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageByImageId ( parameters.getImageId ( ) ) ; map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePool ( ) . getcompatibility_version ( ) , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getCurrentUser ( ) ) ) ; }
Source:
public void testDetermineNetworkType ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator validator = new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( null , null ) ; org.junit.Assert.assertThat ( validator.determineNetworkType ( vlanNetwork ) , org.hamcrest.CoreMatchers.is ( NetworkAttachmentsValidator.NetworkType.VLAN ) ) ; org.junit.Assert.assertThat ( validator.determineNetworkType ( vmNetwork1 ) , org.hamcrest.CoreMatchers.is ( NetworkAttachmentsValidator.NetworkType.VM ) ) ; org.junit.Assert.assertThat ( validator.determineNetworkType ( nonVmNetwork1 ) , org.hamcrest.CoreMatchers.is ( NetworkAttachmentsValidator.NetworkType.NON_VM ) ) ; }

Target:
public void testDetermineNetworkType ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator validator = new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( null , null , networkExclusivenessValidator ) ; org.junit.Assert.assertThat ( validator.determineNetworkType ( vlanNetwork ) , org.hamcrest.CoreMatchers.is ( NetworkType.VLAN ) ) ; org.junit.Assert.assertThat ( validator.determineNetworkType ( vmNetwork1 ) , org.hamcrest.CoreMatchers.is ( NetworkType.VM ) ) ; org.junit.Assert.assertThat ( validator.determineNetworkType ( nonVmNetwork1 ) , org.hamcrest.CoreMatchers.is ( NetworkType.NON_VM ) ) ; }
Source:
private boolean devicePluggable ( org.ovirt.engine.core.common.businessentities.VmDevice device ) { return ( ( VmDeviceType.DISK.getName ( ) . equals ( device.getDevice ( ) ) ) && ( ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK ) == ( device.getType ( ) ) ) ) || ( ( VmDeviceType.BRIDGE.getName ( ) . equals ( device.getDevice ( ) ) ) && ( ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.INTERFACE ) == ( device.getType ( ) ) ) ) ; }

Target:
private boolean devicePluggable ( org.ovirt.engine.core.common.businessentities.VmDevice device ) { return ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isDisk ( device ) ) || ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isBridge ( device ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.UsbPolicy forStringValue ( java.lang.String value ) { org.ovirt.engine.core.common.businessentities.UsbPolicy retVal = null ; if ( ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.PRE_3_1_ENABLED ) ) || ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_LEGACY.name ( ) ) ) ) { retVal = org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_LEGACY ; } else if ( ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.PRE_3_1_DISABLED ) ) || ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED.name ( ) ) ) ) { retVal = org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED ; } else if ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_NATIVE.name ( ) ) ) { retVal = org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_NATIVE ; } return retVal ; }

Target:
public static org.ovirt.engine.core.common.businessentities.UsbPolicy forStringValue ( java.lang.String value ) { org.ovirt.engine.core.common.businessentities.UsbPolicy retVal = null ; if ( ( ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.PRE_3_1_ENABLED ) ) || ( org.ovirt.engine.core.common.businessentities.UsbPolicy.PRE_4_1_ENABLED_LEGACY.equalsIgnoreCase ( value ) ) ) || ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_NATIVE.name ( ) ) ) ) { retVal = org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_NATIVE ; } else if ( ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.PRE_3_1_DISABLED ) ) || ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED.name ( ) ) ) ) { retVal = org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED ; } return retVal ; }
Source:
public void getUsbPolicyUsbTypeNull30 ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setCompatibilityVersion ( Version.v3_0 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getCompatibilityVersion ( ) ) , UsbPolicy.ENABLED_LEGACY ) ; }

Target:
public void getUsbPolicyOnUpdateCurrentlyDisabledGotEnabledNotSetNativePolicyUsb ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setType ( "native" ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( usb , UsbPolicy.DISABLED ) , UsbPolicy.DISABLED ) ; }
Source:
private static void updateDisksStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disksList ) { disk.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Collections.singletonList ( storageDomain.getId ( ) ) ) ) ; } org.ovirt.engine.core.bll.VmHandler.updateDiskVolumeType ( storageDomain.getStorageType ( ) , disksList.get ( 0 ) ) ; }

Target:
private static void updateDisksStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disksList ) { disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( storageDomain.getId ( ) ) ) ) ; } org.ovirt.engine.core.bll.VmHandler.updateDiskVolumeType ( storageDomain.getStorageType ( ) , disksList.get ( 0 ) ) ; }
Source:
public void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.TagsUserGroupMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.TagsUserGroupMap entity = new org.ovirt.engine.core.common.businessentities.TagsUserGroupMap ( ) ; entity.setgroup_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "group_id" ) ) ) ; entity.settag_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "tag_id" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.TagsUserGroupMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.TagsUserGroupMap entity = new org.ovirt.engine.core.common.businessentities.TagsUserGroupMap ( ) ; entity.setgroup_id ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "group_id" ) ) ) ; entity.settag_id ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "tag_id" ) ) ) ; return entity ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public 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.GetAllDisksByVmIdParameters ( vmId ) , aQuery ) ; }

Target:
public static void GetDocumentationBaseURL ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL ) , aQuery ) ; }
Source:
private void CancelMigration ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VmOperationParameterBase ( a.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.CancelMigrateVm , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
private void cancelMigration ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VmOperationParameterBase ( a.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.CancelMigrateVm , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getBookmarkDAO ( ) ) ; new_bookmark = new org.ovirt.engine.core.common.businessentities.bookmarks ( ) ; java.util.Random r = new java.util.Random ( java.lang.System.currentTimeMillis ( ) ) ; new_bookmark.setbookmark_name ( ( "newbookmarkname" + ( ( r.nextInt ( ) ) % ( org.ovirt.engine.core.dao.BookmarkDAOTest.BOOKMARK_MAX_RANDOM_NUMBER ) ) ) ) ; new_bookmark.setbookmark_value ( "newbookmarkvalue" ) ; existing_bookmark = dao.get ( new org.ovirt.engine.core.compat.Guid ( "a4affabf-7b45-4a6c-b0a9-107d0bbe265e" ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getBookmarkDao ( ) ) ; new_bookmark = new org.ovirt.engine.core.common.businessentities.bookmarks ( ) ; java.util.Random r = new java.util.Random ( java.lang.System.currentTimeMillis ( ) ) ; new_bookmark.setbookmark_name ( ( "newbookmarkname" + ( ( r.nextInt ( ) ) % ( org.ovirt.engine.core.dao.BookmarkDAOTest.BOOKMARK_MAX_RANDOM_NUMBER ) ) ) ) ; new_bookmark.setbookmark_value ( "newbookmarkvalue" ) ; existing_bookmark = dao.get ( new org.ovirt.engine.core.compat.Guid ( "a4affabf-7b45-4a6c-b0a9-107d0bbe265e" ) ) ; }
Source:
private boolean isLibrbdAvailable ( ) { if ( ! ( org.ovirt.engine.core.bll.storage.CINDERStorageHelper.isLibrbdAvailable ( getVds ( ) ) ) ) { log.error ( "Couldn't found librbd1 package on vds (needed for Cinder storage domains)." , getVds ( ) . getName ( ) ) ; setNonOperational ( NonOperationalReason.LIBRBD_PACKAGE_NOT_AVAILABLE , getVds ( ) ) ; return false ; } return true ; }

Target:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason ) { runInternalAction ( VdcActionType.SetNonOperationalVds , new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( getVds ( ) . getId ( ) , reason ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( getContext ( ) ) ) ; }
Source:
public void setup ( ) { org.mockito.Mockito.when ( underTest.getActionType ( ) ) . thenReturn ( VdcActionType.ChangeVMCluster ) ; }

Target:
public void canRunForHostedEngine ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VM hostedEngine = new org.ovirt.engine.core.common.businessentities.VM ( ) ; hostedEngine.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; underTest.setVm ( hostedEngine ) ; underTest.init ( ) ; org.junit.Assert.assertThat ( underTest.canRunActionOnNonManagedVm ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public boolean prepareConnectHostToStoragePoolServers ( org.ovirt.engine.core.common.action.ConnectHostToStoragePoolServersParameters parameters , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > res = org.ovirt.engine.core.bll.storage.ISCSIStorageHelper.updateIfaces ( connections , parameters.getVds ( ) . getId ( ) ) ; connections.clear ( ) ; connections.addAll ( res ) ; return true ; }

Target:
private void prepareStorageServer ( org.ovirt.engine.core.common.action.HostStoragePoolParametersBase parameters , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > res = org.ovirt.engine.core.bll.storage.ISCSIStorageHelper.updateIfaces ( connections , parameters.getVds ( ) . getId ( ) ) ; connections.clear ( ) ; connections.addAll ( res ) ; }
Source:
public void testPositiveValidateWithNoDisks ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . isEmpty ( ) ) ; }

Target:
public void testPositiveValidateWithNoDisks ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
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 getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { if ( model.getModel ( ) . isPool ( ) ) { throw new java.lang.IllegalArgumentException ( "The console popup can not be used with pool, only with VM" ) ; } this . model = model ; initView ( model ) ; initListeners ( model ) ; java.lang.String vmName = model.getModel ( ) . getVM ( ) . getName ( ) ; getView ( ) . setVmName ( vmName ) ; super . init ( model ) ; }

Target:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { if ( model.getModel ( ) . isPool ( ) ) { throw new java.lang.IllegalArgumentException ( "The console popup can not be used with pool, only with VM" ) ; } this . model = model ; initModel ( model ) ; initView ( model ) ; initListeners ( model ) ; java.lang.String vmName = model.getModel ( ) . getVM ( ) . getName ( ) ; getView ( ) . setVmName ( vmName ) ; super . init ( model ) ; }
Source:
protected boolean getSucceeded ( ) { return super . getSucceeded ( ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ( ( heStorageDomain ) != null ) && ( ( heStorageDomain.getId ( ) ) != null ) ) { return java.util.Collections.singletonMap ( heStorageDomain.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.STORAGE , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DEVICE_LOCKED ) ) ; } return java.util.Collections.emptyMap ( ) ; }
Source:
protected void setUpGetEntityExpectationsOnDoPopulate ( boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetStorageDomainByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ 0 ] } , ( notFound ? null : getStorageDomainStatic ( ) ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetStoragePoolsByStorageDomainId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getStoragePools ( ) ) ) ; }

Target:
protected void setUpGetEntityExpectationsOnDoPopulate ( boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( QueryType.GetStorageDomainByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ 0 ] } , ( notFound ? null : getStorageDomainStatic ( ) ) ) ; setUpGetEntityExpectations ( QueryType.GetStoragePoolsByStorageDomainId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getStoragePools ( ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { getConnectivityTimeout ( ) . setEntity ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; postOnSetupNetworks ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { java.lang.Object returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > allHostVfs = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig : allHostVfs ) { originalVfsConfigs.add ( vfsConfig ) ; nicToVfsConfig.put ( vfsConfig.getNicId ( ) , new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( vfsConfig ) ) ; } queryFreeBonds ( ) ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.hosts.HostBondInterfaceModel object ) { super . edit ( object ) ; info.setVisible ( false ) ; message.setVisible ( false ) ; checkConnectivity.setVisible ( false ) ; commitChanges.setVisible ( false ) ; layoutPanel.remove ( infoPanel ) ; layoutPanel.setWidgetSize ( mainPanel , 300 ) ; asPopupPanel ( ) . setPixelSize ( 400 , 400 ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.hosts.HostBondInterfaceModel object ) { super . edit ( object ) ; bondSuggestEditor.setVisible ( true ) ; bondEditor.setVisible ( false ) ; info.setVisible ( false ) ; message.setVisible ( false ) ; layoutPanel.remove ( infoPanel ) ; layoutPanel.setWidgetSize ( mainPanel , 300 ) ; asPopupPanel ( ) . setPixelSize ( 400 , 400 ) ; }
Source:
public void testNoHostedEngine ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "5" ) ; hostedEngine.setVmMemSizeMb ( 7000 ) ; hostedEngine.setOrigin ( OriginType.OVIRT ) ; org.mockito.Mockito.doReturn ( null ) . when ( vmDao ) . getHostedEngineVm ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.Assert.assertEquals ( 5 , result.size ( ) ) ; }

Target:
public void testNoHostedEngine ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "5" ) ; hostedEngine.setVmMemSizeMb ( 7000 ) ; hostedEngine.setOrigin ( OriginType.OVIRT ) ; org.mockito.Mockito.doReturn ( null ) . when ( vmDao ) . getHostedEngineVm ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.jupiter.api.Assertions.assertEquals ( 5 , result.size ( ) ) ; }
Source:
private void addInterfaceToDb ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmNetworkInterface ) { org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacade = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) ; dbFacade.getVmNetworkInterfaceDAO ( ) . save ( vmNetworkInterface ) ; org.ovirt.engine.core.bll.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface ) ; dbFacade.getVmNetworkStatisticsDAO ( ) . save ( vmNetworkInterface.getStatistics ( ) ) ; org.ovirt.engine.core.bll.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface.getStatistics ( ) ) ; }

Target:
private void addInterfaceToDb ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmNetworkInterface ) { org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacade = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) ; dbFacade.getVmNetworkInterfaceDao ( ) . save ( vmNetworkInterface ) ; org.ovirt.engine.core.bll.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface ) ; dbFacade.getVmNetworkStatisticsDao ( ) . save ( vmNetworkInterface.getStatistics ( ) ) ; org.ovirt.engine.core.bll.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface.getStatistics ( ) ) ; }
Source:
private boolean ContainsLocalStorage ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > Cast ( getSelectedItems ( ) ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { return true ; } } return false ; }

Target:
private boolean ContainsLocalStorage ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { return true ; } } return false ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filter ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( ( ( "policy unit:" + ( getName ( ) ) ) + "filter is not implemented" ) ) ; return hosts ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filter ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( ( ( "policy unit:" + ( getPolicyUnit ( ) . getName ( ) ) ) + "filter is not implemented" ) ) ; return hosts ; }
Source:
protected java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getAdjustedDiskImagesFromConfiguration ( ) { if ( ( diskImagesFromConfiguration ) == null ) { diskImagesFromConfiguration = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( vmFromConfiguration.getDiskMap ( ) . values ( ) , false , true , true ) ; diskImagesFromConfiguration.addAll ( org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( vmFromConfiguration.getDiskMap ( ) . values ( ) , true ) ) ; adjustDisksImageConfiguration ( diskImagesFromConfiguration ) ; } return diskImagesFromConfiguration ; }

Target:
protected java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getAdjustedDiskImagesFromConfiguration ( ) { if ( ( diskImagesFromConfiguration ) == null ) { diskImagesFromConfiguration = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( vmFromConfiguration.getDiskMap ( ) . values ( ) , false , true , true ) ; diskImagesFromConfiguration.addAll ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterDisksBasedOnCinder ( vmFromConfiguration.getDiskMap ( ) . values ( ) , true ) ) ; adjustDisksImageConfiguration ( diskImagesFromConfiguration ) ; } return diskImagesFromConfiguration ; }
Source:
public void testNotRemovingUsedPoolRecordNotUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( macPoolDaoMock.getDcUsageCount ( org.mockito.Matchers.eq ( macPool.getId ( ) ) ) ) . thenReturn ( 0 ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.MacPoolValidator ( macPool ) . notRemovingUsedPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotRemovingUsedPoolRecordIsUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; final org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setName ( "storagePool" ) ; org.mockito.Mockito.when ( storagePoolDao.getAllDataCentersByMacPoolId ( macPool.getId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( storagePool ) ) ; org.junit.Assert.assertThat ( macPoolValidator.notRemovingUsedPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_STILL_USED_MAC_POOL ) ) ; }
Source:
public void testExecuteQueryCommand ( ) { org.ovirt.engine.core.common.queries.IdQueryParameters params = getQueryParameters ( ) ; org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( vmId ) ; org.ovirt.engine.core.bll.snapshots.GetAllVmSnapshotsByVmIdQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = getQuery ( ) ; query.executeQueryCommand ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots = query.getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertTrue ( "snapshot should be in the return value" , snapshots.contains ( snapshot ) ) ; org.junit.Assert.assertEquals ( "there should be exactly one snapshot returned" , 1 , snapshots.size ( ) ) ; }

Target:
public void testExecuteQueryCommand ( ) { org.ovirt.engine.core.common.queries.IdQueryParameters params = getQueryParameters ( ) ; org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( vmId ) ; org.ovirt.engine.core.bll.snapshots.GetAllVmSnapshotsByVmIdQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = getQuery ( ) ; query.executeQueryCommand ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots = query.getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( snapshots.contains ( snapshot ) , "snapshot should be in the return value" ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , snapshots.size ( ) , "there should be exactly one snapshot returned" ) ; }
Source:
public void validateVmMemoryCanRunOnVdsHighMemLowOverhead ( ) { vm.setMinAllocatedMem ( 10000 ) ; vm.setVmMemSizeMb ( 10000 ) ; vds.setGuestOverhead ( ( - 1200 ) ) ; boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasOvercommitMemoryToRunVM ( vds , vm ) ; org.junit.Assert.assertEquals ( vmPassedMemoryRequirement , true ) ; }

Target:
public void validateVmMemoryCanRunOnVdsHighMemLowOverhead ( ) { vm.setMinAllocatedMem ( 10000 ) ; vm.setVmMemSizeMb ( 10000 ) ; org.mockito.Mockito.doReturn ( ( - 1200 ) ) . when ( vmOverheadCalculator ) . getStaticOverheadInMb ( org.mockito.Matchers.any ( ) ) ; boolean vmPassedMemoryRequirement = slaValidator.hasOvercommitMemoryToRunVM ( vds , vm ) ; org.junit.Assert.assertTrue ( vmPassedMemoryRequirement ) ; }
Source:
private void addSourceStorageDomainName ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel disk , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > sourceStorageDomains ) { java.lang.String sourceStorageName = ( sourceStorageDomains.isEmpty ( ) ) ? constants.notAvailableLabel ( ) : sourceStorageDomains.get ( 0 ) . getstorage_name ( ) ; disk.getSourceStorageDomainName ( ) . setEntity ( sourceStorageName ) ; }

Target:
private void addSourceStorageDomainName ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel disk , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > sourceStorageDomains ) { java.lang.String sourceStorageName = ( sourceStorageDomains.isEmpty ( ) ) ? constants.notAvailableLabel ( ) : sourceStorageDomains.get ( 0 ) . getStorageName ( ) ; disk.getSourceStorageDomainName ( ) . setEntity ( sourceStorageName ) ; }
Source:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.EntityModel , org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel , org.ovirt.engine.ui.uicommonweb.models.storage.StorageIsoListModel > getStorageIsoListProvider ( org.ovirt.engine.ui.webadmin.gin.ClientGinjector ginjector ) { return new org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.EntityModel , org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel , org.ovirt.engine.ui.uicommonweb.models.storage.StorageIsoListModel > ( ginjector , org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel.class , org.ovirt.engine.ui.uicommonweb.models.storage.StorageIsoListModel.class ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageIsoListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getImportImagesCommand ( ) ) ) { return importExportPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.image_storage_domain_map imageStorageDomainMap , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.ImagesHandler.addImage ( image , active , imageStorageDomainMap ) ; org.ovirt.engine.core.bll.ImagesHandler.addDiskToVmIfNotExists ( image , vmId ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.DB , ex ) ; } }

Target:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.ImagesHandler.addImage ( image , active , imageStorageDomainMap ) ; org.ovirt.engine.core.bll.ImagesHandler.addDiskToVmIfNotExists ( image , vmId ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.DB , ex ) ; } }
Source:
protected void endWithFailure ( ) { if ( ( getMoveOrCopyImageOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Copy ) ) { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.UnLockImage ( ) ; if ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getAddImageDomainMapping ( ) ) { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map_id ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; } RevertTasks ( ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.MarkImageAsIllegal ( ) ; } org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.setSucceeded ( true ) ; }

Target:
protected void endWithFailure ( ) { if ( ( getMoveOrCopyImageOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Copy ) ) { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.unLockImage ( ) ; if ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getAddImageDomainMapping ( ) ) { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map_id ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; } revertTasks ( ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.markImageAsIllegal ( ) ; } org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.setSucceeded ( true ) ; }
Source:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
private java.lang.Object getStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > sds = new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; org.ovirt.engine.core.common.businessentities.storage_domains sd = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; sd.setstorage_name ( "Storage_Domain_1" ) ; sd.setId ( GUIDS [ 2 ] ) ; sds.add ( sd ) ; return sds ; }

Target:
private java.lang.Object getStorageDomains ( ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > sds = new java.util.LinkedList < org.ovirt.engine.api.model.StorageDomain > ( ) ; org.ovirt.engine.api.model.StorageDomain sd = new org.ovirt.engine.api.model.StorageDomain ( ) ; sd.setstorage_name ( "Storage_Domain_1" ) ; sd.setId ( GUIDS [ 2 ] ) ; sds.add ( sd ) ; return sds ; }
Source:
private void addVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( getVmId ( ) ) ; tempVar.setStatus ( VMStatus.ImageLocked ) ; tempVar.setVmHost ( "" ) ; tempVar.setVmIp ( "" ) ; tempVar.setAppList ( getParameters ( ) . getVm ( ) . getDynamicData ( ) . getAppList ( ) ) ; getVmDynamicDAO ( ) . save ( tempVar ) ; getCompensationContext ( ) . snapshotNewEntity ( tempVar ) ; }

Target:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . EndAction ( org.ovirt.engine.core.bll.ImportVmCommand.getImagesActionType ( ) , p ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , parentParameters , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , parentParameters.getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.action.LockProperties getLockProperties ( ) { org.ovirt.engine.core.common.action.LockProperties lockProperties = _parameters.getLockProperties ( ) ; if ( lockProperties == null ) { lockProperties = applyLockProperties ( getLockingPropertiesSettings ( ) ) ; _parameters.setLockProperties ( lockProperties ) ; } return lockProperties ; }
Source:
public org.ovirt.engine.core.bll.adbroker.LdapQueryExecution format ( org.ovirt.engine.core.bll.adbroker.LdapQueryMetadata queryMetadata ) { java.lang.String filter = getFilter ( queryMetadata ) ; java.lang.String baseDN = java.lang.String.format ( queryMetadata.getBaseDN ( ) , getEncodedParameters ( queryMetadata.getQueryData ( ) . getBaseDNParameters ( ) , queryMetadata.getLdapGuidEncoder ( ) ) ) ; return new org.ovirt.engine.core.bll.adbroker.LdapQueryExecution ( filter , getDisplayFilter ( queryMetadata ) , baseDN , queryMetadata.getContextMapper ( ) , queryMetadata.getSearchScope ( ) , queryMetadata.getReturningAttributes ( ) , queryMetadata.getQueryData ( ) . getDomain ( ) ) ; }

Target:
public org.ovirt.engine.core.bll.adbroker.LdapQueryExecution format ( org.ovirt.engine.core.bll.adbroker.LdapQueryMetadata queryMetadata ) { java.lang.String filter = getFilter ( queryMetadata ) ; java.lang.String baseDN = java.lang.String.format ( queryMetadata.getBaseDN ( ) , getEncodedParameters ( queryMetadata.getQueryData ( ) . getBaseDNParameters ( ) , queryMetadata.getLdapIdEncoder ( ) ) ) ; return new org.ovirt.engine.core.bll.adbroker.LdapQueryExecution ( filter , getDisplayFilter ( queryMetadata ) , baseDN , queryMetadata.getContextMapper ( ) , queryMetadata.getSearchScope ( ) , queryMetadata.getReturningAttributes ( ) , queryMetadata.getQueryData ( ) . getDomain ( ) ) ; }