auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static com.gwtplatform.mvp.client.TabData getTabData ( org.ovirt.engine.ui.common.uicommon.model.MainModelProvider < org.ovirt.engine.core.common.businessentities.StorageDomain , org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel > modelProvider , org.ovirt.engine.ui.webadmin.widget.tab.WebadminMenuLayout menuLayout ) { org.ovirt.engine.ui.webadmin.widget.tab.MenuLayoutMenuDetails menuTabDetails = menuLayout.getDetails ( WebAdminApplicationPlaces.storageMainTabPlace ) ; return new org.ovirt.engine.ui.common.widget.tab.ModelBoundTabData ( menuTabDetails.getSecondaryTitle ( ) , menuTabDetails.getSecondaryPriority ( ) , menuTabDetails.getPrimaryTitle ( ) , menuTabDetails.getPrimaryPriority ( ) , modelProvider , menuTabDetails.getIcon ( ) ) ; }

Target:
static com.gwtplatform.mvp.client.TabData getTabData ( org.ovirt.engine.ui.webadmin.widget.tab.WebadminMenuLayout menuLayout ) { org.ovirt.engine.ui.webadmin.widget.tab.MenuLayoutMenuDetails menuTabDetails = menuLayout.getDetails ( WebAdminApplicationPlaces.storageMainTabPlace ) ; return new org.ovirt.engine.ui.common.uicommon.model.GroupedTabData ( menuTabDetails.getSecondaryTitle ( ) , menuTabDetails.getPrimaryTitle ( ) , menuTabDetails.getSecondaryPriority ( ) , menuTabDetails.getPrimaryPriority ( ) , menuTabDetails.getIcon ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM createVM ( java.lang.String vmName , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; vm.setName ( vmName ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmIface = createNewInterface ( ) ; vmIface.setVmId ( vm.getId ( ) ) ; vmIface.setNetworkName ( networkName ) ; vm.getInterfaces ( ) . add ( vmIface ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM createVM ( java.lang.String vmName , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setName ( vmName ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmIface = createNewInterface ( ) ; vmIface.setVmId ( vm.getId ( ) ) ; vmIface.setNetworkName ( networkName ) ; vm.getInterfaces ( ) . add ( vmIface ) ; return vm ; }
Source:
private boolean stopSuspendedVm ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setVm ( null ) ; final org.ovirt.engine.core.common.businessentities.VMStatus vmStatus = org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getStatus ( ) ; if ( vmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { return false ; } updateVmStatus ( VMStatus.ImageLocked ) ; if ( ! ( removeHibernationDisks ( ) ) ) { updateVmStatus ( vmStatus ) ; return false ; } return true ; }

Target:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.StopVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "StopVmCommandBase::EndVmCommand: Vm is null - not performing full endAction" ) ; } org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }
Source:
public void testGetLunsToUpdateInDbDiffLunIdSamePvId ( ) { org.ovirt.engine.core.compat.Guid pvID = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.compat.Guid lunFromVgLunId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > newLunsToSaveInDb = getLunsToUpdateInDb ( lunFromVgLunId , org.ovirt.engine.core.compat.Guid.newGuid ( ) , pvID , pvID ) . get ( command.saveNewLuns ) ; assertLunIdInList ( newLunsToSaveInDb , lunFromVgLunId ) ; }

Target:
public void testGetLunsToUpdateInDbDiffLunIdSamePvId ( ) { org.ovirt.engine.core.compat.Guid pvID = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.compat.Guid lunFromVgLunId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > newLunsToSaveInDb = getLunsToUpdateInDb ( lunFromVgLunId , org.ovirt.engine.core.compat.Guid.newGuid ( ) , pvID , pvID ) . get ( command.saveLunsHandler ) ; assertLunIdInList ( newLunsToSaveInDb , lunFromVgLunId ) ; }
Source:
public void testVmsRuleNeg ( ) { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; model.setEnforcing ( false ) ; model.setPositive ( true ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.Assert.assertEquals ( EntityAffinityRule.POSITIVE , entity.getVmAffinityRule ( ) ) ; org.junit.Assert.assertFalse ( entity.isVmEnforcing ( ) ) ; org.junit.Assert.assertTrue ( entity.isVmAffinityEnabled ( ) ) ; }

Target:
public void testVmsRuleNeg ( ) { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; model.setEnforcing ( false ) ; model.setPositive ( true ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.jupiter.api.Assertions.assertEquals ( EntityAffinityRule.POSITIVE , entity.getVmAffinityRule ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( entity.isVmEnforcing ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( entity.isVmAffinityEnabled ( ) ) ; }
Source:
public void testQueryWithNonExistingHostId ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVdsId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.ovirt.engine.core.bll.GetoVirtISOsTest.checkReturnValue ( getQuery ( ) ) ; }

Target:
public void testQueryWithNonExistingHostId ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVdsId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.ovirt.engine.core.bll.GetoVirtISOsTest.checkReturnValue ( getQuery ( ) ) ; }
Source:
protected void doEdit ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel model ) { driver.edit ( model ) ; monitorCount.setText ( java.lang.Integer.toString ( getModel ( ) . getMonitorCount ( ) ) ) ; oS.setText ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getOsName ( getModel ( ) . getOS ( ) ) ) ; defaultHost.setTitle ( getModel ( ) . getDefaultHost ( ) ) ; }

Target:
protected void doEdit ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel model ) { driver.edit ( model ) ; monitorCount.setValue ( java.lang.Integer.toString ( getModel ( ) . getMonitorCount ( ) ) ) ; oS.setValue ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getOsName ( getModel ( ) . getOS ( ) ) ) ; defaultHost.setTitle ( getModel ( ) . getDefaultHost ( ) ) ; }
Source:
protected boolean isBalloonEnabled ( ) { java.lang.Boolean balloonEnabled = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isBalloonEnabled ( ) ; return balloonEnabled != null ? balloonEnabled : osRepository.isBalloonEnabled ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getOsId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ; }

Target:
protected boolean checkNumberOfMonitors ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypes = org.ovirt.engine.core.bll.VmHandler.getResultingVmGraphics ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.getGraphicsTypesOfEntity ( org.ovirt.engine.core.bll.AddVmCommand.getVmTemplateId ( ) ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getGraphicsDevices ( ) ) ; int numOfMonitors = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfMonitors ( ) ; return org.ovirt.engine.core.bll.VmHandler.isNumOfMonitorsLegal ( graphicsTypes , numOfMonitors , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
private void writeCleanup ( ) { com.google.gwt.core.ext.typeinfo.JClassType editorType = model.getEditorType ( ) ; logger.log ( Type.DEBUG , ( "Starting to write cleanup impl. for editor " + ( editorType.getQualifiedSourceName ( ) ) ) ) ; sw.println ( ) ; sw.println ( "@Override" ) ; sw.println ( "public void cleanup() {" ) ; sw.indent ( ) ; sw.println ( "if (getObject() != null) {" ) ; sw.indent ( ) ; if ( model.getProxyType ( ) . isAssignableTo ( hasCleanupType ) ) { sw.println ( "getObject().cleanup();" ) ; } for ( com.google.gwt.editor.rebind.model.EditorData editorData : model.getEditorData ( ) ) { if ( editorData.getPropertyOwnerType ( ) . isAssignableTo ( hasCleanupType ) ) { sw.println ( java.lang.String.format ( "getObject()%s.cleanup();" , editorData.getBeanOwnerExpression ( ) ) ) ; } } sw.outdent ( ) ; sw.println ( "}" ) ; for ( com.google.gwt.core.ext.typeinfo.JField field : editorType.getFields ( ) ) { com.google.gwt.core.ext.typeinfo.JClassType fieldClassType = field.getType ( ) . isClassOrInterface ( ) ; if ( ( ( fieldClassType != null ) && ( fieldClassType.isAssignableTo ( hasCleanupType ) ) ) && ( ! ( field.getType ( ) . isClassOrInterface ( ) . isAssignableTo ( baseModelType ) ) ) ) { sw.println ( java.lang.String.format ( "getEditor().%s.cleanup();" , field.getName ( ) ) ) ; } } sw.outdent ( ) ; sw.println ( "}" ) ; }

Target:
private void writeCleanup ( ) { logger.log ( Type.DEBUG , ( "Starting to write cleanup impl. for editor " + ( model.getEditorType ( ) . getQualifiedSourceName ( ) ) ) ) ; sw.println ( ) ; sw.println ( "@Override" ) ; sw.println ( "public void cleanup() {" ) ; sw.indent ( ) ; java.util.Set < java.lang.String > modelExpressions = getModelCleanupExpressions ( ) ; if ( ! ( modelExpressions.isEmpty ( ) ) ) { sw.println ( "if (getObject() != null) {" ) ; sw.indent ( ) ; for ( java.lang.String expr : modelExpressions ) { sw.println ( java.lang.String.format ( "%s.cleanup();" , expr ) ) ; } sw.outdent ( ) ; sw.println ( "}" ) ; } java.util.Set < java.lang.String > editorFieldExpressions = getEditorFieldCleanupExpressions ( ) ; for ( java.lang.String expr : editorFieldExpressions ) { sw.println ( java.lang.String.format ( "if (%s != null) {" , expr ) ) ; sw.indent ( ) ; sw.println ( java.lang.String.format ( "%s.cleanup();" , expr ) ) ; sw.outdent ( ) ; sw.println ( "}" ) ; } sw.outdent ( ) ; sw.println ( "}" ) ; }
Source:
public void testDedicatedHostNotInSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setvds_group_id ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setdedicated_vm_for_vds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.VM_CANNOT_UPDATE_DEFAULT_VDS_NOT_VALID ) ; }

Target:
public void testDedicatedHostNotInSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setvds_group_id ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setdedicated_vm_for_vds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }
Source:
public static org.ovirt.engine.core.bll.scheduling.SchedulingManager getInstance ( ) { if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ) == null ) { synchronized ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.class ) { if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ) == null ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance = new org.ovirt.engine.core.bll.scheduling.SchedulingManager ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.enableLoadBalancer ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.enableHaReservationCheck ( ) ; } } } return org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ; }

Target:
public void init ( ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initializing Scheduling manager" ) ; loadPolicyUnits ( ) ; loadClusterPolicies ( ) ; loadExternalScheduler ( ) ; enableLoadBalancer ( ) ; enableHaReservationCheck ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initialized Scheduling manager" ) ; }
Source:
protected org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy getMacPool ( ) { return org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerCluster.class ) . poolForCluster ( params.getClusterId ( ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult verifyDisks ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imageList , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.Guid > imageToDestinationDomainMap ) { if ( ( ! ( params.isImportAsNewEntity ( ) ) ) && ( ! ( params.isImagesExistOnTargetStorageDomain ( ) ) ) ) { return new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( imageList ) . diskImagesOnStorage ( imageToDestinationDomainMap ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private void setVisibilityToHotChanges ( org.ovirt.engine.ui.uicommonweb.models.vms.VmNextRunConfigurationModel object ) { hotplugPanel.setVisible ( ( ( object.isCpuPluggable ( ) ) || ( object.isMemoryPluggable ( ) ) ) ) ; applyNowCpuMessage.setVisible ( object.isCpuPluggable ( ) ) ; applyNowMemoryMessage.setVisible ( object.isMemoryPluggable ( ) ) ; }

Target:
private void setVisibilityToHotChanges ( org.ovirt.engine.ui.uicommonweb.models.vms.VmNextRunConfigurationModel object ) { hotplugPanel.setVisible ( ( ( ( object.isCpuPluggable ( ) ) || ( object.isMemoryPluggable ( ) ) ) || ( object.isVmLeaseUpdated ( ) ) ) ) ; applyNowCpuMessage.setVisible ( object.isCpuPluggable ( ) ) ; applyNowMemoryMessage.setVisible ( object.isMemoryPluggable ( ) ) ; applyNowVmLeaseMessage.setVisible ( object.isVmLeaseUpdated ( ) ) ; }
Source:
public void testIsFiltered ( ) { org.junit.Assert.assertFalse ( "By default, query should not be run as user" , base.isFiltered ( ) ) ; base.setFiltered ( true ) ; org.junit.Assert.assertTrue ( "Query should have been set to be run as user" , base.isFiltered ( ) ) ; base.setFiltered ( false ) ; org.junit.Assert.assertFalse ( "Query should have been set to be NOT run as user" , base.isFiltered ( ) ) ; }

Target:
public void testIsFiltered ( ) { org.junit.jupiter.api.Assertions.assertFalse ( base.isFiltered ( ) , "By default, query should not be run as user" ) ; base.setFiltered ( true ) ; org.junit.jupiter.api.Assertions.assertTrue ( base.isFiltered ( ) , "Query should have been set to be run as user" ) ; base.setFiltered ( false ) ; org.junit.jupiter.api.Assertions.assertFalse ( base.isFiltered ( ) , "Query should have been set to be NOT run as user" ) ; }
Source:
public void testUpdateWhenAbortedTasks ( ) { org.mockito.Mockito.doReturn ( getTasks ( JobExecutionStatus.ABORTED ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( jobRepository , org.mockito.Mockito.times ( 0 ) ) . updateStep ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; org.mockito.Mockito.verify ( tasksSyncJob , org.mockito.Mockito.times ( 2 ) ) . endStepJob ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }

Target:
public void testUpdateWhenAbortedTasks ( ) { org.mockito.Mockito.doReturn ( getTasks ( JobExecutionStatus.ABORTED ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( jobRepository , org.mockito.Mockito.times ( 0 ) ) . updateStep ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 2 ) ) . endStepJob ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }
Source:
private boolean validateRangePart ( java.lang.String rangePart ) { return org.ovirt.engine.core.config.entity.helper.MacAddressPoolRangesValueHelper.MAC_ADDRESS_PATTERN.matcher ( rangePart ) . matches ( ) ; }

Target:
private org.ovirt.engine.core.config.entity.helper.ValidationResult validateRangePart ( java.lang.String rangePart ) { boolean matches = org.ovirt.engine.core.config.entity.helper.MacAddressPoolRangesValueHelper.MAC_ADDRESS_PATTERN.matcher ( rangePart ) . matches ( ) ; if ( ! matches ) { return new org.ovirt.engine.core.config.entity.helper.ValidationResult ( false , ( ( "The range start/end is an invalid MAC address. " + rangePart ) + " should be in a format of AA:AA:AA:AA:AA:AA" ) ) ; } else { return new org.ovirt.engine.core.config.entity.helper.ValidationResult ( true ) ; } }
Source:
public org.ovirt.engine.api.resource.QuotaClusterLimitResource getLimitResource ( java.lang.String id ) { return inject ( new org.ovirt.engine.api.restapi.resource.BackendQuotaClusterLimitResource ( id , quotaId ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.QuotaClusterLimit incoming ) { org.ovirt.engine.core.common.businessentities.Quota entity = getQuota ( ) ; org.ovirt.engine.core.common.action.QuotaCRUDParameters parameters = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( map ( incoming , entity ) ) ; performAction ( VdcActionType.UpdateQuota , parameters ) ; entity = getQuota ( ) ; updateIncomingId ( incoming , entity ) ; org.ovirt.engine.api.model.QuotaClusterLimit model = map ( entity , incoming ) ; model = addLinks ( doPopulate ( model , entity ) ) ; return javax.ws.rs.core.Response.ok ( model ) . build ( ) ; }
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 onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.lang.Throwable caught ) { try { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleQueries: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; failureEventHandler ( caught ) ; callback.executed ( f ) ; } finally { raiseQueryCompleteEvent ( queryTypeList , context ) ; } }

Target:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.lang.Throwable caught ) { try { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleQueries: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; failureEventHandler ( caught ) ; callback.executed ( f ) ; } finally { raiseQueryCompleteEvent ( queryTypeList , state ) ; } }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosCommitmentNicSetup ( int totalCommitment , java.lang.Integer nicSpeed ) { return qosCommitmentSetup ( false , totalCommitment , null , nicSpeed , null ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
private void handleCopyResult ( org.ovirt.engine.core.common.businessentities.storage.DiskImage srcDiskImage , org.ovirt.engine.core.common.businessentities.storage.DiskImage copiedDiskImage , org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { if ( ! ( result.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.VolumeCreationError ) ; } else { org.ovirt.engine.core.bll.ImagesHandler.addDiskImageWithNoVmDevice ( copiedDiskImage ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getTaskIdList ( ) . addAll ( result.getInternalVdsmTaskIdList ( ) ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getSrcDiskIdToTargetDiskIdMapping ( ) . put ( srcDiskImage.getId ( ) , copiedDiskImage.getId ( ) ) ; } }

Target:
private void handleCopyResult ( org.ovirt.engine.core.common.businessentities.storage.DiskImage srcDiskImage , org.ovirt.engine.core.common.businessentities.storage.DiskImage copiedDiskImage , org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { if ( ! ( result.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.VolumeCreationError ) ; } else { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.addDiskImageWithNoVmDevice ( copiedDiskImage ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getTaskIdList ( ) . addAll ( result.getInternalVdsmTaskIdList ( ) ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getSrcDiskIdToTargetDiskIdMapping ( ) . put ( srcDiskImage.getId ( ) , copiedDiskImage.getId ( ) ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.VdcOption mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.VdcOption entity = new org.ovirt.engine.core.common.businessentities.VdcOption ( ) ; entity.setoption_name ( rs.getString ( "option_name" ) ) ; entity.setoption_value ( rs.getString ( "option_value" ) ) ; entity.setoption_id ( rs.getInt ( "option_id" ) ) ; entity.setversion ( rs.getString ( "version" ) ) ; return entity ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VdcOption > getAll ( ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) ; return getCallsHandler ( ) . executeReadList ( "GetAllFromVdcOption" , org.ovirt.engine.core.dao.VdcOptionDAODbFacadeImpl.VdcOptionRowMapper.instance , parameterSource ) ; }
Source:
public void init ( java.lang.String title , java.lang.String width , java.lang.String height , boolean closeIconVisible ) { dialogPanel.setTitle ( title ) ; asWidget ( ) . setWidth ( width ) ; asWidget ( ) . setHeight ( height ) ; asWidget ( ) . setCloseIconButtonVisible ( closeIconVisible ) ; }

Target:
public void init ( java.lang.String title , java.lang.String width , java.lang.String height , boolean closeIconVisible ) { dialogPanel.setHeader ( title ) ; asWidget ( ) . setWidth ( width ) ; asWidget ( ) . setHeight ( height ) ; asWidget ( ) . setCloseIconButtonVisible ( closeIconVisible ) ; dialogPanel.getContent ( ) . getParent ( ) . removeStyleName ( Styles.MODAL_BODY ) ; }
Source:
protected java.lang.String getSizeString ( java.lang.Double size , org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit inUnit ) { if ( size == null ) { return constants.notAvailableLabel ( ) ; } else { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit , java.lang.Double > sizeWithUnits = org.ovirt.engine.core.common.utils.SizeConverter.autoConvert ( size.longValue ( ) , inUnit ) ; return org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . sizeUnitString ( formatSize ( sizeWithUnits.getSecond ( ) ) , sizeWithUnits.getFirst ( ) ) ; } }

Target:
protected java.lang.String getSizeString ( java.lang.Double size , org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit inUnit ) { if ( size == null ) { return constants.notAvailableLabel ( ) ; } else { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit , java.lang.Double > sizeWithUnits = org.ovirt.engine.core.common.utils.SizeConverter.autoConvert ( size.longValue ( ) , inUnit ) ; return org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . sizeUnitString ( formatSize ( sizeWithUnits.getSecond ( ) ) , org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . translate ( sizeWithUnits.getFirst ( ) ) ) ; } }
Source:
private void networkNotUsedByTemplatesTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.dao.VmTemplateDao templateDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmTemplateDao.class ) ; org.mockito.Mockito.when ( templateDao.getAllForNetwork ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( templates ) ; org.mockito.Mockito.when ( dbFacade.getVmTemplateDao ( ) ) . thenReturn ( templateDao ) ; org.junit.Assert.assertThat ( validator.networkNotUsedByTemplates ( ) , matcher ) ; }

Target:
private void networkNotUsedByTemplatesTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.dao.VmTemplateDao templateDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmTemplateDao.class ) ; org.mockito.Mockito.when ( templateDao.getAllForNetwork ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( templates ) ; org.mockito.Mockito.when ( dbFacade.getVmTemplateDao ( ) ) . thenReturn ( templateDao ) ; org.junit.Assert.assertThat ( validator.networkNotUsedByTemplates ( ) , matcher ) ; }
Source:
private static void InterfaceHasSiblingVlanInterfaces ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; if ( ( siblingVlanInterfaces.size ( ) ) > 0 ) { return true ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllSiblingVlanInterfaces , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
private static void interfaceHasSiblingVlanInterfaces ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; if ( ( siblingVlanInterfaces.size ( ) ) > 0 ) { return true ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllSiblingVlanInterfaces , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getClusterServerMemoryOverCommit ( 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.Provider > providersListModel = getProviders ( ) ; providersListModel.setItems ( providers ) ; providersListModel.setIsChangable ( true ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { cleanHostParametersFields ( ) ; if ( ( getIsDiscorveredHosts ( ) . getEntity ( ) ) != null ) { updateHostList ( getIsDiscorveredHosts ( ) . getEntity ( ) ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( oldIface ) ; getVmNetworkInterfaceDao ( ) . update ( getInterface ( ) ) ; if ( macAddressChanged ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . freeMac ( oldIface.getMacAddress ( ) ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( oldIface ) ; getVmNetworkInterfaceDao ( ) . update ( getInterface ( ) ) ; if ( macAddressChanged ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMac ( oldIface.getMacAddress ( ) ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public org.ovirt.engine.core.common.businessentities.storage.DiskImage getAncestor ( org.ovirt.engine.core.compat.Guid id ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "image_guid" , id ) ; return getCallsHandler ( ) . executeRead ( "GetAncestralImageByImageGuid" , org.ovirt.engine.core.dao.DiskImageDaoImpl.DiskImageRowMapper.instance , parameterSource ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.DiskImage getAncestor ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "image_guid" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeRead ( "GetAncestralImageByImageGuid" , org.ovirt.engine.core.dao.DiskImageDaoImpl.DiskImageRowMapper.instance , parameterSource ) ; }
Source:
protected void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddVmTemplate , org.ovirt.engine.core.common.action.AddVmTemplateParameters.class , new java.lang.String [ ] { "Name" , "Description" } , new java.lang.Object [ ] { NAMES [ 0 ] , DESCRIPTIONS [ 0 ] } , valid , success ) ) ; try { doAdd ( getRestModel ( 0 ) ) ; org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.AddVmTemplate , org.ovirt.engine.core.common.action.AddVmTemplateParameters.class , new java.lang.String [ ] { "Name" , "Description" } , new java.lang.Object [ ] { NAMES [ 0 ] , DESCRIPTIONS [ 0 ] } , valid , success ) ) ; try { doAdd ( getRestModel ( 0 ) ) ; org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected void executeCommand ( ) { getMacPoolDao ( ) . update ( getMacPoolEntity ( ) ) ; poolPerDc.modifyPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }

Target:
protected void executeCommand ( ) { registerRollbackHandler ( new org.ovirt.engine.core.bll.UpdateMacPoolCommand.CustomTransactionCompletionListener ( ) ) ; getMacPoolDao ( ) . update ( getMacPoolEntity ( ) ) ; macPoolPerCluster.modifyPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }
Source:
public static boolean IsDataActiveStorageDomain ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain ) { boolean isData = ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ; boolean isActive = org.ovirt.engine.ui.uicommonweb.Linq.IsActiveStorageDomain ( storageDomain ) ; return isData && isActive ; }

Target:
public static boolean IsAnyStorageDomainIsMatserAndActive ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > sdl ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : sdl ) { if ( ( ( ( a.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) && ( ( a.getStatus ( ) ) != null ) ) && ( ( a.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return true ; } } return false ; }
Source:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password , org.ovirt.engine.core.common.businessentities.OriginType originType ) { 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.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , originType , vdsId , dataCenterId ) , aQuery ) ; }

Target:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > > aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void externalNetworkStpChanged ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network externalNetwork = mockExternalNetwork ( ) ; boolean stp = true ; org.mockito.Mockito.when ( externalNetwork.getStp ( ) ) . thenReturn ( stp ) ; org.mockito.Mockito.when ( network.getStp ( ) ) . thenReturn ( ( ! stp ) ) ; assertThatExternalNetworkDetailsUnchangedFails ( externalNetwork ) ; }

Target:
public void externalNetworkVmNetworkChanged ( ) { org.ovirt.engine.core.common.businessentities.network.Network externalNetwork = createExternalNetwork ( ) ; externalNetwork.setVmNetwork ( true ) ; network.setVmNetwork ( false ) ; assertThatExternalNetworkDetailsUnchangedFails ( externalNetwork ) ; }
Source:
public static org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.bll.CommandBase command , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitiesMap ) { return org.ovirt.engine.core.bll.tasks.CommandCoordinator.getInstance ( ) . createTask ( taskId , command , asyncTaskCreationInfo , parentCommand , description , entitiesMap ) ; }

Target:
public static org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.bll.CommandBase command , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitiesMap ) { return org.ovirt.engine.core.bll.tasks.TaskManagerUtil.coco.createTask ( taskId , command , asyncTaskCreationInfo , parentCommand , description , entitiesMap ) ; }
Source:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( 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.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public void testCanDoActionVmUpHostNotCapable ( ) { prepareForVmValidatorTests ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_HOST_CANNOT_LIVE_MERGE ) ) . when ( vmValidator ) . vmHostCanLiveMerge ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_VM_HOST_CANNOT_LIVE_MERGE ) ; }

Target:
public void testCanDoActionVmUpHostNotCapable ( ) { prepareForVmValidatorTests ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HOST_CANNOT_LIVE_MERGE ) ) . when ( vmValidator ) . vmHostCanLiveMerge ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_HOST_CANNOT_LIVE_MERGE ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult hostStatusValid ( ) { org.ovirt.engine.core.common.businessentities.VDSStatus hostStatus = org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVds ( ) . getStatus ( ) ; if ( ( hostStatus != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) && ( hostStatus != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , VdcBllMessages.VAR__HOST_STATUS__UP_OR_MAINTENANCE.name ( ) ) ; } return ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult hostStatusValid ( ) { org.ovirt.engine.core.common.businessentities.VDSStatus hostStatus = org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVds ( ) . getStatus ( ) ; if ( ( ( hostStatus != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) && ( hostStatus != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) && ( hostStatus != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , VdcBllMessages.VAR__HOST_STATUS__UP_MAINTENANCE_OR_NON_OPERATIONAL.name ( ) ) ; } return ValidationResult.VALID ; }
Source:
private void auditFenceAction ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent , org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { org.ovirt.engine.core.bll.FenceExecutor.log.info ( ( "Executing <{}> Power Management command, Proxy Host:{}, " + "Agent:{}, Agent Type:{}, Target Host:{}, Management IP:{}, User:{}, Options:{}, Fencing policy:{}" ) , action , getNameOrId ( proxyHost ) , agent.getId ( ) , org.ovirt.engine.core.utils.pm.VdsFenceOptions.getRealAgent ( agent.getType ( ) ) , getNameOrId ( _vds ) , agent.getIp ( ) , agent.getUser ( ) , getOptions ( agent ) , fencingPolicy ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = getAuditParams ( action , agent , proxyHost ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.FENCE_USING_AGENT_AND_PROXY_HOST ) ; }

Target:
private void auditFenceAction ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent , org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { org.ovirt.engine.core.bll.FenceExecutor.log.info ( "Executing <{}> Power Management command: Proxy Host:{}, Target Host:{}, Agent:{}, Fencing policy:{}" , action , getNameOrId ( proxyHost ) , getNameOrId ( _vds ) , agent , fencingPolicy ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = getAuditParams ( action , agent , proxyHost ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , AuditLogType.FENCE_USING_AGENT_AND_PROXY_HOST ) ; }
Source:
protected void updateActionAvailability ( ) { super . updateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ! ( getIsConnected ( ) ) ) && ( ( getEntity ( ) ) != null ) ) && ( ( getEntity ( ) . getDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) ) && ( isVmConnectReady ( ) ) ) ) ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel.ClientConsoleMode getDefaultConsoleMode ( ) { return org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel.ClientConsoleMode.valueOf ( ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.ClientModeSpiceDefault ) ) ) ) ; }