auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void addDiskImageWithNoVmDevice ( org.ovirt.engine.core.common.businessentities.DiskImage image ) { org.ovirt.engine.core.bll.ImagesHandler.addDiskImageWithNoVmDevice ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) ) ) ; }

Target:
public static void addDiskImageWithNoVmDevice ( org.ovirt.engine.core.common.businessentities.DiskImage image ) { org.ovirt.engine.core.bll.ImagesHandler.addDiskImageWithNoVmDevice ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) , image.getDiskProfileId ( ) ) ) ; }
Source:
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.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void GetNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.Host host ) { return ( host.isSetCluster ( ) ) && ( host.getCluster ( ) . isSetId ( ) ) ? new org.ovirt.engine.core.compat.Guid ( host.getCluster ( ) . getId ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , SearchType.Cluster , ( "Cluster: name=" + ( ( host.isSetCluster ( ) ) && ( host.getCluster ( ) . isSetName ( ) ) ? host.getCluster ( ) . getName ( ) : "Default" ) ) ) . getId ( ) ; }

Target:
private org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.Host host ) { if ( host.isSetCluster ( ) ) { org.ovirt.engine.api.model.Cluster cluster = host.getCluster ( ) ; if ( cluster.isSetId ( ) ) { return new org.ovirt.engine.core.compat.Guid ( cluster.getId ( ) ) ; } if ( cluster.isSetName ( ) ) { return getClusterIdByName ( cluster.getName ( ) ) ; } } return getClusterIdByName ( org.ovirt.engine.api.restapi.resource.BackendHostsResource.DEFAULT_NAME ) ; }
Source:
public void testCanEditARunningVM ( ) { prepareVmToPassCanDoAction ( ) ; vm.setStatus ( VMStatus.Up ) ; mockDiskDaoGetAllForVm ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.storage.Disk > emptyList ( ) , true ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areUpdatedFieldsLegal ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void testChangeClusterForbidden ( ) { prepareVmToPassValidate ( ) ; org.ovirt.engine.core.common.businessentities.Cluster newGroup = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setCompatibilityVersion ( Version.v3_0 ) ; vmStatic.setClusterId ( newGroup.getId ( ) ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( command ) . getClusterDao ( ) ; org.junit.Assert.assertFalse ( "validate should have failed with can't change cluster." , command.validate ( ) ) ; assertValidateMessage ( EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }
Source:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeStatus backendStatus , org.ovirt.engine.api.model.GlusterState restStatus ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ; volume.setStatus ( backendStatus ) ; org.ovirt.engine.api.model.GlusterVolume restVolume = org.ovirt.engine.api.restapi.types.GlusterVolumeMapper.map ( volume , null ) ; assertEquals ( restVolume.getState ( ) , restStatus.value ( ) ) ; }

Target:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus backendStatus , org.ovirt.engine.api.model.GlusterState restStatus ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ; volume.setStatus ( backendStatus ) ; org.ovirt.engine.api.model.GlusterVolume restVolume = org.ovirt.engine.api.restapi.types.GlusterVolumeMapper.map ( volume , null ) ; assertEquals ( restVolume.getStatus ( ) . getState ( ) , restStatus.value ( ) ) ; }
Source:
private void internalFreeMac ( java.lang.String mac ) { if ( allocatedCustomMacs.contains ( mac ) ) { allocatedCustomMacs.remove ( mac ) ; } else if ( allocatedMacs.contains ( mac ) ) { allocatedMacs.remove ( mac ) ; availableMacs.add ( mac ) ; } }

Target:
private void internalFreeMac ( java.lang.String mac ) { if ( allocatedMacs.containsKey ( mac ) ) { removeMacFromMap ( allocatedMacs , mac ) ; if ( ! ( allocatedMacs.containsKey ( mac ) ) ) { availableMacs.add ( mac ) ; } } else if ( allocatedCustomMacs.containsKey ( mac ) ) { removeMacFromMap ( allocatedCustomMacs , mac ) ; } }
Source:
public void testRemoveRoleGroupMap ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.RoleGroupMap > before = dao.getAllForRole ( FixturesTool.ROLE_ID ) ; org.junit.Assert.assertFalse ( before.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.RoleGroupMap map : before ) { dao.remove ( map.getActionGroup ( ) , map.getRoleId ( ) ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.RoleGroupMap > after = dao.getAllForRole ( FixturesTool.ROLE_ID ) ; org.junit.Assert.assertTrue ( after.isEmpty ( ) ) ; }

Target:
public void testRemoveRoleGroupMap ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.RoleGroupMap > before = dao.getAllForRole ( FixturesTool.ROLE_ID ) ; org.junit.jupiter.api.Assertions.assertFalse ( before.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.RoleGroupMap map : before ) { dao.remove ( map.getActionGroup ( ) , map.getRoleId ( ) ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.RoleGroupMap > after = dao.getAllForRole ( FixturesTool.ROLE_ID ) ; org.junit.jupiter.api.Assertions.assertTrue ( after.isEmpty ( ) ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid getHostId ( org.ovirt.engine.api.model.Host host ) { return host.isSetId ( ) ? asGuid ( host.getId ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.VDS.class , VdcQueryType.GetVdsByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( host.getName ( ) ) , host.getName ( ) ) . getId ( ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getHostId ( org.ovirt.engine.api.model.Host host ) { return host.isSetId ( ) ? asGuid ( host.getId ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.VDS.class , QueryType.GetVdsByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( host.getName ( ) ) , host.getName ( ) ) . getId ( ) ; }
Source:
public void testVirtIsMonitoringNeeded ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.NonOperational ) ; org.junit.Assert.assertTrue ( virtStrategy.isMonitoringNeeded ( vds ) ) ; vds.setStatus ( VDSStatus.Up ) ; org.junit.Assert.assertTrue ( virtStrategy.isMonitoringNeeded ( vds ) ) ; }

Target:
public void testVirtIsMonitoringNeeded ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.NonOperational ) ; org.junit.jupiter.api.Assertions.assertTrue ( virtStrategy.isMonitoringNeeded ( vds ) ) ; vds.setStatus ( VDSStatus.Up ) ; org.junit.jupiter.api.Assertions.assertTrue ( virtStrategy.isMonitoringNeeded ( vds ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc glusterVolumeCreate ( java.lang.String volumeName , java.lang.String [ ] brickList , int replicaCount , int stripeCount , java.lang.String [ ] transportList ) { try { return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( vdsServer.glusterVolumeCreate ( volumeName , brickList , replicaCount , stripeCount , transportList ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc verifyUntrustedVolume ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.verifyUntrustedVolume ( sdID , spID , imageID , volumeID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static void getRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public static void GetDataCenterMaxNameLength ( 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.StoragePoolNameSizeLimit , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.storage_server_connections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
private void addGeneralTypeColumn ( ) { final org.ovirt.engine.ui.common.widget.table.column.VmDeviceGeneralTypeColumn < org.ovirt.engine.core.common.businessentities.VmDevice > deviceGeneralTypeColumn = new org.ovirt.engine.ui.common.widget.table.column.VmDeviceGeneralTypeColumn ( ) ; deviceGeneralTypeColumn.makeSortable ( ) ; getTable ( ) . addColumn ( deviceGeneralTypeColumn , org.ovirt.engine.ui.common.widget.uicommon.vm.VmDevicesListModelTable.constants.empty ( ) , "30px" ) ; }

Target:
private void addGeneralTypeColumn ( ) { final org.ovirt.engine.ui.common.widget.table.column.VmDeviceGeneralTypeColumn < org.ovirt.engine.core.common.businessentities.VmDevice > deviceGeneralTypeColumn = new org.ovirt.engine.ui.common.widget.table.column.VmDeviceGeneralTypeColumn ( ) ; deviceGeneralTypeColumn.setContextMenuTitle ( org.ovirt.engine.ui.common.widget.uicommon.vm.VmDevicesListModelTable.constants.deviceGeneralType ( ) ) ; deviceGeneralTypeColumn.makeSortable ( ) ; getTable ( ) . addColumn ( deviceGeneralTypeColumn , org.ovirt.engine.ui.common.widget.uicommon.vm.VmDevicesListModelTable.constants.empty ( ) , "30px" ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute Logoff: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.asyncCallback.OnSuccess ( callback.getModel ( ) , null ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute Logoff: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.asyncCallback.OnSuccess ( callback.getModel ( ) , null ) ; }
Source:
public void RequestSearch ( ) { searchRequested = true ; }

Target:
public void RequestSearch ( ) { searchRequested = true ; model.setItems ( new java.util.ArrayList ( ) ) ; model.getSelectedItemChangedEvent ( ) . raise ( this , new org.ovirt.engine.core.compat.EventArgs ( ) ) ; model.getSelectedItemsChangedEvent ( ) . raise ( this , new org.ovirt.engine.core.compat.EventArgs ( ) ) ; }
Source:
private void applyStyles ( ) { cardStatusEditor.addContentWidgetStyleName ( style.cardStatusEditorContent ( ) ) ; pluggedEditor.addContentWidgetStyleName ( style.cardStatusRadioContent ( ) ) ; unpluggedEditor.addContentWidgetStyleName ( style.cardStatusRadioContent ( ) ) ; linkStateEditor.addContentWidgetStyleName ( style.linkStateEditorContent ( ) ) ; linkedEditor.addContentWidgetStyleName ( style.linkStateRadioContent ( ) ) ; unlinkedEditor.addContentWidgetStyleName ( style.linkStateRadioContent ( ) ) ; enableManualMacCheckbox.addContentWidgetStyleName ( style.checkBox ( ) ) ; }

Target:
private void applyStyles ( ) { cardStatusEditor.addContentWidgetStyleName ( style.statusEditorContent ( ) ) ; pluggedEditor.addContentWidgetStyleName ( style.statusRadioContent ( ) ) ; unpluggedEditor.addContentWidgetStyleName ( style.statusRadioContent ( ) ) ; linkStateEditor.addContentWidgetStyleName ( style.statusEditorContent ( ) ) ; linkedEditor.addContentWidgetStyleName ( style.statusRadioContent ( ) ) ; unlinkedEditor.addContentWidgetStyleName ( style.statusRadioContent ( ) ) ; enableManualMacCheckbox.addContentWidgetStyleName ( style.checkBox ( ) ) ; }
Source:
public void testIsBalloonEnabled ( ) { boolean queryRes = dao.isMemBalloonEnabled ( org.ovirt.engine.core.dao.VmDeviceDAOTest.EXISTING_VM_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = dao.getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.dao.VmDeviceDAOTest.EXISTING_VM_ID , VmDeviceType.BALLOON.getName ( ) , VmDeviceType.MEMBALLOON.getName ( ) ) ; org.junit.Assert.assertTrue ( ( ( queryRes && ( ! ( devices.isEmpty ( ) ) ) ) || ( ( ! queryRes ) && ( devices.isEmpty ( ) ) ) ) ) ; }

Target:
public void testIsBalloonEnabled ( ) { boolean queryRes = dao.isMemBalloonEnabled ( org.ovirt.engine.core.dao.VmDeviceDAOTest.EXISTING_VM_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = dao.getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.dao.VmDeviceDAOTest.EXISTING_VM_ID , VmDeviceGeneralType.BALLOON , VmDeviceType.MEMBALLOON.getName ( ) ) ; org.junit.Assert.assertTrue ( ( ( queryRes && ( ! ( devices.isEmpty ( ) ) ) ) || ( ( ! queryRes ) && ( devices.isEmpty ( ) ) ) ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase res = result.getReturnValue ( ) ; getTestResult ( ) . setEntity ( ( ( res != null ) && ( res.getSucceeded ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel confirmationModel = getImportChainConfirmationModel ( ( ( java.lang.String ) ( result ) ) ) ; sourceListModel.setConfirmWindow ( confirmationModel ) ; } else { stopProgress ( ) ; setTestResultValue ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) ) ; } }
Source:
private void removeVmStatlessImages ( ) { org.ovirt.engine.core.bll.VmPoolHandler.processVmPoolOnStopVm ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }

Target:
private void removeVmStatlessImages ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.IdParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }
Source:
public void setUpBefore ( ) throws java.lang.Exception { super . setUpBefore ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseIface = createBaseInterface ( qosA , networkName ) ; baseIface.setMtu ( 100 ) ; setTestIface ( baseIface ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( baseIface ) ) . thenReturn ( baseIface ) ; }

Target:
public void setUpBefore ( ) throws java.lang.Exception { super . setUpBefore ( ) ; mcr.mockConfigValue ( ConfigValues.DefaultMTU , 1500 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseIface = createBaseInterface ( qosA , networkName ) ; baseIface.setMtu ( 100 ) ; setTestIface ( baseIface ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( baseIface ) ) . thenReturn ( baseIface ) ; }
Source:
public void testNotRemovingUsedPoolRecordIsUsed ( ) { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; final org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setName ( "cluster" ) ; org.mockito.Mockito.when ( clusterDao.getAllClustersByMacPoolId ( macPool.getId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( cluster ) ) ; org.junit.Assert.assertThat ( macPoolValidator.notRemovingUsedPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_REMOVE_STILL_USED_MAC_POOL ) ) ; }

Target:
public void testNotRemovingUsedPoolRecordIsUsed ( ) { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; final org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setName ( "cluster" ) ; org.mockito.Mockito.when ( clusterDao.getAllClustersByMacPoolId ( macPool.getId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( cluster ) ) ; org.hamcrest.MatcherAssert.assertThat ( macPoolValidator.notRemovingUsedPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_REMOVE_STILL_USED_MAC_POOL ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc vmUpdateDevice ( java.lang.String vmId , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct device ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.vmUpdateDevice ( vmId , device.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc diskReplicateStart ( java.lang.String vmUUID , java.util.Map srcDisk , java.util.Map dstDisk ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.diskReplicateStart ( vmUUID , srcDisk , dstDisk ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void diskImagesHasDerivedDisksOnStorageDomain ( ) { org.ovirt.engine.core.compat.Guid storageDomainId = org.ovirt.engine.core.compat.Guid.Empty ; disk1.setVmEntityType ( VmEntityType.TEMPLATE ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageDomainIds = new java.util.ArrayList < > ( ) ; storageDomainIds.add ( storageDomainId ) ; disk2.setStorageIds ( storageDomainIds ) ; org.mockito.Mockito.when ( diskImageDao.getAllSnapshotsForParent ( disk1.getImageId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( disk2 ) ) ; org.junit.Assert.assertThat ( validator.diskImagesHaveNoDerivedDisks ( storageDomainId ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DETECTED_DERIVED_DISKS ) ) ; }

Target:
public void diskImagesHasDerivedDisksOnStorageDomain ( ) { org.ovirt.engine.core.compat.Guid storageDomainId = org.ovirt.engine.core.compat.Guid.Empty ; disk1.setVmEntityType ( VmEntityType.TEMPLATE ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageDomainIds = new java.util.ArrayList < > ( ) ; storageDomainIds.add ( storageDomainId ) ; disk2.setStorageIds ( storageDomainIds ) ; org.mockito.Mockito.when ( diskImageDao.getAllSnapshotsForParent ( disk1.getImageId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( disk2 ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.diskImagesHaveNoDerivedDisks ( storageDomainId ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DETECTED_DERIVED_DISKS ) ) ; }
Source:
public javax.ws.rs.core.Response remove ( org.ovirt.engine.api.model.Action action ) { get ( ) ; boolean force = false ; if ( ( action != null ) && ( action.isSetForce ( ) ) ) { force = action.isForce ( ) ; } return performAction ( VdcActionType.RemoveVds , new org.ovirt.engine.core.common.action.RemoveVdsParameters ( guid , force ) ) ; }

Target:
public javax.ws.rs.core.Response enrollCertificate ( org.ovirt.engine.api.model.Action action ) { return doAction ( VdcActionType.HostEnrollCertificate , new org.ovirt.engine.core.common.action.VdsActionParameters ( guid ) , action ) ; }
Source:
protected void updateQuota ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { if ( isQuotaValidationNeeded ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) ; if ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( oldDisk.getQuotaId ( ) , diskImage.getQuotaId ( ) ) ) ) { org.ovirt.engine.core.bll.UpdateVmDiskCommand.getImageStorageDomainMapDao ( ) . updateQuotaForImageAndSnapshots ( diskImage.getId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getQuotaId ( ) ) ; } } }

Target:
protected void updateQuota ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { if ( isQuotaValidationNeeded ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) ; if ( ! ( java.util.Objects.equals ( oldDisk.getQuotaId ( ) , diskImage.getQuotaId ( ) ) ) ) { org.ovirt.engine.core.bll.UpdateVmDiskCommand.getImageStorageDomainMapDao ( ) . updateQuotaForImageAndSnapshots ( diskImage.getId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getQuotaId ( ) ) ; } } }
Source:
public boolean CheckIfCpusSameManufacture ( java.lang.String cpuName1 , java.lang.String cpuName2 ) { boolean result = false ; if ( ( cpuName1 != null ) && ( cpuName2 != null ) ) { if ( _intelCpuByNameDictionary.containsKey ( cpuName1 ) ) { result = _intelCpuByNameDictionary.containsKey ( cpuName2 ) ; } else if ( _amdCpuByNameDictionary.containsKey ( cpuName1 ) ) { result = _amdCpuByNameDictionary.containsKey ( cpuName2 ) ; } else if ( _ibmCpuByNameDictionary.containsKey ( cpuName1 ) ) { result = _ibmCpuByNameDictionary.containsKey ( cpuName2 ) ; } } return result ; }

Target:
public boolean checkIfCpusSameManufacture ( java.lang.String cpuName1 , java.lang.String cpuName2 ) { boolean result = false ; if ( ( cpuName1 != null ) && ( cpuName2 != null ) ) { if ( _intelCpuByNameDictionary.containsKey ( cpuName1 ) ) { result = _intelCpuByNameDictionary.containsKey ( cpuName2 ) ; } else if ( _amdCpuByNameDictionary.containsKey ( cpuName1 ) ) { result = _amdCpuByNameDictionary.containsKey ( cpuName2 ) ; } else if ( _ibmCpuByNameDictionary.containsKey ( cpuName1 ) ) { result = _ibmCpuByNameDictionary.containsKey ( cpuName2 ) ; } } return result ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isDomainHasNoImages ( org.ovirt.engine.core.common.errors.VdcBllMessages message , boolean allowOvfDisk ) { int numOfAllowedDisks = 0 ; if ( allowOvfDisk ) { numOfAllowedDisks = getDbFacade ( ) . getStorageDomainOvfInfoDao ( ) . getAllForDomain ( storageDomain.getId ( ) ) . size ( ) ; } if ( ( getDbFacade ( ) . getDiskImageDao ( ) . getAllSnapshotsForStorageDomain ( storageDomain.getId ( ) ) . size ( ) ) > numOfAllowedDisks ) { return new org.ovirt.engine.core.bll.ValidationResult ( message ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult hasSpaceForNewDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages ) { double availableSize = storageDomain.getAvailableDiskSizeInBytes ( ) ; double totalSizeForDisks = getTotalSizeForNewDisks ( diskImages ) ; return validateRequiredSpace ( availableSize , totalSizeForDisks ) ; }
Source:
private void addPermissionForTempalte ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.bll.PredefinedRoles role ) { org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; perms.setad_element_id ( userId ) ; perms.setObjectType ( VdcObjectType.VmTemplate ) ; perms.setObjectId ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getVmTemplateId ( ) ) ; perms.setrole_id ( role.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }

Target:
private void addPermissionForTemplate ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.bll.PredefinedRoles role ) { org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; perms.setad_element_id ( userId ) ; perms.setObjectType ( VdcObjectType.VmTemplate ) ; perms.setObjectId ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getVmTemplateId ( ) ) ; perms.setrole_id ( role.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.AffinityLabel label ) { validateParameters ( label , "name" ) ; org.ovirt.engine.api.restapi.resource.Label newLabel = map ( label ) ; org.ovirt.engine.core.common.action.LabelActionParameters params = new org.ovirt.engine.core.common.action.LabelActionParameters ( newLabel ) ; return performCreate ( ActionType.AddLabel , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetLabelById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.AffinityLabel label ) { validateParameters ( label , "name" ) ; org.ovirt.engine.api.restapi.resource.Label newLabel = map ( label ) ; org.ovirt.engine.core.common.action.LabelActionParameters params = new org.ovirt.engine.core.common.action.LabelActionParameters ( newLabel ) ; return performCreate ( ActionType.AddLabel , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.QueryType.GetLabelById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public void testRemoveById ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.image_storage_domain_map > entries = dao.getAllByStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; for ( org.ovirt.engine.core.common.businessentities.image_storage_domain_map entry : entries ) { org.junit.Assert.assertFalse ( entry.getstorage_domain_id ( ) . equals ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID ) ) ; } org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( entries.isEmpty ( ) ) ; }

Target:
public void testRemoveById ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMapId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.image_storage_domain_map > entries = dao.getAllByStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; for ( org.ovirt.engine.core.common.businessentities.storage.image_storage_domain_map entry : entries ) { org.junit.Assert.assertFalse ( entry.getstorage_domain_id ( ) . equals ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID ) ) ; } org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( entries.isEmpty ( ) ) ; }
Source:
protected void setActionMessageParameters ( ) { addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__SETUP ) ; addCanDoActionMessage ( VdcBllMessages.VAR__TYPE__NETWORKS ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkAttachmentDao , networkDao , vdsDao ) ; return validator.validate ( ) ; }
Source:
protected void extractBondIfModified ( java.util.Set < java.lang.String > bonds , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String name ) { if ( org.apache.commons.lang.StringUtils.isBlank ( iface.getNetworkName ( ) ) ) { violations.add ( VdcBllMessages.NETWROK_NOT_EXISTS ) ; } else { if ( bonds.contains ( name ) ) { violations.add ( VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; } else { bonds.add ( name ) ; if ( interfaceWasModified ( iface ) ) { modifiedBonds.put ( name , iface ) ; } } } }

Target:
private void extractBondIfModified ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String bondName ) { if ( ! ( bonds.containsKey ( bondName ) ) ) { bonds.put ( bondName , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ) ; } if ( bondWasModified ( iface ) ) { modifiedBonds.put ( bondName , iface ) ; } }
Source:
public static void GetHighUtilizationForEvenDistribution ( 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 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.HighUtilizationForEvenlyDistribute , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetLocalFSPath ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RhevhLocalFSPath , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageDomainDynamicDao ( ) ) ; staticDao = prepareDAO ( dbFacade.getStorageDomainStaticDao ( ) ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.storage_domain_static ( ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; newDynamicDomain.setavailable_disk_size ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.USED_DISK_SIZE ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageDomainDynamicDao ( ) ) ; staticDao = prepareDAO ( dbFacade.getStorageDomainStaticDao ( ) ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; newDynamicDomain.setavailable_disk_size ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.USED_DISK_SIZE ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.storage_pool_iso_map map ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_id" , map.getstorage_id ( ) ) . addValue ( "storage_pool_id" , map.getstorage_pool_id ( ) ) . addValue ( "status" , map.getstatus ( ) ) . addValue ( "owner" , map.getowner ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertstorage_pool_iso_map" , parameterSource ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_id" , map.getstorage_id ( ) ) . addValue ( "storage_pool_id" , map.getstorage_pool_id ( ) ) . addValue ( "status" , map.getstatus ( ) ) . addValue ( "owner" , map.getowner ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertstorage_pool_iso_map" , parameterSource ) ; }
Source:
public void cluster_SelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } }

Target:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } }
Source:
protected void setUpCommand ( ) { command = createCommand ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areTemplateImagesInStorageReady ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . verifyAddVM ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; }

Target:
protected void setUpCommand ( ) { command = createCommand ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areTemplateImagesInStorageReady ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . verifyAddVM ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateCpuProfile ( ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel lineModelFromInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel model = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel ( ) ; model.setInterfaces ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterface > ( ) ) ; model.setVLans ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan > ( ) ) ; model.setNetworkName ( nic.getNetworkName ( ) ) ; model.setIsManagement ( nic.getIsManagement ( ) ) ; model.setAddress ( nic.getAddress ( ) ) ; return model ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel lineModelFromInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel model = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel ( ) ; model.setInterfaces ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterface > ( ) ) ; model.setVLans ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan > ( ) ) ; model.setNetworkName ( nic.getNetworkName ( ) ) ; model.setIsManagement ( nic.getIsManagement ( ) ) ; model.setAddress ( nic.getIpv4Address ( ) ) ; return model ; }
Source:
public void addDiskImageWithNoVmDevice ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap ) { try { addImage ( image , active , imageStorageDomainMap ) ; addDisk ( image ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.DB , ex ) ; } }

Target:
public static void addDiskImageWithNoVmDevice ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.addDiskImageWithNoVmDevice ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) , image.getDiskProfileId ( ) ) ) ; }
Source:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public static void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public static void addOrUpdateTaskInDB ( org.ovirt.engine.core.common.businessentities.AsyncTasks task , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { try { if ( task != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . saveOrUpdate ( task , entityType , entityIds ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.log.error ( java.lang.String.format ( "Adding/Updating task %1$s to DataBase threw an exception." , task.getTaskId ( ) ) , e ) ; } }

Target:
public static void addOrUpdateTaskInDB ( org.ovirt.engine.core.common.businessentities.AsyncTasks task , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { try { if ( task != null ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.getAsyncTaskDao ( ) . saveOrUpdate ( task , entityType , entityIds ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.log.error ( java.lang.String.format ( "Adding/Updating task %1$s to DataBase threw an exception." , task.getTaskId ( ) ) , e ) ; } }
Source:
public static void GetDocumentationBaseURL ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }