auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.common.businessentities.VDS activate ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = null ; try { vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( getVdsId ( ) ) ; refreshHost ( vds ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.infoFormat ( "Failed to activate VDS = {0} with error: {1}." , getVdsId ( ) , e.getMessage ( ) ) ; } return vds ; }

Target:
public java.lang.Void runInTransaction ( ) { if ( ! ( numaNodesToRemove.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsNumaNodeDAO ( ) . massRemoveNumaNodeByNumaNodeId ( numaNodesToRemove ) ; } if ( ! ( numaNodesToUpdate.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsNumaNodeDAO ( ) . massUpdateNumaNode ( numaNodesToUpdate ) ; } if ( ! ( numaNodesToSave.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsNumaNodeDAO ( ) . massSaveNumaNode ( numaNodesToSave , vds.getId ( ) , null ) ; } return null ; }
Source:
private void removeMemoryVolumes ( ) { java.util.Set < java.lang.String > memoryStates = org.ovirt.engine.core.bll.memory.MemoryUtils.getMemoryVolumesFromSnapshots ( org.ovirt.engine.core.bll.RemoveVmCommand.getDbFacade ( ) . getSnapshotDao ( ) . getAll ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ; for ( java.lang.String memoryState : memoryStates ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( memoryState , org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.RemoveVmCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { log.error ( "Failed to remove memory volumes while removing vm '{}' (volumes: '{}')" , org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) , memoryState ) ; } } }

Target:
private void removeMemoryVolumes ( ) { java.util.Set < java.lang.String > memoryStates = org.ovirt.engine.core.bll.memory.MemoryUtils.getMemoryVolumesFromSnapshots ( org.ovirt.engine.core.bll.RemoveVmCommand.getDbFacade ( ) . getSnapshotDao ( ) . getAll ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ; for ( java.lang.String memoryState : memoryStates ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = runInternalAction ( VdcActionType.RemoveMemoryVolumes , buildRemoveMemoryVolumesParameters ( memoryState , org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.RemoveVmCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { log.error ( "Failed to remove memory volumes while removing vm '{}' (volumes: '{}')" , org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) , memoryState ) ; } } }
Source:
public org.ovirt.engine.core.bll.SPMAsyncTask concreteCreateTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , getAsyncTask ( taskId , asyncTaskCreationInfo , parentCommand ) ) ; p.setEntityInfo ( getParameters ( ) . getEntityInfo ( ) ) ; return createTask ( internalGetTaskType ( ) , p ) ; }

Target:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { persistCommand ( parentCommand , getContext ( ) , false ) ; }
Source:
private void setUpGetEntityExpectationsAllContent ( int times , boolean notFound ) throws java.lang.Exception { java.util.List < java.lang.String > populateValue = new java.util.ArrayList < java.lang.String > ( ) ; populateValue.add ( "true" ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( AbstractBackendResource.POPULATE ) ) . andReturn ( populateValue ) . anyTimes ( ) ; setupEntityExpectationAdvancedDetails ( times , notFound , false ) ; }

Target:
private void setUpGetEntityExpectationsAllContent ( int times , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( times , notFound ) ; java.util.List < java.lang.String > populateValue = new java.util.ArrayList < java.lang.String > ( ) ; populateValue.add ( "true" ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( AbstractBackendResource.POPULATE ) ) . andReturn ( populateValue ) . anyTimes ( ) ; setupParentPopulateExpectations ( notFound ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.String > getAvailableValues ( java.lang.String message , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ) { java.util.Map < java.lang.String , java.lang.String > returnValue = new java.util.HashMap < java.lang.String , java.lang.String > ( logable.getCustomValues ( ) ) ; java.util.Set < java.lang.String > attributes = resolvePlaceHolders ( message ) ; if ( ( attributes != null ) && ( ( attributes.size ( ) ) > 0 ) ) { org.ovirt.engine.core.compat.backendcompat.TypeCompat.getPropertyValues ( logable , attributes , returnValue ) ; } return returnValue ; }

Target:
private static java.util.Map < java.lang.String , java.lang.String > getAvailableValues ( java.lang.String message , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ) { java.util.Map < java.lang.String , java.lang.String > returnValue = new java.util.HashMap < java.lang.String , java.lang.String > ( logable.getCustomValues ( ) ) ; java.util.Set < java.lang.String > attributes = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resolvePlaceHolders ( message ) ; if ( ( attributes != null ) && ( ( attributes.size ( ) ) > 0 ) ) { org.ovirt.engine.core.compat.backendcompat.TypeCompat.getPropertyValues ( logable , attributes , returnValue ) ; } return returnValue ; }
Source:
public void testGetQuotaByExistingName ( ) { org.ovirt.engine.core.common.businessentities.Quota quotaGeneralToSpecific = dao.getQuotaByQuotaName ( "Quota General" , FixturesTool.STORAGE_POOL_NFS ) ; org.junit.Assert.assertEquals ( dao.getById ( FixturesTool.QUOTA_GENERAL ) . getQuotaName ( ) , quotaGeneralToSpecific.getQuotaName ( ) ) ; org.junit.Assert.assertEquals ( dao.getById ( FixturesTool.QUOTA_GENERAL ) . getId ( ) , quotaGeneralToSpecific.getId ( ) ) ; }

Target:
public void testGetQuotaByExistingName ( ) { org.ovirt.engine.core.common.businessentities.Quota quotaGeneralToSpecific = dao.getQuotaByQuotaName ( "Quota General" , FixturesTool.STORAGE_POOL_NFS ) ; org.junit.jupiter.api.Assertions.assertEquals ( dao.getById ( FixturesTool.QUOTA_GENERAL ) . getQuotaName ( ) , quotaGeneralToSpecific.getQuotaName ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( dao.getById ( FixturesTool.QUOTA_GENERAL ) . getId ( ) , quotaGeneralToSpecific.getId ( ) ) ; }
Source:
public void testGetAllForStorageDomainFull ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > result = dao.getAllForStorageDomain ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 2 , result.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile diskProfile : result ) { org.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 , diskProfile.getStorageDomainId ( ) ) ; } }

Target:
private void checkResults ( java.util.List < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 2 , result.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile diskProfile : result ) { org.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 , diskProfile.getStorageDomainId ( ) ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > externalVms = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > ( vm ) ) ; } this . externalVmModels.setItems ( externalVms ) ; stopProgress ( ) ; }

Target:
private void updateVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { clearVms ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > externalVms = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > ( vm ) ) ; } externalVmModels.setItems ( externalVms ) ; stopProgress ( ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( ) { java.util.Collection < java.lang.String > removedNetworks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment : removedNetworkAttachments ) { removedNetworks.add ( existingNetworkRelatedToAttachment ( removedAttachment ) . getName ( ) ) ; } java.util.List < java.lang.String > vmNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( host.getId ( ) , removedNetworks ) ; if ( vmNames.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS , commaSeparated ( vmNames ) ) ; } }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( ) { java.util.Collection < java.lang.String > removedNetworks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment : removedNetworkAttachments ) { removedNetworks.add ( existingNetworkRelatedToAttachment ( removedAttachment ) . getName ( ) ) ; } java.util.List < java.lang.String > vmNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( host.getId ( ) , removedNetworks ) ; if ( vmNames.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS , commaSeparated ( vmNames ) ) ; } }
Source:
public boolean getReinitialize ( ) { return ( ( ( java.lang.Boolean ) ( getAttachFloppy ( ) . getEntity ( ) ) ) && ( ( getFloppyImage ( ) . getSelectedItem ( ) ) != null ) ) && ( getFloppyImage ( ) . getSelectedItem ( ) . equals ( "[sysprep]" ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.InitializationType getInitializationType ( ) { if ( ( ( java.lang.Boolean ) ( getAttachFloppy ( ) . getEntity ( ) ) ) && ( "[sysprep]" . equals ( getFloppyImage ( ) . getSelectedItem ( ) ) ) ) { return org.ovirt.engine.core.common.businessentities.InitializationType.Sysprep ; } else { return org.ovirt.engine.core.common.businessentities.InitializationType.None ; } }
Source:
protected void runAddAndVerify ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface , boolean addMacResult , org.mockito.verification.VerificationMode addMacVerification ) { org.mockito.Mockito.when ( macPoolManager.addMac ( iface.getMacAddress ( ) ) ) . thenReturn ( addMacResult ) ; vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , false ) ; verifyAddDelegatedCorrectly ( iface , addMacVerification ) ; }

Target:
protected void runAddAndVerify ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface , boolean addMacResult , org.mockito.verification.VerificationMode addMacVerification , org.ovirt.engine.core.compat.Version version ) { vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , false , version ) ; org.mockito.Mockito.verify ( macPoolManager , org.mockito.Mockito.times ( 1 ) ) . forceAddMac ( iface.getMacAddress ( ) ) ; verifyAddDelegatedCorrectly ( iface , addMacVerification ) ; }
Source:
public void testDetermineMessageReturnsObjectForParameterExpansion ( ) { java.lang.Object obj = new java.lang.Object ( ) ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.junit.Assert.assertSame ( obj , org.ovirt.engine.core.utils.log.LoggedUtils.determineMessage ( log , org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass.class . getAnnotation ( org.ovirt.engine.core.utils.log.Logged.class ) , obj ) ) ; }

Target:
public void testDetermineMessageReturnsObjectForParameterExpansion ( ) { java.lang.Object obj = new java.lang.Object ( ) ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.junit.jupiter.api.Assertions.assertSame ( obj , org.ovirt.engine.core.utils.log.LoggedUtils.determineMessage ( log , org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass.class . getAnnotation ( org.ovirt.engine.core.utils.log.Logged.class ) , obj ) ) ; }
Source:
private void assertGetResult ( org.ovirt.engine.core.common.businessentities.StorageDomain result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingDomain , result ) ; org.junit.Assert.assertEquals ( "Wrong committed disk size" , 8 , result.getCommittedDiskSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong actual disk size" , 4 , result.getActualImagesSize ( ) ) ; }

Target:
private void assertGetResult ( org.ovirt.engine.core.common.businessentities.StorageDomain result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingDomain , result ) ; org.junit.Assert.assertEquals ( "Wrong committed disk size" , 8 , result.getCommittedDiskSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong actual disk size" , 4 , result.getActualImagesSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong shared status" , StorageDomainSharedStatus.Active , result.getStorageDomainSharedStatus ( ) ) ; }
Source:
private void updateActionAvailability ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > disks = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > ( ) ; getRegisterCommand ( ) . setIsExecutionAllowed ( ( ( disks.size ( ) ) > 0 ) ) ; }

Target:
private void updateActionAvailability ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = ( ( getSelectedItems ( ) ) != null ) ? getSelectedItems ( ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; getRegisterCommand ( ) . setIsExecutionAllowed ( ( ( disks.size ( ) ) > 0 ) ) ; }
Source:
protected boolean isFiltered ( ) { java.util.List < java.lang.String > filterVar = getHttpHeaders ( ) . getRequestHeader ( org.ovirt.engine.api.restapi.resource.BaseBackendResource.USER_FILTER_FIELD ) ; if ( ( filterVar != null ) && ( ( filterVar.size ( ) ) > 0 ) ) return java.lang.Boolean.valueOf ( filterVar.iterator ( ) . next ( ) ) ; else return false ; }

Target:
protected boolean isFiltered ( ) { java.util.List < java.lang.String > filterVar = getHttpHeaders ( ) . getRequestHeader ( org.ovirt.engine.api.restapi.resource.BaseBackendResource.USER_FILTER_HEADER ) ; if ( ( filterVar != null ) && ( ( filterVar.size ( ) ) > 0 ) ) return java.lang.Boolean.valueOf ( filterVar.iterator ( ) . next ( ) ) ; else return false ; }
Source:
public void testAddIncompleteParameters_2 ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = getModel ( 0 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "validateDiskForCreation" , "provisionedSize|size" ) ; } }

Target:
public void testAddIncompleteParameters_2 ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = getModel ( 0 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "testAddIncompleteParameters_2" , "provisionedSize|size" ) ; } }
Source:
public void testAllDomainsHaveSpaceForNewDisksFailure ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSnappableVmDisks ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }

Target:
public void testAllDomainsHaveSpaceForNewDisksSuccess ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }
Source:
public static void getUserMessageOfTheDayViaPublic ( 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.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , getPrincipalName ( sessionId ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.AUTH_RECORD_PARAMETER_NAME , false ) ) ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.PRINCIPAL_RECORD_PARAMETER_NAME , false ) ) ) , message , msgArgs ) ; sessionInfoMap.remove ( sessionId ) ; }

Target:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , getPrincipalName ( sessionId ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.AUTH_RECORD_PARAMETER_NAME , false ) ) ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.PRINCIPAL_RECORD_PARAMETER_NAME , false ) ) ) , message , msgArgs ) ; getDbFacade ( ) . getEngineSessionDao ( ) . remove ( getEngineSessionSeqId ( sessionId ) ) ; sessionInfoMap.remove ( sessionId ) ; }
Source:
private void updateReportsAvailability ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { if ( org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . isReportsEnabled ( ) ) { java.util.List < org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < org.ovirt.engine.core.common.businessentities.StoragePool > > resourceSubActions = org.ovirt.engine.ui.webadmin.uicommon.ReportActionsHelper.getInstance ( ) . getResourceSubActions ( "DataCenter" , getModelProvider ( ) ) ; if ( ( resourceSubActions != null ) && ( ( resourceSubActions.size ( ) ) > 0 ) ) { getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminMenuBarButtonDefinition < org.ovirt.engine.core.common.businessentities.StoragePool > ( constants.showReportDC ( ) , resourceSubActions ) ) ; } } }

Target:
private void updateReportsAvailability ( ) { if ( org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . isReportsEnabled ( ) ) { java.util.List < org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < org.ovirt.engine.core.common.businessentities.StoragePool > > resourceSubActions = org.ovirt.engine.ui.webadmin.uicommon.ReportActionsHelper.getInstance ( ) . getResourceSubActions ( "DataCenter" , getModelProvider ( ) ) ; if ( ( resourceSubActions != null ) && ( ( resourceSubActions.size ( ) ) > 0 ) ) { getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminMenuBarButtonDefinition < org.ovirt.engine.core.common.businessentities.StoragePool > ( org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabDataCenterView.constants.showReportDC ( ) , resourceSubActions ) ) ; } } }
Source:
public void testNoDiskStatsDataForDisks ( ) { java.util.Map < java.lang.String , java.lang.Object > disksStats = new java.util.HashMap < > ( ) ; java.util.Map < java.lang.String , java.lang.Object > disk = new java.util.HashMap < > ( ) ; disksStats.put ( "a" , disk ) ; disksStats.put ( "b" , disk ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksStatsInXmlRpc ( disksStats ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.validateDisksStatsList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVds ( ) , xml , true ) ; }

Target:
public void testNoDiskStatsDataForDisks ( ) { java.util.Map < java.lang.String , java.lang.Object > disksStats = new java.util.HashMap < > ( ) ; java.util.Map < java.lang.String , java.lang.Object > disk = new java.util.HashMap < > ( ) ; disksStats.put ( "a" , disk ) ; disksStats.put ( "b" , disk ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksStats ( disksStats ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.validateDisksStatsList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVds ( ) , xml , true ) ; }
Source:
protected java.util.List < java.lang.String > extractVariableDeclarations ( java.lang.Iterable < java.lang.String > appendedCanDoMsgs ) { final java.util.List < java.lang.String > result = new java.util.ArrayList < java.lang.String > ( ) ; java.util.Iterator < java.lang.String > iter = appendedCanDoMsgs.iterator ( ) ; while ( iter.hasNext ( ) ) { result.addAll ( java.util.Arrays.asList ( iter.next ( ) . split ( "(?=\\$)" ) ) ) ; } return result ; }

Target:
protected java.util.List < java.lang.String > extractVariableDeclarations ( java.lang.Iterable < java.lang.String > appendedCanDoMsgs ) { final java.util.List < java.lang.String > result = new java.util.ArrayList < > ( ) ; for ( java.lang.String appendedCanDoMsg : appendedCanDoMsgs ) { result.addAll ( java.util.Arrays.asList ( appendedCanDoMsg.split ( "(?=\\$)" ) ) ) ; } return result ; }
Source:
public void saveGlusterServerHook ( org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid hostId , java.lang.String checksum , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus status ) { getCallsHandler ( ) . executeModification ( "InsertGlusterServerHook" , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , hookId ) . addValue ( "host_id" , hostId ) . addValue ( "checksum" , checksum ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( status ) ) ) ; }

Target:
public void updateGlusterHookConflictStatus ( org.ovirt.engine.core.compat.Guid hookId , java.lang.Integer conflictStatus ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterHookConflictStatus" , createIdParameterMapper ( hookId ) . addValue ( "conflict_status" , conflictStatus ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc getVGList ( ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getVGList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc refreshVolume ( java.lang.String sdUUID , java.lang.String spUUID , java.lang.String imgUUID , java.lang.String volUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmpRpcReturnValue = vdsServer.refreshVolume ( sdUUID , spUUID , imgUUID , volUUID ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmpRpcReturnValue ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public org.ovirt.engine.ui.uicommonweb.models.GridTimer getTimer ( ) { if ( ( gettimer ( ) ) == null ) { settimer ( new org.ovirt.engine.ui.uicommonweb.models.GridTimer ( getListName ( ) ) { @ java.lang.Override public void execute ( ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.logger.fine ( ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.this . getClass ( ) . getName ( ) ) + ": Executing search" ) ) ; syncSearch ( ) ; } } ) ; gettimer ( ) . setRefreshRate ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.getConfigurator ( ) . getPollingTimerInterval ( ) ) ; } return gettimer ( ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.GridTimer getTimer ( ) { if ( ( ( timer ) == null ) && ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.getEventBus ( ) ) != null ) ) { setTimer ( new org.ovirt.engine.ui.uicommonweb.models.GridTimer ( getListName ( ) , org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.getEventBus ( ) ) { @ java.lang.Override public void execute ( ) { doGridTimerExecute ( ) ; } } ) ; replaceTimerChangeHandler ( ) ; } return timer ; }
Source:
public void validateFailsOnSnapshotNotExists ( ) { org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( spyCommand.validate ( ) ) ; org.junit.Assert.assertTrue ( spyCommand.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void validateFailsOnSnapshotNotExists ( ) { org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( spyCommand , EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST ) ; }
Source:
public void networksNotUsedByVmsNorTemplates ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network net = mockNetwork ( ) ; networksUsedTest ( net , true , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void networksUsedByATemplate ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network net = mockNetwork ( ) ; networksUsedTest ( false , true , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_NETWORKS_USED_ONCE ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( net.getName ( ) ) ) ) ) ) ; }
Source:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void mtuValid ( ) { org.junit.Assert.assertThat ( validator.mtuValid ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
private void notIscsiBondNetworkTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.IscsiBond > iscsiBonds ) { org.mockito.Mockito.when ( iscsiBondDao.getIscsiBondsByNetworkId ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( iscsiBonds ) ; org.hamcrest.MatcherAssert.assertThat ( validator.notIscsiBondNetwork ( ) , matcher ) ; }
Source:
protected void executeQueryCommand ( ) { getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.getInstance ( ) . getPolicyUnitsMap ( ) . get ( getParameters ( ) . getId ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl value = org.ovirt.engine.core.bll.scheduling.SchedulingManager.getInstance ( ) . getPolicyUnitsMap ( ) . get ( getParameters ( ) . getId ( ) ) ; if ( value != null ) { getQueryReturnValue ( ) . setReturnValue ( value.getPolicyUnit ( ) ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol map ( org.ovirt.engine.api.model.BootProtocol bootProtocol , org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol template ) { if ( bootProtocol != null ) { switch ( bootProtocol ) { case DHCP : return org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.DHCP ; case STATIC : return org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ; case NONE : return org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ; default : return null ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol map ( org.ovirt.engine.api.model.BootProtocol bootProtocol , org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol template ) { if ( bootProtocol != null ) { switch ( bootProtocol ) { case DHCP : return org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.DHCP ; case STATIC : return org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.STATIC_IP ; case NONE : return org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.NONE ; default : return null ; } } return null ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addManagedDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type , org.ovirt.engine.core.common.utils.VmDeviceType device , java.util.Map < java.lang.String , java.lang.Object > specParams , boolean plugged , java.lang.Boolean readOnly , java.lang.String address , java.util.Map < java.lang.String , java.lang.String > customProp ) { org.ovirt.engine.core.common.businessentities.VmDevice managedDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , type , device , specParams , plugged , readOnly , customProp ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { managedDevice.setAddress ( address ) ; } return managedDevice ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice addManagedDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType generalType , org.ovirt.engine.core.common.utils.VmDeviceType type , java.util.Map < java.lang.String , java.lang.Object > specParams , boolean isPlugged , java.lang.Boolean isReadOnly ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , generalType , type , specParams , isPlugged , isReadOnly , "" , null , false ) ; }
Source:
private void addClusterDetails ( org.ovirt.engine.core.compat.Guid vdsGroupID , java.util.List < java.lang.String > clustersWithRunningVms ) { if ( ( vdsGroupID != null ) && ( ! ( vdsGroupID.equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDAO ( ) . getWithRunningVms ( vdsGroupID ) ; if ( vdsGroup != null ) { clustersWithRunningVms.add ( vdsGroup.getname ( ) ) ; } } }

Target:
private void addClusterDetails ( org.ovirt.engine.core.compat.Guid vdsGroupID , java.util.List < java.lang.String > clustersWithRunningVms ) { if ( ( vdsGroupID != null ) && ( ! ( vdsGroupID.equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . getWithRunningVms ( vdsGroupID ) ; if ( vdsGroup != null ) { clustersWithRunningVms.add ( vdsGroup.getname ( ) ) ; } } }
Source:
protected void failedToRunVm ( ) { try { if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { super . failedToRunVm ( ) ; } } finally { org.ovirt.engine.core.bll.MigrateVmCommand.freeLock ( ) ; } }

Target:
protected void failedToMigrate ( ) { try { determineMigrationFailureForAuditLog ( ) ; decreasePendingVms ( getDestinationVds ( ) . getId ( ) ) ; _isRerun = false ; org.ovirt.engine.core.bll.MigrateVmCommand.setSucceeded ( false ) ; org.ovirt.engine.core.bll.MigrateVmCommand.log ( ) ; failedToRunVm ( ) ; } finally { org.ovirt.engine.core.bll.MigrateVmCommand.freeLock ( ) ; } }
Source:
java.lang.String getSessionId ( ) { return restApiSessionId ; }

Target:
public void reuseSession ( ) { if ( ( restApiSessionId ) != null ) { processSessionId ( restApiSessionId ) ; } else { getSessionIdFromHttpSession ( new org.ovirt.engine.ui.frontend.communication.StorageCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.String result ) { if ( result != null ) { setSessionId ( result , false ) ; processSessionId ( result ) ; } else { processSessionIdException ( ) ; } } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { processSessionIdException ( ) ; } } ) ; } }
Source:
protected void lockVmSnapshotsWithWait ( org.ovirt.engine.core.common.businessentities.VM vm ) { snapshotsEngineLock = new org.ovirt.engine.core.utils.lock.EngineLock ( ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > snapshotsExlusiveLockMap = java.util.Collections.singletonMap ( vm.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_SNAPSHOTS , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; snapshotsEngineLock.setExclusiveLocks ( snapshotsExlusiveLockMap ) ; org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getLockManager ( ) . acquireLockWait ( snapshotsEngineLock ) ; }

Target:
protected void lockVmSnapshotsWithWait ( org.ovirt.engine.core.common.businessentities.VM vm ) { snapshotsEngineLock = new org.ovirt.engine.core.utils.lock.EngineLock ( ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > snapshotsExlusiveLockMap = java.util.Collections.singletonMap ( vm.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_SNAPSHOTS , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; snapshotsEngineLock.setExclusiveLocks ( snapshotsExlusiveLockMap ) ; lockManager.acquireLockWait ( snapshotsEngineLock ) ; }
Source:
void stubGetConfigurationValuePublicQuery ( ) { org.mockito.Mockito.when ( mockBackend.runPublicQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetConfigurationValue ) , org.mockito.Matchers.argThat ( configValueParams ( ConfigurationValues.ProductRPMVersion ) ) ) ) . thenReturn ( new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) { { setSucceeded ( true ) ; setReturnValue ( "1.2.3" ) ; } } ) ; }

Target:
void stubGetConfigurationValuePublicQuery ( ) { org.mockito.Mockito.when ( mockBackend.runPublicQuery ( org.mockito.ArgumentMatchers.eq ( VdcQueryType.GetConfigurationValue ) , org.mockito.ArgumentMatchers.argThat ( configValueParams ( ConfigurationValues.ProductRPMVersion ) ) ) ) . thenReturn ( new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) { { setSucceeded ( true ) ; setReturnValue ( "1.2.3" ) ; } } ) ; }
Source:
public void endWithFailure ( ) { enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
public void endWithFailure ( ) { enclosingCommand.getParameters ( ) . getDiskImage ( ) . setImageStatus ( ImageStatus.ILLEGAL ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( enclosingCommand.getParameters ( ) . getDiskImage ( ) . getImageId ( ) , enclosingCommand.getParameters ( ) . getDiskImage ( ) . getImageStatus ( ) ) ; compensate ( ) ; enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
protected boolean validateUploadToImage ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getDiskDao ( ) . get ( imageId ) ) ) ; org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator = getDiskValidator ( diskImage ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = getDiskImagesValidator ( diskImage ) ; return ( ( ( validate ( diskValidator.isDiskExists ( ) ) ) && ( validate ( diskValidator.isDiskAttachedToAnyVm ( ) ) ) ) && ( validate ( diskImagesValidator.diskImagesNotIllegal ( ) ) ) ) && ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) ; }

Target:
protected boolean validateUploadToImage ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( diskDao.get ( imageId ) ) ) ; org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator = getDiskValidator ( diskImage ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = getDiskImagesValidator ( diskImage ) ; return ( ( ( validate ( diskValidator.isDiskExists ( ) ) ) && ( validate ( diskValidator.isDiskAttachedToAnyVm ( ) ) ) ) && ( validate ( diskImagesValidator.diskImagesNotIllegal ( ) ) ) ) && ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) ; }
Source:
private static org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion computeTemplateWithVersionToSelect ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion > newItems , org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion previousSelection ) { if ( previousSelection == null ) { return org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.computeNewTemplateWithVersionToSelect ( newItems ) ; } org.ovirt.engine.core.compat.Guid previousTemplateId = previousSelection.getTemplateVersion ( ) . getId ( ) ; org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion oldTemplateToSelect = org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.TemplateWithVersionPredicate ( previousTemplateId ) ) ; return oldTemplateToSelect != null ? oldTemplateToSelect : org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.computeNewTemplateWithVersionToSelect ( newItems ) ; }

Target:
private static org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion computeTemplateWithVersionToSelect ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion > newItems , org.ovirt.engine.core.compat.Guid previousTemplateId , boolean useLatest ) { if ( previousTemplateId == null ) { return org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.computeNewTemplateWithVersionToSelect ( newItems ) ; } org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion oldTemplateToSelect = org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.TemplateWithVersionPredicate ( previousTemplateId , useLatest ) ) ; return oldTemplateToSelect != null ? oldTemplateToSelect : org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.computeNewTemplateWithVersionToSelect ( newItems ) ; }
Source:
protected void setUpGetClusterExpectations ( int times , java.lang.Object failure ) { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setStoragePoolId ( GUIDS [ 2 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , cluster , null ) ; } }

Target:
protected void setUpGetClusterExpectations ( int times , java.lang.Object failure ) { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setStoragePoolId ( GUIDS [ 2 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , cluster , null ) ; } }
Source:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static void GetDocumentationBaseURL ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
protected void saveSnapshotIfNotExists ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { if ( ! ( getSnapshotDao ( ) . exists ( getVm ( ) . getId ( ) , snapshotId ) ) ) { getSnapshotDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.Snapshot ( snapshotId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , getVm ( ) . getId ( ) , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR , disk.getDescription ( ) , disk.getLastModifiedDate ( ) , disk.getAppList ( ) ) ) ; } }

Target:
protected void saveSnapshotIfNotExists ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { if ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . exists ( getVm ( ) . getId ( ) , snapshotId ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.Snapshot ( snapshotId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , getVm ( ) . getId ( ) , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR , disk.getDescription ( ) , disk.getLastModifiedDate ( ) , disk.getAppList ( ) ) ) ; } }