auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeVdsIdCommand ( ) { org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.info ( "AddVds - entered , starting logic to add VDS '{}'" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.info ( "AddVds - VDS '{}' was added, will try to add it to the resource manager" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . addVds ( vds , false ) ; }

Target:
protected void executeVdsIdCommand ( ) { org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.info ( "AddVds - entered , starting logic to add VDS '{}'" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.info ( "AddVds - VDS '{}' was added, will try to add it to the resource manager" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; resourceManager.addVds ( vds , false ) ; }
Source:
public void testStatisticalQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity = setUpStatisticalExpectations ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Nic , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > statisticsResource = ( ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Nic , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( resource.getStatisticsResource ( ) ) ) ; assertNotNull ( statisticsResource ) ; verifyQuery ( statisticsResource.getQuery ( ) , entity ) ; }

Target:
public void testStatisticalQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity = setUpStatisticalExpectations ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Nic , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > statisticsResource = ( ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Nic , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( resource.getStatisticsResource ( ) ) ) ; org.junit.Assert.assertNotNull ( statisticsResource ) ; verifyQuery ( statisticsResource.getQuery ( ) , entity ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity getEntity ( int index ) { return setUpEntityExpectations ( control.createMock ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity.class ) , index ) ; }

Target:
public void testPopulateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectationsAllContent ( 1 , true ) ; resource.setParent ( bricksResourceMock ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException ex ) { verifyNotFoundException ( ex ) ; } }
Source:
public void testReplaceInvalidParams ( ) throws java.lang.Exception { setupParentExpectations ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { resource.replace ( new org.ovirt.engine.api.model.Action ( ) ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Action" , "replace" , "Brick.serverId, Brick.brickDir" ) ; } }

Target:
public void testReplace ( ) throws java.lang.Exception { control.replay ( ) ; try { resource.replace ( new org.ovirt.engine.api.model.Action ( ) ) ; fail ( "Expected excpetion" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; } }
Source:
private static void initMigrationSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.migrationSupport = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetMigrationSupport ) , callback ) ; }

Target:
public void initDefaultOSes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { defaultOSes = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDefaultOSes ) , callback ) ; }
Source:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
private void doTestBadAdd ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpNetworkQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AddBond , org.ovirt.engine.core.common.action.AddBondParameters.class , new java.lang.String [ ] { "VdsId" , "BondName" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME } , canDo , success ) ) ; org.ovirt.engine.api.model.HostNic model = getBondEntity ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpNetworkQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AddBond , org.ovirt.engine.core.common.action.AddBondParameters.class , new java.lang.String [ ] { "VdsId" , "BondName" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME } , valid , success ) ) ; org.ovirt.engine.api.model.HostNic model = getBondEntity ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { getDbFacade ( ) . getVmJobDao ( ) . removeAll ( vmJobIdsToRemove ) ; return null ; }

Target:
private void saveVmJobsToDb ( ) { getDbFacade ( ) . getVmJobDao ( ) . updateAllInBatch ( vmJobsToUpdate.values ( ) ) ; if ( ! ( vmJobIdsToRemove.isEmpty ( ) ) ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.Required , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { getDbFacade ( ) . getVmJobDao ( ) . removeAll ( vmJobIdsToRemove ) ; return null ; } } ) ; } }
Source:
public void canDoActionVmDuringSnapshot ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , null , diskImageId ) ; org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( Snapshot.SnapshotStatus.LOCKED ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT ) ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT ) ; }

Target:
public void validateVmDuringSnapshot ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , null , diskImageId ) ; org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( Snapshot.SnapshotStatus.LOCKED ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT ) ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.HibernateVmCommand.getVmId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM , getVmIsHibernatingMessage ( ) ) ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.HibernateVmCommand.getVmId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM , new org.ovirt.engine.core.bll.LockMessage ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_HIBERNATING ) . withOptional ( "VmName" , org.ovirt.engine.core.bll.HibernateVmCommand.getVmName ( ) ) ) ) ; }
Source:
public static void GetTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static void GetClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters ( clusterId ) , aQuery ) ; }
Source:
public static void getDomainListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getHostPublicKey ( 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.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private void commitLabelChanges ( org.ovirt.engine.ui.uicommonweb.models.hosts.NicLabelModel labelModel , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > potentialNetworks ) { labelModel.commit ( iface ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ifaceModel = nicMap.get ( iface.getName ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.clearNetworks ( ifaceModel , allNics ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.attachNetworks ( ifaceModel , new java.util.ArrayList ( potentialNetworks ) , allNics ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { allBonds = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; initNicModels ( ) ; hostSetupNetworksParametersData.allNics = allNics ; hostSetupNetworksParametersData.existingNetworkAttachments = existingNetworkAttachments ; stopProgress ( ) ; }
Source:
public void validateVmInPreview ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , null , diskImageId ) ; setVmInPreview ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }

Target:
public void passDiscardNotSupportedOnDestSd ( ) { org.ovirt.engine.core.compat.Guid dstSd = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.when ( diskVmElementValidator.isPassDiscardSupported ( dstSd ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ) ; org.junit.Assert.assertFalse ( command.validatePassDiscardSupportedOnDestinationStorageDomain ( new org.ovirt.engine.core.common.action.LiveMigrateDiskParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , dstSd , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ) ; }
Source:
public void perform ( ) { try { refreshExistingVmJobList ( ) ; refreshVmStats ( ) ; afterVMsRefreshTreatment ( ) ; } finally { unlockVmsManager ( ) ; } }

Target:
public void perform ( ) { try { refreshExistingVmJobList ( ) ; refreshVmStats ( ) ; afterVMsRefreshTreatment ( ) ; vdsManager.vmsMonitoringInitFinished ( ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.vdsbroker.VmsMonitoring.log.error ( "Failed during vms monitoring on host error is: {}" , vdsManager.getVdsName ( ) , ex ) ; org.ovirt.engine.core.vdsbroker.VmsMonitoring.log.debug ( "Exception:" , ex ) ; } finally { unlockVmsManager ( ) ; } }
Source:
public void updateCommandStatus ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.common.asynctasks.AsyncTaskType taskType , org.ovirt.engine.core.compat.CommandStatus status ) { final org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = get ( commandId ) ; if ( cmdEntity != null ) { cmdEntity.setCommandStatus ( status ) ; if ( ( taskType.equals ( AsyncTaskType.notSupported ) ) || ( cmdEntity.isCallBackEnabled ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; } } }

Target:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; return null ; }
Source:
public org.ovirt.engine.core.common.businessentities.VM getVm ( ) { if ( getParameters ( ) . isImportAsNewEntity ( ) ) { return getParameters ( ) . getVm ( ) ; } return super . getVm ( ) ; }

Target:
private java.lang.String getVmIsBeingImportedMessage ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_BEING_IMPORTED.name ( ) ) ; if ( ( getVmName ( ) ) != null ) { builder.append ( java.lang.String.format ( "$VmName %1$s" , getVmName ( ) ) ) ; } return builder.toString ( ) ; }
Source:
private boolean canRemoveTemplateDisk ( ) { if ( ( org.ovirt.engine.core.bll.RemoveDiskCommand.getVmTemplate ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.Locked ) ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImage ( ) ; if ( ( diskImage.getStorageIds ( ) . size ( ) ) == 1 ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_LAST_DOMAIN ) ; } if ( ( ! ( checkDerivedVmFromTemplateExists ( diskImage ) ) ) || ( ! ( checkDerivedDisksFromDiskNotExist ( diskImage ) ) ) ) { return false ; } return true ; }

Target:
private boolean canRemoveTemplateDisk ( ) { if ( ( org.ovirt.engine.core.bll.RemoveDiskCommand.getVmTemplate ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.Locked ) ) { return failCanDoAction ( EngineMessage.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImage ( ) ; if ( ( diskImage.getStorageIds ( ) . size ( ) ) == 1 ) { return failCanDoAction ( EngineMessage.VM_TEMPLATE_IMAGE_LAST_DOMAIN ) ; } if ( ( ! ( checkDerivedVmFromTemplateExists ( diskImage ) ) ) || ( ! ( checkDerivedDisksFromDiskNotExist ( diskImage ) ) ) ) { return false ; } return true ; }
Source:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , bond.getName ( ) ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }

Target:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.CreateOrUpdateBond createOrUpdateBond = createNewCreateOrUpdateBondWithNameAndId ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , createOrUpdateBond.getName ( ) ) ) ; doTestValidModifiedBonds ( createOrUpdateBond , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalActionWithTasksContext ( ActionType.UpdateVmVersion , buildUpdateVmVersionParameters ( ) ) ; if ( ( ! ( result.getSucceeded ( ) ) ) && ( ! ( result.isValid ( ) ) ) ) { log.warn ( "Couldn't update VM '{}' ({}) version from it's template, continue with restoring stateless snapshot." , org.ovirt.engine.core.bll.RestoreStatelessVmCommand.getVm ( ) . getName ( ) , org.ovirt.engine.core.bll.RestoreStatelessVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.RestoreStatelessVmCommand.setSucceeded ( restoreInitialState ( ) ) ; } else { setSucceeded ( result.getSucceeded ( ) ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.ActionReturnValue result = runInternalActionWithTasksContext ( ActionType.UpdateVmVersion , buildUpdateVmVersionParameters ( ) ) ; if ( ( ! ( result.getSucceeded ( ) ) ) && ( ! ( result.isValid ( ) ) ) ) { log.warn ( "Couldn't update VM '{}' ({}) version from it's template, continue with restoring stateless snapshot." , org.ovirt.engine.core.bll.RestoreStatelessVmCommand.getVm ( ) . getName ( ) , org.ovirt.engine.core.bll.RestoreStatelessVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.RestoreStatelessVmCommand.setSucceeded ( restoreInitialState ( ) ) ; } else { setSucceeded ( result.getSucceeded ( ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.VMStatsRefresher create ( final org.ovirt.engine.core.vdsbroker.VdsManager manager , final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector auditLogDirector , final org.ovirt.engine.core.utils.timer.SchedulerUtil scheduler ) { org.ovirt.engine.core.compat.Version version = manager.getCompatibilityVersion ( ) ; if ( ( ( org.ovirt.engine.core.common.FeatureSupported.jsonProtocol ( version ) ) && ( ( org.ovirt.engine.core.common.businessentities.VdsProtocol.STOMP ) == ( manager.getCopyVds ( ) . getProtocol ( ) ) ) ) && ( org.ovirt.engine.core.common.FeatureSupported.vmStatsEvents ( version ) ) ) { return new org.ovirt.engine.core.vdsbroker.jsonrpc.EventVMStatsRefresher ( manager , auditLogDirector , scheduler ) ; } return new org.ovirt.engine.core.vdsbroker.PollListAndAllVmStatsRefresher ( manager , auditLogDirector , scheduler ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.VMStatsRefresher create ( org.ovirt.engine.core.vdsbroker.VdsManager vdsManager ) { return org.ovirt.engine.core.di.Injector.injectMembers ( getRefresherForVds ( vdsManager ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( target ) ) ; boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( returnValue ) ) ; diskModel.getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . shareableDiskNotSupported ( ) ) ; diskModel.getIsShareable ( ) . setIsChangable ( isShareableDiskEnabled ) ; }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String suggestedDiskAlias = ( ( java.lang.String ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( model ) ) ; diskModel.getAlias ( ) . setEntity ( suggestedDiskAlias ) ; }
Source:
public void canDoActionFailsOnCompat ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.StartRebalanceGlusterVolumeCommandTest.UNSUPPORTED_VERSION ) . when ( vdsGroup ) . getCompatibilityVersion ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.GLUSTER_TASKS_NOT_SUPPORTED_FOR_CLUSTER_LEVEL.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnCompat ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.StartRebalanceGlusterVolumeCommandTest.UNSUPPORTED_VERSION ) . when ( vdsGroup ) . getCompatibilityVersion ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.GLUSTER_TASKS_NOT_SUPPORTED_FOR_CLUSTER_LEVEL.toString ( ) ) ) ; }
Source:
private void removeVmStatelessImages ( ) { if ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getSnapshotDAO ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.info ( "Deleting snapshot for stateless vm '{}'" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }

Target:
private void removeVmStatelessImages ( ) { if ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getSnapshotDao ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.info ( "Deleting snapshot for stateless vm '{}'" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }
Source:
public void updateAllDiskImageDynamicWithDiskIdByVmId ( java.util.Collection < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > > diskImageDynamicForVm ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > > sortedDisks = new java.util.ArrayList < > ( ) ; sortedDisks.addAll ( diskImageDynamicForVm ) ; java.util.Collections.sort ( sortedDisks , new org.ovirt.engine.core.common.utils.PairFirstComparator ( new org.ovirt.engine.core.common.utils.NaturalOrderComparator ( ) ) ) ; getCallsHandler ( ) . executeStoredProcAsBatch ( "Updatedisk_image_dynamic_by_disk_id_and_vm_id" , sortedDisks , getBatchImageGroupMapper ( ) ) ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > > sortDiskImageDynamicForUpdate ( java.util.Collection < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > > diskImageDynamicForVm ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > > sortedDisks = new java.util.ArrayList < > ( ) ; sortedDisks.addAll ( diskImageDynamicForVm ) ; sortedDisks.sort ( java.util.Comparator.comparing ( ( x ) -> x.getSecond ( ) . getId ( ) ) ) ; return sortedDisks ; }
Source:
protected void executeVdsBrokerCommand ( ) { java.util.Map < java.lang.String , java.lang.Object > map = new java.util.HashMap < > ( ) ; map.put ( "code" , EngineError.Done.getValue ( ) ) ; map.put ( "message" , "done" ) ; status = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( java.util.Collections.< java.lang.String , java.lang.Object > singletonMap ( "status" , map ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CopyVolumeDataVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { log.info ( "-- executeVdsBrokerCommand: calling 'copyVolumeData'" ) ; status = org.ovirt.engine.core.vdsbroker.vdsbroker.CopyVolumeDataVDSCommand.getBroker ( ) . copyData ( org.ovirt.engine.core.vdsbroker.vdsbroker.CopyVolumeDataVDSCommand.getParameters ( ) . getJobId ( ) . toString ( ) , buildLocationInfo ( org.ovirt.engine.core.vdsbroker.vdsbroker.CopyVolumeDataVDSCommand.getParameters ( ) . getSrcInfo ( ) ) , buildLocationInfo ( org.ovirt.engine.core.vdsbroker.vdsbroker.CopyVolumeDataVDSCommand.getParameters ( ) . getDstInfo ( ) ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CopyVolumeDataVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public void qosBondSpeedReported ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosBondSpeedSetup ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED , null ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createBond ( java.lang.String name , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , name , true , null , null , null , networkName , true , null , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; mockCalculateBaseNicWhenBaseNicIsPassed ( bond ) ; return bond ; }
Source:
public void validateSufficientSpaceOnDestinationDomains ( ) { setupForStorageTests ( ) ; org.junit.Assert.assertTrue ( command.checkDestDomains ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.DiskImage.class ) ) ; }

Target:
public void validateSufficientSpaceOnDestinationDomains ( ) { setupForStorageTests ( ) ; org.junit.Assert.assertTrue ( command.checkDestDomains ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }
Source:
public boolean check ( final org.ovirt.engine.core.common.businessentities.VDS host ) { final int checks = ( org.ovirt.engine.core.bll.host.HostConnectivityChecker.VDSM_RESPONSIVENESS_PERIOD_IN_SECONDS ) / ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.SetupNetworksPollingTimeout ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller poller = new org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller ( ) ; for ( int i = 0 ; i < checks ; i ++ ) { if ( poller.poll ( host.getId ( ) ) ) { org.ovirt.engine.core.bll.host.HostConnectivityChecker.log.info ( "Engine managed to communicate with VDSM agent on host '{}' with address '{}' ('{}')" , host.getName ( ) , host.getHostName ( ) , host.getId ( ) ) ; return true ; } } return false ; }

Target:
public boolean check ( final org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller poller = new org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller ( ) ; final long startTime = java.lang.System.nanoTime ( ) ; while ( ( ( java.lang.System.nanoTime ( ) ) - startTime ) < ( org.ovirt.engine.core.bll.host.HostConnectivityChecker.VDSM_RESPONSIVENESS_PERIOD_IN_NANOS ) ) { if ( poller.poll ( host.getId ( ) ) ) { org.ovirt.engine.core.bll.host.HostConnectivityChecker.log.info ( "Engine managed to communicate with VDSM agent on host '{}' with address '{}' ('{}')" , host.getName ( ) , host.getHostName ( ) , host.getId ( ) ) ; return true ; } } return false ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.Linq.Sort ( storageDomains , new org.ovirt.engine.ui.uicommonweb.Linq.StorageDomainByNameComparer ( ) ) ; setStorageDomains ( storageDomains ) ; setItems ( model.value ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.Linq.sort ( storageDomains , new org.ovirt.engine.ui.uicommonweb.Linq.StorageDomainByNameComparer ( ) ) ; setStorageDomains ( storageDomains ) ; setItems ( model.value ) ; }
Source:
public void appendTo ( java.lang.StringBuffer buffer ) { buffer.append ( "eqSearchParams(" ) ; buffer.append ( expected.getSearchPattern ( ) ) ; buffer.append ( " on type " ) ; buffer.append ( ( ( expected.getSearchTypeValue ( ) ) != null ? expected.getSearchTypeValue ( ) . toString ( ) : "none" ) ) ; }

Target:
public void describeTo ( org.hamcrest.Description description ) { description.appendText ( "eqSearchParams(" ) ; description.appendText ( expected.getSearchPattern ( ) ) ; description.appendText ( " on type " ) ; description.appendText ( ( ( expected.getSearchTypeValue ( ) ) != null ? expected.getSearchTypeValue ( ) . toString ( ) : "none" ) ) ; }
Source:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.addDiskImage ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) , image.getDiskProfileId ( ) ) , vmId ) ; }

Target:
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 ) ; } }
Source:
protected org.ovirt.engine.core.bll.CpuFlagsManagerHandler getCpuFlagsManagerHandler ( ) { return cpuFlagsManagerHandler ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > searchVDSsByDb ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > data = genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVdsDao ( ) , true ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : data ) { vds.setCpuName ( cpuFlagsManagerHandler.findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getClusterCompatibilityVersion ( ) ) ) ; } return data ; }
Source:
public static void IsVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmWithSameNameExistParameters ( name ) , aQuery ) ; }

Target:
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.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
private void updateCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = coco.getCommandEntity ( command.getCommandId ( ) ) ; cmdEntity.setReturnValue ( result ) ; if ( ! ( result.getCanDoAction ( ) ) ) { cmdEntity.setCommandStatus ( CommandStatus.FAILED ) ; } coco.persistCommand ( cmdEntity ) ; }

Target:
private void updateCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = coco.getCommandEntity ( command.getCommandId ( ) ) ; cmdEntity.setReturnValue ( result ) ; if ( ! ( result.isValid ( ) ) ) { cmdEntity.setCommandStatus ( CommandStatus.FAILED ) ; } coco.persistCommand ( cmdEntity ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain updateStorageDomainInMemoryVolumes ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( getParameters ( ) . getStoragePoolId ( ) , memoryDisksList , getVmDisksDummies ( ) , getVm ( ) ) ; disksList.addAll ( memoryDisksList ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain updateStorageDomainInMemoryVolumes ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.METADATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( getParameters ( ) . getStoragePoolId ( ) , memoryDisksList , getVmDisksDummies ( ) , getVm ( ) ) ; disksList.addAll ( memoryDisksList ) ; return storageDomain ; }
Source:
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 ( ) ) ; } updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; }

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 ( ) ) ; } updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; updateTemplate ( ) ; }
Source:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > > aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
protected boolean detachStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain dom ) { org.ovirt.engine.core.compat.Guid domId = dom.getId ( ) ; org.ovirt.engine.core.compat.Guid poolId = dom.getStoragePoolId ( ) ; org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters params = new org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters ( domId , poolId ) ; params.setDestroyingPool ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getParameters ( ) . getDestroyingPool ( ) ) ; return org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getBackend ( ) . runInternalAction ( VdcActionType.DetachStorageDomainFromPool , params ) . getSucceeded ( ) ; }

Target:
protected boolean detachStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain dom ) { org.ovirt.engine.core.compat.Guid domId = dom.getId ( ) ; org.ovirt.engine.core.compat.Guid poolId = dom.getStoragePoolId ( ) ; org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters params = new org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters ( domId , poolId ) ; params.setDestroyingPool ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getParameters ( ) . getDestroyingPool ( ) ) ; return org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getBackend ( ) . runInternalAction ( VdcActionType.DetachStorageDomainFromPool , params , org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.cloneContext ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) ) . getSucceeded ( ) ; }
Source:
public org.ovirt.engine.api.v3.types.V3Host get ( ) { return adaptGet ( delegate :: get ) ; }

Target:
public org.ovirt.engine.api.v3.types.V3Host get ( @ javax.ws.rs.core.Context javax.ws.rs.core.UriInfo ui ) { boolean force = org.ovirt.engine.api.common.util.QueryHelper.getBooleanMatrixParameter ( ui , "force" , true , false ) ; if ( force ) { try { delegate.refresh ( new org.ovirt.engine.api.model.Action ( ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } } return adaptGet ( delegate :: get ) ; }
Source:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > returnValue ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > vnicProfiles = new java.util.ArrayList < > ( ) ; vnicProfiles.add ( VnicProfileView.EMPTY ) ; vnicProfiles.addAll ( returnValue ) ; java.util.Collections.sort ( vnicProfiles , new org.ovirt.engine.ui.uicommonweb.Linq.VnicProfileViewComparator ( ) ) ; populateMappingRows ( vnicProfiles ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > returnValue ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > vnicProfiles = new java.util.ArrayList < > ( ) ; vnicProfiles.add ( VnicProfileView.EMPTY ) ; vnicProfiles.addAll ( returnValue ) ; java.util.Collections.sort ( vnicProfiles , Linq.VnicProfileViewComparator ) ; populateMappingRows ( vnicProfiles ) ; stopProgress ( ) ; }