auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return createTask ( asyncTaskCreationInfo , parentCommand , null , null , org.ovirt.engine.core.bll.CommandBase.EMPTY_GUID_ARRAY ) ; }

Target:
public java.lang.Void runInTransaction ( ) { buildChildCommandInfos ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > entry : childCommandInfoMap.entrySet ( ) ) { org.ovirt.engine.core.bll.CommandBase < ? > command = getBackendCommandObjectsHandler ( ) . createAction ( entry.getValue ( ) . getFirst ( ) , entry.getValue ( ) . getSecond ( ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; childCommandsMap.put ( entry.getKey ( ) , command ) ; } return null ; }
Source:
public void confFileConvertToMapFails ( ) throws java.io.IOException , java.net.URISyntaxException { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdcCommand ( ActionType.RetrieveImageData , successfulActionReturnValue ( load ( "not-a-valid-hosted-engine-config-tar.tar" ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( ActionType.RetrieveImageData , org.mockito.Mockito.times ( 1 ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }

Target:
public void confFileConvertToMapFails ( ) throws java.io.IOException , java.net.URISyntaxException { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdcCommand ( ActionType.RetrieveImageData , successfulActionReturnValue ( load ( "not-a-valid-hosted-engine-config-tar.tar" ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( ActionType.RetrieveImageData , org.mockito.Mockito.times ( 1 ) ) ; org.hamcrest.MatcherAssert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }
Source:
public void appendCustomValue ( final java.lang.String name , final java.lang.String value , final java.lang.String separator ) { final java.lang.String key = name.toLowerCase ( ) ; java.lang.String newValue = value ; if ( customValues.containsKey ( key ) ) { newValue = java.lang.String.format ( "%1$s%2$s%3$s" , customValues.get ( key ) , separator , value ) ; } customValues.put ( name.toLowerCase ( ) , newValue ) ; }

Target:
public void appendCustomValue ( final java.lang.String name , final java.lang.String value , final java.lang.String separator ) { final java.lang.String key = name.toLowerCase ( ) ; java.lang.String newValue = value ; allocateCustomValues ( ) ; if ( customValues.containsKey ( key ) ) { newValue = java.lang.String.format ( "%1$s%2$s%3$s" , customValues.get ( key ) , separator , value ) ; } customValues.put ( name.toLowerCase ( ) , newValue ) ; }
Source:
private void AddVdsStaticToDb ( ) { org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) . setserver_SSL_enabled ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.UseSecureConnectionWithServers ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStaticDao ( ) . save ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) ) ; org.ovirt.engine.core.bll.AddVdsCommand.getCompensationContext ( ) . snapshotNewEntity ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) ) ; setVdsIdRef ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.AddVdsCommand.setVds ( null ) ; }

Target:
private void AddVdsStaticToDb ( ) { org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) . setServerSslEnabled ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.UseSecureConnectionWithServers ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStaticDao ( ) . save ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) ) ; org.ovirt.engine.core.bll.AddVdsCommand.getCompensationContext ( ) . snapshotNewEntity ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) ) ; setVdsIdRef ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.AddVdsCommand.setVds ( null ) ; }
Source:
public void verifyListOfRunningVmsIsSameWithFailureOnGetVmStats ( ) { prepareForRefreshVmStatsCall ( ) ; mockGetVmStatsCommand ( false ) ; updater.fetchRunningVms ( ) ; java.util.List < org.ovirt.engine.core.compat.Guid > staleRunningVms = updater.checkVmsStatusChanged ( ) ; junit.framework.Assert.assertFalse ( updater.getRunningVms ( ) . containsKey ( org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfoTest.VM_1 ) ) ; junit.framework.Assert.assertTrue ( staleRunningVms.contains ( org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfoTest.VM_1 ) ) ; }

Target:
public void verifyListOfRunningVmsIsSameWithFailureOnGetVmStats ( ) { prepareForRefreshVmStatsCall ( ) ; mockGetVmStatsCommand ( false ) ; updater.fetchRunningVms ( ) ; java.util.List < org.ovirt.engine.core.compat.Guid > staleRunningVms = updater.checkVmsStatusChanged ( ) ; org.junit.Assert.assertFalse ( updater.getRunningVms ( ) . containsKey ( org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfoTest.VM_1 ) ) ; org.junit.Assert.assertTrue ( staleRunningVms.contains ( org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfoTest.VM_1 ) ) ; }
Source:
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.RunQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , 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.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel spiceConsoleModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ( model ) ) ; java.lang.String address = ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; spiceConsoleModel.getspice ( ) . setHost ( address ) ; spiceConsoleModel.SpiceConnect ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel spiceConsoleModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ( model ) ) ; java.lang.String address = ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; spiceConsoleModel.getspice ( ) . setHost ( address ) ; spiceConsoleModel.spiceConnect ( ) ; }
Source:
public void canDoActionWrongDiskImageTypeVm ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initVmDiskImage ( false ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_NOT_TEMPLATE_DISK.toString ( ) ) ) ; }

Target:
public void canDoActionVmInPreview ( ) { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
Source:
public boolean equals ( java.lang.Object other ) { if ( ! ( other instanceof org.ovirt.engine.core.compat.Guid ) ) { return false ; } org.ovirt.engine.core.compat.Guid otherGuid = ( ( org.ovirt.engine.core.compat.Guid ) ( other ) ) ; return uuid.equals ( otherGuid.getUuid ( ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.compat.Guid ) ) { return false ; } org.ovirt.engine.core.compat.Guid other = ( ( org.ovirt.engine.core.compat.Guid ) ( obj ) ) ; return java.util.Objects.equals ( uuid , other.uuid ) ; }
Source:
protected void verifyEntityModification ( org.ovirt.engine.core.common.businessentities.VdsDynamic result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VdsDynamicDAOTest.TEST_BUILD_NAME , result.getBuildName ( ) ) ; }

Target:
public void testRemove ( ) { dao.remove ( existingVds.getId ( ) ) ; statisticsDao.remove ( existingVds.getId ( ) ) ; staticDao.remove ( existingVds.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VdsStatic resultStatic = staticDao.get ( existingVds.getId ( ) ) ; org.junit.Assert.assertNull ( resultStatic ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic resultDynamic = dao.get ( existingVds.getId ( ) ) ; org.junit.Assert.assertNull ( resultDynamic ) ; }
Source:
private < T > void validateMessageItems ( java.lang.String [ ] messageItems , java.util.List < T > items ) { validateMessageContainsProperties ( messageItems ) ; org.junit.Assert.assertTrue ( messageItems [ 0 ] . contains ( org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_VALUE ) ) ; org.junit.Assert.assertTrue ( messageItems [ 1 ] . contains ( java.lang.String.valueOf ( items.size ( ) ) ) ) ; }

Target:
private boolean validateReplacementContains ( java.util.Collection < java.lang.String > replacements , java.lang.String property ) { java.util.Iterator < java.lang.String > iterator = replacements.iterator ( ) ; while ( iterator.hasNext ( ) ) { java.lang.String replacement = iterator.next ( ) ; if ( replacement.contains ( property ) ) { return true ; } } return false ; }
Source:
public static void GetDocumentationBaseURL ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getVmNicList ( 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 ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
default void inputDetail ( ) { org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( snapshot ( ) . id ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( restoreMemory ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( disks ( ) [ org.ovirt.api.metamodel.language.ApiLanguage.COLLECTION ] . id ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( disks ( ) [ org.ovirt.api.metamodel.language.ApiLanguage.COLLECTION ] . imageId ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( disks ( ) [ org.ovirt.api.metamodel.language.ApiLanguage.COLLECTION ] . snapshot ( ) . id ( ) ) ; }

Target:
default void inputDetail ( ) { org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( snapshot ( ) . id ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( restoreMemory ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( lease ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( disks ( ) [ org.ovirt.api.metamodel.language.ApiLanguage.COLLECTION ] . id ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( disks ( ) [ org.ovirt.api.metamodel.language.ApiLanguage.COLLECTION ] . imageId ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( disks ( ) [ org.ovirt.api.metamodel.language.ApiLanguage.COLLECTION ] . snapshot ( ) . id ( ) ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; try { new org.ovirt.engine.ui.uicompat.MailAddress ( ( ( java.lang.String ) ( value ) ) ) ; } catch ( java.lang.RuntimeException e ) { result.setSuccess ( false ) ; result.getReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . invalidEmailAddressInvalidReason ( ) ) ; } return result ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { if ( ! ( org.ovirt.engine.core.compat.Regex.isMatch ( ( ( java.lang.String ) ( value ) ) , org.ovirt.engine.ui.uicommonweb.validation.EmailValidation.pattern , RegexOptions.IgnoreCase ) ) ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; result.setSuccess ( false ) ; result.getReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . invalidEmailAddressInvalidReason ( ) ) ; return result ; } return org.ovirt.engine.ui.uicommonweb.validation.ValidationResult.ok ( ) ; }
Source:
private java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > addTaskToQueue ( org.ovirt.engine.core.common.eventqueue.Event event , java.util.concurrent.Callable < org.ovirt.engine.core.common.eventqueue.EventResult > callable , org.ovirt.engine.core.compat.Guid storagePoolId ) { java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > task = new java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > ( callable ) ; getEventQueue ( storagePoolId ) . add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.eventqueue.Event , java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > > ( event , task ) ) ; return task ; }

Target:
private java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > addTaskToQueue ( org.ovirt.engine.core.common.eventqueue.Event event , java.util.concurrent.Callable < org.ovirt.engine.core.common.eventqueue.EventResult > callable , org.ovirt.engine.core.compat.Guid storagePoolId , boolean addFirst ) { java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > task = new java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > ( callable ) ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.eventqueue.Event , java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > > queueEvent = new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.eventqueue.Event , java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > > ( event , task ) ; if ( addFirst ) { getEventQueue ( storagePoolId ) . addFirst ( queueEvent ) ; } else { getEventQueue ( storagePoolId ) . add ( queueEvent ) ; } return task ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDisk ( org.ovirt.engine.core.compat.Guid diskId , org.ovirt.engine.core.compat.Guid imageId , boolean shouldWipe ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setId ( diskId ) ; disk.setImageId ( imageId ) ; disk.setStoragePoolId ( org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getParameters ( ) . getStoragePoolId ( ) ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) ; disk.setWipeAfterDelete ( shouldWipe ) ; disk.setActive ( true ) ; return disk ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDisk ( org.ovirt.engine.core.compat.Guid diskId , boolean shouldWipe ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setId ( diskId ) ; disk.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disk.setStoragePoolId ( org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getParameters ( ) . getStoragePoolId ( ) ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) ; disk.setWipeAfterDelete ( shouldWipe ) ; disk.setActive ( true ) ; return disk ; }
Source:
private void testmanagementNetworkNotExternal ( boolean management , boolean external , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expected ) { org.mockito.Mockito.when ( networkCluster.isManagement ( ) ) . thenReturn ( management ) ; org.mockito.Mockito.when ( network.isExternal ( ) ) . thenReturn ( external ) ; org.junit.Assert.assertThat ( validator.managementNetworkNotExternal ( network ) , expected ) ; }

Target:
private void testManagementNetworkNotExternal ( boolean management , boolean external , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expected ) { networkCluster.setManagement ( management ) ; setNetworkExternal ( network , external ) ; org.junit.Assert.assertThat ( validator.managementNetworkNotExternal ( network ) , expected ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase endAction ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task , org.ovirt.engine.core.bll.job.ExecutionContext context ) { org.ovirt.engine.core.common.businessentities.AsyncTasks dbAsyncTask = task.getParameters ( ) . getDbAsyncTask ( ) ; org.ovirt.engine.core.common.action.VdcActionType actionType = getEndActionType ( dbAsyncTask ) ; org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = dbAsyncTask.getActionParameters ( ) ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters ) ; command.getContext ( ) . withExecutionContext ( context ) ; return new org.ovirt.engine.core.bll.tasks.DecoratedCommand ( command ) . endAction ( ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase endAction ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task , org.ovirt.engine.core.bll.job.ExecutionContext context ) { org.ovirt.engine.core.common.businessentities.AsyncTask dbAsyncTask = task.getParameters ( ) . getDbAsyncTask ( ) ; org.ovirt.engine.core.common.action.VdcActionType actionType = getEndActionType ( dbAsyncTask ) ; org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = dbAsyncTask.getActionParameters ( ) ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters ) ; command.getContext ( ) . withExecutionContext ( context ) ; return new org.ovirt.engine.core.bll.tasks.DecoratedCommand ( command ) . endAction ( ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getUserRequestForStorageDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageType imageType , boolean forceRefresh ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > repoList = null ; if ( ! ( isStorageDomainValid ( storageDomainId , imageType , forceRefresh ) ) ) { return null ; } repoList = getCachedIsoListByDomainId ( storageDomainId , imageType ) ; return repoList ; }

Target:
public static org.ovirt.engine.core.bll.IsoDomainListSyncronizer getInstance ( ) { if ( ( org.ovirt.engine.core.bll.IsoDomainListSyncronizer.isoDomainListSyncronizer ) == null ) { synchronized ( org.ovirt.engine.core.bll.IsoDomainListSyncronizer.class ) { if ( ( org.ovirt.engine.core.bll.IsoDomainListSyncronizer.isoDomainListSyncronizer ) == null ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.isoDomainListSyncronizer = new org.ovirt.engine.core.bll.IsoDomainListSyncronizer ( ) ; } } } return org.ovirt.engine.core.bll.IsoDomainListSyncronizer.isoDomainListSyncronizer ; }
Source:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public void testRetryWithNoSuccess ( ) throws java.lang.Exception { java.util.concurrent.Callable < java.lang.Object > callable = org.mockito.Mockito.mock ( java.util.concurrent.Callable.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy policy = new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy ( 5 , 3 , java.io.IOException.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable < java.lang.Object > retryable = new org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable ( callable , policy ) ; org.mockito.Mockito.stub ( callable.call ( ) ) . toThrow ( new java.net.ConnectException ( ) ) . toThrow ( new java.io.IOException ( ) ) . toThrow ( new java.io.IOException ( ) ) ; retryable.call ( ) ; }

Target:
public void testRetryWithNoSuccess ( ) throws java.lang.Exception { java.util.concurrent.Callable < java.lang.Object > callable = org.mockito.Mockito.mock ( java.util.concurrent.Callable.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy policy = new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy ( 5 , 3 , 10 , java.io.IOException.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable < java.lang.Object > retryable = new org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable ( callable , policy ) ; org.mockito.Mockito.stub ( callable.call ( ) ) . toThrow ( new java.net.ConnectException ( ) ) . toThrow ( new java.io.IOException ( ) ) . toThrow ( new java.io.IOException ( ) ) ; retryable.call ( ) ; }
Source:
public void testDeactivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.HotUnPlugDiskFromVm , org.ovirt.engine.core.common.action.HotPlugDiskToVmParameters.class , new java.lang.String [ ] { "DiskVmElement" } , new java.lang.Object [ ] { new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID ) } , true , true ) ) ; javax.ws.rs.core.Response response = resource.deactivate ( new org.ovirt.engine.api.model.Action ( ) ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }

Target:
public void testDeactivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.HotUnPlugDiskFromVm , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "DiskVmElement" } , new java.lang.Object [ ] { new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID ) } , true , true ) ) ; javax.ws.rs.core.Response response = resource.deactivate ( new org.ovirt.engine.api.model.Action ( ) ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel object ) { org.ovirt.engine.ui.webadmin.section.main.view.popup.AssignTagsPopupView.Driver.driver.edit ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel ) ( sender ) ) ; java.lang.String propertyName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "SelectionNodeList" . equals ( propertyName ) ) { updateTree ( model ) ; } } } ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel object ) { driver.edit ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel ) ( sender ) ) ; java.lang.String propertyName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "SelectionNodeList" . equals ( propertyName ) ) { updateTree ( model ) ; } } } ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.Disk findBoot ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( disk.isBoot ( ) ) { return disk ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.Disk findBoot ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = disk.getDiskVmElementForVm ( getVm ( ) . getId ( ) ) ; if ( ( dve != null ) && ( dve.isBoot ( ) ) ) { return disk ; } } return null ; }
Source:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . update ( foremanTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( logicalNetworksEditorPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( consoleTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) . visibleInAdvancedModeOnly ( ) ) . putOne ( baseTemplateEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . update ( foremanTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( logicalNetworksEditorRow , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( consoleTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) . visibleInAdvancedModeOnly ( ) ) . putOne ( baseTemplateEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; }
Source:
public static void GetStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void GetCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { 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.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
private void performImageDbOperations ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { removeImageFromDB ( ) ; } else { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( getParameters ( ) . getImageId ( ) , getParameters ( ) . getStorageDomainId ( ) ) ) ; unLockImage ( ) ; return null ; } } ) ; } }

Target:
private void performImageDbOperations ( ) { switch ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getDbOperationScope ( ) ) { case IMAGE : removeImageFromDB ( ) ; break ; case MAPPING : removeImageMapping ( ) ; break ; case NONE : break ; } }
Source:
private void CleanUp ( ) { if ( ( ( ( org.ovirt.engine.core.utils.pm.VdsFencingOptions.fencingAgentInstanceOptions ) != null ) && ( ( org.ovirt.engine.core.utils.pm.VdsFencingOptions.fencingOptionMapping ) != null ) ) && ( ( org.ovirt.engine.core.utils.pm.VdsFencingOptions.fencingOptionTypes ) != null ) ) { org.ovirt.engine.core.utils.pm.VdsFencingOptions.fencingAgentInstanceOptions.clear ( ) ; org.ovirt.engine.core.utils.pm.VdsFencingOptions.fencingOptionMapping.clear ( ) ; org.ovirt.engine.core.utils.pm.VdsFencingOptions.fencingOptionTypes.clear ( ) ; org.ovirt.engine.core.utils.pm.VdsFencingOptions.fencingSpecialParams.clear ( ) ; } Init ( ) ; }

Target:
private void CleanUp ( ) { if ( ( ( ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingAgentInstanceOptions ) != null ) && ( ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionMapping ) != null ) ) && ( ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionTypes ) != null ) ) { org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingAgentInstanceOptions.clear ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionMapping.clear ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionTypes.clear ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingSpecialParams.clear ( ) ; } Init ( ) ; }
Source:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( GUIDS [ 0 ] , true ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( GUIDS [ 0 ] , true ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Role role ) { validateParameters ( role , "name" , "permits.id" ) ; validateEnums ( org.ovirt.engine.api.model.Role.class , role ) ; return performCreation ( VdcActionType.AddRoleWithActionGroups , new org.ovirt.engine.core.common.action.RoleWithActionGroupsParameters ( map ( role ) , mapPermits ( role.getPermits ( ) . getPermits ( ) ) ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetRoleById , org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Role role ) { validateParameters ( role , "name" , "permits.id" ) ; validateEnums ( org.ovirt.engine.api.model.Role.class , role ) ; return performCreate ( VdcActionType.AddRoleWithActionGroups , new org.ovirt.engine.core.common.action.RoleWithActionGroupsParameters ( map ( role ) , mapPermits ( role.getPermits ( ) . getPermits ( ) ) ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetRoleById , org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters.class ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation ( getMovedDiskIds ( ) , ImageStatus.LOCKED , ImageStatus.OK , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCompensationContext ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = runInternalAction ( ActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getContext ( ) ) ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . setAutoGeneratedSnapshotId ( vdcReturnValue.getActionReturnValue ( ) ) ; persistCommand ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getParentCommand ( ) , ( ( getCallback ( ) ) != null ) ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation ( getMovedDiskIds ( ) , ImageStatus.LOCKED , ImageStatus.OK , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCompensationContext ( ) ) ; org.ovirt.engine.core.common.action.ActionReturnValue actionReturnValueurnValue = runInternalAction ( ActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getContext ( ) ) ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . setAutoGeneratedSnapshotId ( actionReturnValueurnValue.getActionReturnValue ( ) ) ; persistCommand ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getParentCommand ( ) , ( ( getCallback ( ) ) != null ) ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.setSucceeded ( true ) ; }
Source:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }

Target:
public static void getStorageDomainListByTemplate ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public void validateFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" , null ) ; storageDevice.setCanCreateBrick ( false ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( storageDevice ) ) , null ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" , null ) ; storageDevice.setCanCreateBrick ( false ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.singletonList ( storageDevice ) ) , null ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
protected void executeVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.getParameters ( ) . setEntityId ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getId ( ) ) ; if ( ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( org.apache.commons.lang.StringUtils.isNotEmpty ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getHibernationVolHandle ( ) ) ) ) { setSuspendedVm ( true ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( stopSuspendedVm ( ) ) ; } else { super . executeVmCommand ( ) ; } }

Target:
protected void executeVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.getParameters ( ) . setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.VM , org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getId ( ) ) ) ; if ( ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( org.apache.commons.lang.StringUtils.isNotEmpty ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getHibernationVolHandle ( ) ) ) ) { setSuspendedVm ( true ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( stopSuspendedVm ( ) ) ; } else { super . executeVmCommand ( ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.getBackend ( ) . runInternalAction ( VdcActionType.PersistentSetupNetworks , new org.ovirt.engine.core.bll.network.RemoveNetworksByLabelParametersBuilder ( ) . buildParameters ( getNic ( ) , getLabel ( ) , org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.getVds ( ) . getVdsGroupId ( ) ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( VdcActionType.PersistentSetupNetworks , new org.ovirt.engine.core.bll.network.RemoveNetworksByLabelParametersBuilder ( org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.getContext ( ) ) . buildParameters ( getNic ( ) , getLabel ( ) , org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.getVds ( ) . getVdsGroupId ( ) ) , org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isStorageDomainTypeFitsDC ( ) { boolean isBlockDomain = storageDomainStatic.getStorageType ( ) . isBlockDomain ( ) ; if ( ! ( isMixedTypesAllowedInDC ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageType > storageTypesOnPool = getStoragePoolDao ( ) . getStorageTypesInPool ( storagePool.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageType storageType : storageTypesOnPool ) { if ( ( storageType.isBlockDomain ( ) ) != isBlockDomain ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ; } } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isStorageDomainTypeFitsPoolIfMixed ( ) { boolean isBlockDomain = storageDomainStatic.getStorageType ( ) . isBlockDomain ( ) ; if ( ! ( isMixedTypesAllowedInDC ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageType > storageTypesOnPool = getStoragePoolDao ( ) . getStorageTypesInPool ( storagePool.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageType storageType : storageTypesOnPool ) { if ( ( storageType.isBlockDomain ( ) ) != isBlockDomain ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ; } } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase res = result.getReturnValue ( ) ; if ( ( res == null ) || ( ! ( res.getSucceeded ( ) ) ) ) { return ; } cancel ( ) ; sourceListModel.getSearchCommand ( ) . execute ( ) ; }

Target:
private void setUsername ( org.ovirt.engine.ui.uicommonweb.models.EntityModel value ) { privateUsername = value ; }
Source:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters parameters = org.ovirt.engine.core.vdsbroker.gluster.StartGlusterVolumeGeoRepVDSCommand.getParameters ( ) ; status = org.ovirt.engine.core.vdsbroker.gluster.StartGlusterVolumeGeoRepVDSCommand.getBroker ( ) . glusterVolumeGeoRepStart ( parameters.getVolumeName ( ) , parameters.getSlaveHost ( ) , parameters.getSlaveVolume ( ) , parameters.getForce ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.StartGlusterVolumeGeoRepVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters parameters = org.ovirt.engine.core.vdsbroker.gluster.StartGlusterVolumeGeoRepVDSCommand.getParameters ( ) ; status = org.ovirt.engine.core.vdsbroker.gluster.StartGlusterVolumeGeoRepVDSCommand.getBroker ( ) . glusterVolumeGeoRepSessionStart ( parameters.getVolumeName ( ) , parameters.getSlaveHost ( ) , parameters.getSlaveVolume ( ) , parameters.getForce ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.StartGlusterVolumeGeoRepVDSCommand.proceedProxyReturnValue ( ) ; }