auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.bll.ValidationResult macAvailable ( ) { java.lang.Boolean allowDupMacs = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.AllowDuplicateMacAddresses ) ; org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; if ( allowDupMacs || ( ! ( vmInterfaceManager.existsPluggedInterfaceWithSameMac ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_MAC_ADDRESS_IN_USE ) ; } }

Target:
protected org.ovirt.engine.core.bll.ValidationResult macAvailable ( ) { java.lang.Boolean allowDupMacs = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.AllowDuplicateMacAddresses ) ; org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; if ( allowDupMacs || ( ! ( vmInterfaceManager.existsPluggedInterfaceWithSameMac ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) ) ) ) ) { 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_MAC_ADDRESS_IN_USE ) ; } }
Source:
public void getIsGlusterVolumeSnapshotCliScheduleEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotCliScheduleFlag , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getGlusterVolumeGeoRepStatusForMasterVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeGeoRepSessions , new org.ovirt.engine.core.common.queries.IdQueryParameters ( masterVolumeId ) , aQuery ) ; }
Source:
public void testDetachVdsFromTag ( ) { dao.detachVdsFromTag ( existingVdsTag.getTagId ( ) , existingVdsTag.getVdsId ( ) ) ; org.ovirt.engine.core.common.businessentities.TagsVdsMap result = dao.getTagVdsByTagIdAndByVdsId ( existingVdsTag.getTagId ( ) , existingVdsTag.getVdsId ( ) ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testDetachVdsFromTag ( ) { dao.detachVdsFromTag ( existingVdsTag.getTagId ( ) , existingVdsTag.getVdsId ( ) ) ; org.ovirt.engine.core.common.businessentities.TagsVdsMap result = dao.getTagVdsByTagIdAndByVdsId ( existingVdsTag.getTagId ( ) , existingVdsTag.getVdsId ( ) ) ; org.junit.jupiter.api.Assertions.assertNull ( result ) ; }
Source:
public static void isMTUOverrideSupported ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String 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.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MTUOverrideSupported ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId , filterOutExistingHosts , searchFilter ) , aQuery ) ; }
Source:
private void mockJobSubjectEntityDao ( org.ovirt.engine.core.compat.Guid jobId ) { org.mockito.Mockito.when ( jobSubjectEntityDao.getJobSubjectEntityByJobId ( org.mockito.Matchers.eq ( jobId ) ) ) . thenReturn ( org.ovirt.engine.core.bll.job.JobRepositoryTest.JOB_SUBJECT_ENTITIES_MAP ) ; org.mockito.Mockito.when ( jobSubjectEntityDao.getJobIdByEntityId ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( jobId ) ) ; }

Target:
private void mockJobSubjectEntityDao ( org.ovirt.engine.core.compat.Guid jobId ) { org.mockito.Mockito.when ( jobSubjectEntityDao.getJobSubjectEntityByJobId ( org.mockito.ArgumentMatchers.eq ( jobId ) ) ) . thenReturn ( org.ovirt.engine.core.bll.job.JobRepositoryTest.JOB_SUBJECT_ENTITIES_MAP ) ; org.mockito.Mockito.when ( jobSubjectEntityDao.getJobIdByEntityId ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( jobId ) ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( parameters.getActionType ( ) , parameters ) ; command.insertAsyncTaskPlaceHolders ( ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }

Target:
private void initSearchDependencies ( ) { org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) ) ) ; }
Source:
private void handleFinalizingFailure ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { log.error ( "Finalizing failed transfer. {}" , getTransferDescription ( ) ) ; stopImageTransferSession ( context.entity ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getImageGroupID ( ) ) ) { setImageStatus ( ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Upload ) ? org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL : org.ovirt.engine.core.common.businessentities.storage.ImageStatus.OK ) ) ; } updateEntityPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; setAuditLogTypeFromPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; }

Target:
private void handleFinalizingFailure ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { log.error ( "Finalizing failed transfer. {}" , getTransferDescription ( ) ) ; stopImageTransferSession ( context.entity ) ; if ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getImageGroupID ( ) ) ) ) { setImageStatus ( ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Upload ) ? org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL : org.ovirt.engine.core.common.businessentities.storage.ImageStatus.OK ) ) ; } tearDownImage ( context.entity.getVdsId ( ) ) ; updateEntityPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; setAuditLogTypeFromPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; }
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.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , 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.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setStoragePoolId ( GUIDS [ 2 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClusterById , 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 java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > multipleParams , boolean isRunOnlyIfAllCanDoPass , boolean isWaitForResult ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunMultipleAction invoked! [amount of actions: {}]" , multipleParams.size ( ) ) ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase params : multipleParams ) { params.setSessionId ( getEngineSessionId ( ) ) ; } java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues = getBackend ( ) . runMultipleActions ( actionType , multipleParams , isRunOnlyIfAllCanDoPass , isWaitForResult ) ; return returnValues ; }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > multipleParams , boolean isRunOnlyIfAllValidationPass , boolean isWaitForResult ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunMultipleAction invoked! [amount of actions: {}]" , multipleParams.size ( ) ) ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase params : multipleParams ) { params.setSessionId ( getEngineSessionId ( ) ) ; } java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues = getBackend ( ) . runMultipleActions ( actionType , multipleParams , isRunOnlyIfAllValidationPass , isWaitForResult ) ; return returnValues ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model ) { org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmSnapshotCreatePopupWidget.Driver.driver.edit ( model ) ; model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "Message" . equals ( propName ) ) { appendMessage ( model.getMessage ( ) ) ; } } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model ) { org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmSnapshotCreatePopupWidget.Driver.driver.edit ( model ) ; model.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 ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "Message" . equals ( propName ) ) { appendMessage ( model.getMessage ( ) ) ; } } } ) ; }
Source:
private void addDefaultNetworks ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; net.setname ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.ManagementNetwork ) ) ; net.setdescription ( AddVdsGroupCommand.DefaultNetworkDescription ) ; net.setstorage_pool_id ( org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . getId ( ) ) ; net.setVmNetwork ( true ) ; org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getNetworkDAO ( ) . save ( net ) ; }

Target:
private void addDefaultNetworks ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; net.setName ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.ManagementNetwork ) ) ; net.setDescription ( AddVdsGroupCommand.DefaultNetworkDescription ) ; net.setDataCenterId ( org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . getId ( ) ) ; net.setVmNetwork ( true ) ; org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getNetworkDAO ( ) . save ( net ) ; }
Source:
public static void GetDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 5 ) ; }

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:
public void testNotRemovingLabeledNetworksReferencingUnlabeledNetworkRemovalIsOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network unlabeledNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unlabeledNetwork.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( unlabeledNetwork ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( java.util.Arrays.asList ( unlabeledNetwork ) ) ; org.junit.Assert.assertThat ( validator.notRemovingLabeledNetworks ( networkAttachment , null ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testNotRemovingLabeledNetworksReferencingUnlabeledNetworkRemovalIsOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network unlabeledNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unlabeledNetwork.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( unlabeledNetwork ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( java.util.Collections.singletonList ( unlabeledNetwork ) ) ; org.junit.Assert.assertThat ( validator.notRemovingLabeledNetworks ( networkAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitiesMap ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { return createTaskImpl ( taskId , asyncTaskCreationInfo , parentCommand , description , entitiesMap ) ; } catch ( java.lang.RuntimeException ex ) { log.errorFormat ( "Error during CreateTask for command: {0}. Exception {1}" , getClass ( ) . getName ( ) , ex ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitiesMap ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { return createTaskImpl ( taskId , asyncTaskCreationInfo , parentCommand , description , entitiesMap ) ; } catch ( java.lang.RuntimeException ex ) { log.errorFormat ( "Error during createTask for command: {0}. Exception {1}" , getClass ( ) . getName ( ) , ex ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } return org.ovirt.engine.core.compat.Guid.Empty ; }
Source:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.CreateSnapshotCommand.canCreateSnapshot ( ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = performImageVdsmOperation ( ) ; if ( ( vdsReturnValue != null ) && ( vdsReturnValue.getSucceeded ( ) ) ) { processOldImageFromDb ( ) ; addDiskImageToDb ( mNewCreatedDiskImage , null ) ; setActionReturnValue ( mNewCreatedDiskImage ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.setSucceeded ( true ) ; } } }

Target:
protected void executeCommand ( ) { if ( org.ovirt.engine.core.bll.CreateSnapshotCommand.canCreateSnapshot ( ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = performImageVdsmOperation ( ) ; if ( ( vdsReturnValue != null ) && ( vdsReturnValue.getSucceeded ( ) ) ) { 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 ( ) { processOldImageFromDb ( ) ; addDiskImageToDb ( mNewCreatedDiskImage , getCompensationContext ( ) ) ; setActionReturnValue ( mNewCreatedDiskImage ) ; setSucceeded ( true ) ; return null ; } } ) ; } } }
Source:
public void diskImagesAlreadyExistOneExist ( ) { org.mockito.Mockito.doReturn ( true ) . when ( validator ) . isDiskExists ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . isDiskExists ( disk2.getId ( ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.junit.matchers.JUnitMatchers.hasItem ( org.ovirt.engine.core.bll.validator.DiskImagesValidatorTest.createAliasReplacements ( disk1 ) ) ) ) ) ; }

Target:
public void diskImagesDontExist ( ) { org.mockito.Mockito.doReturn ( false ) . when ( validator ) . isDiskExists ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . isDiskExists ( disk2.getId ( ) ) ; org.junit.Assert.assertThat ( validator.diskImagesNotExist ( ) , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_NOT_EXIST ) ) ) ; }
Source:
public void getItem_prefixedKeyExists ( ) { org.mockito.Mockito.doReturn ( "LocalValue" ) . when ( tested ) . getLocalItemImpl ( ( ( org.ovirt.engine.ui.common.system.ClientStorageImplTest.KEY_PREFIX ) + "_LocalKey" ) ) ; java.lang.String localValue = tested.getLocalItem ( "LocalKey" ) ; org.junit.Assert.assertThat ( localValue , org.hamcrest.CoreMatchers.equalTo ( "LocalValue" ) ) ; org.mockito.Mockito.doReturn ( "SessionValue" ) . when ( tested ) . getSessionItemImpl ( ( ( org.ovirt.engine.ui.common.system.ClientStorageImplTest.KEY_PREFIX ) + "_SessionKey" ) ) ; java.lang.String sessionValue = tested.getSessionItem ( "SessionKey" ) ; org.junit.Assert.assertThat ( sessionValue , org.hamcrest.CoreMatchers.equalTo ( "SessionValue" ) ) ; }

Target:
public void getItem_prefixedKeyExists ( ) { org.mockito.Mockito.doReturn ( "LocalValue" ) . when ( tested ) . getLocalItemImpl ( ( ( ClientStorageImpl.CLIENT_STORAGE_KEY_PREFIX ) + "LocalKey" ) ) ; java.lang.String localValue = tested.getLocalItem ( "LocalKey" ) ; org.junit.Assert.assertThat ( localValue , org.hamcrest.CoreMatchers.equalTo ( "LocalValue" ) ) ; org.mockito.Mockito.doReturn ( "SessionValue" ) . when ( tested ) . getSessionItemImpl ( ( ( ClientStorageImpl.CLIENT_STORAGE_KEY_PREFIX ) + "SessionKey" ) ) ; java.lang.String sessionValue = tested.getSessionItem ( "SessionKey" ) ; org.junit.Assert.assertThat ( sessionValue , org.hamcrest.CoreMatchers.equalTo ( "SessionValue" ) ) ; }
Source:
private void PostInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.NGuid.Empty ) ) ) ) ; UpdateIsDisksAvailable ( ) ; }

Target:
private void postInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.NGuid.Empty ) ) ) ) ; updateIsDisksAvailable ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; setUpVolumes ( ) ; setUpDisks ( ) ; }

Target:
private void setUpDisks ( ) { com.woorea.openstack.cinder.model.Volume existingVolume = volumes.get ( 1 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > existingDisks = new java.util.ArrayList ( org.ovirt.engine.core.bll.storage.disk.cinder.CinderBroker.volumesToCinderDisks ( java.util.Collections.singletonList ( existingVolume ) , getQueryParameters ( ) . getId ( ) ) ) ; org.mockito.Mockito.when ( diskDao.getAllFromDisksByDiskStorageType ( DiskStorageType.CINDER , getUser ( ) . getId ( ) , false ) ) . thenReturn ( existingDisks ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getDiskDao ( ) ) . thenReturn ( diskDao ) ; }
Source:
protected org.ovirt.engine.core.common.action.ImportVmParameters createParameters ( ) { final org.ovirt.engine.core.common.businessentities.VM v = createVM ( ) ; v.setVmName ( "testVm" ) ; return new org.ovirt.engine.core.common.action.ImportVmParameters ( v , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.action.ImportVmParameters createParameters ( ) { final org.ovirt.engine.core.common.businessentities.VM v = createVM ( ) ; v.setName ( "testVm" ) ; return new org.ovirt.engine.core.common.action.ImportVmParameters ( v , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupsByStoragePoolId , org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpVDSGroups ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpVDSGroups ( ) , failure ) ; control.replay ( ) ; }
Source:
protected void initDetailModels ( ) { super . initDetailModels ( ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateVmListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateInterfaceListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateStorageListModel ( ) ) ; addCustomModelsDetailModelList ( list ) ; setDetailModels ( list ) ; }

Target:
private void setDetailList ( final java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list , final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel templateGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateVmListModel templateVmListModel , final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateInterfaceListModel templateInterfaceListModel , final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateStorageListModel templateStorageListModel ) { list.add ( templateGeneralModel ) ; list.add ( templateVmListModel ) ; list.add ( templateInterfaceListModel ) ; list.add ( templateStorageListModel ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetNicsExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplateInterface , org.ovirt.engine.core.common.action.RemoveVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendInstanceTypeNicResourceTest.INSTANCE_TYPE_ID , org.ovirt.engine.api.restapi.resource.BackendInstanceTypeNicResourceTest.NIC_ID } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetNicsExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplateInterface , org.ovirt.engine.core.common.action.RemoveVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendInstanceTypeNicResourceTest.INSTANCE_TYPE_ID , org.ovirt.engine.api.restapi.resource.BackendInstanceTypeNicResourceTest.NIC_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void ResetIrs ( ) { setmCurrentIrsHost ( null ) ; setmIrsProxy ( null ) ; mCurrentVdsId = null ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( _storagePoolId ) ; if ( storagePool != null ) { storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; } }

Target:
private void nullifyInternalProxies ( ) { if ( ( privatemIrsProxy ) != null ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcUtils.shutDownConnection ( ( ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsServerWrapper ) ( privatemIrsProxy ) ) . getHttpClient ( ) ) ; } privatemCurrentIrsHost = null ; privatemIrsProxy = null ; mCurrentVdsId = null ; }
Source:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void RemoveSnapshot ( org.ovirt.engine.core.common.businessentities.DiskImage snapshot ) { org.ovirt.engine.core.bll.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesForDisk = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }

Target:
protected void removeSnapshot ( org.ovirt.engine.core.common.businessentities.DiskImage snapshot ) { org.ovirt.engine.core.bll.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesForDisk = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }
Source:
public void getVolumeList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean doRefresh ) { getVolumeList ( aQuery , null , doRefresh ) ; }

Target:
public void getConfigurationValueBoolean ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.queries.ConfigurationValues configVal ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( configVal , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void stopTransferIfNecessary ( org.ovirt.engine.core.common.businessentities.storage.ImageTransfer entity , long ts , java.lang.Integer idleTimeFromTicket ) { if ( shouldAbortOnClientInactivityTimeout ( entity , ts , idleTimeFromTicket ) ) { if ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Download ) ) { auditLog ( this , AuditLogType.DOWNLOAD_IMAGE_CANCELED_TIMEOUT ) ; updateEntityPhase ( ImageTransferPhase.CANCELLED ) ; } else { updateEntityPhaseToPausedBySystem ( AuditLogType.UPLOAD_IMAGE_PAUSED_BY_SYSTEM_TIMEOUT ) ; } } }

Target:
private void stopTransferIfNecessary ( org.ovirt.engine.core.common.businessentities.storage.ImageTransfer entity , long ts , java.lang.Integer idleTimeFromTicket ) { if ( shouldAbortOnClientInactivityTimeout ( entity , ts , idleTimeFromTicket ) ) { if ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Download ) ) { auditLog ( this , AuditLogType.DOWNLOAD_IMAGE_CANCELED_TIMEOUT ) ; updateEntityPhase ( ImageTransferPhase.CANCELLED ) ; } else { updateEntityPhaseToStoppedBySystem ( AuditLogType.UPLOAD_IMAGE_PAUSED_BY_SYSTEM_TIMEOUT ) ; } } }
Source:
public void testOffsetMissingParameter ( ) { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { offsetValidateParameters ( vm ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "status" ) ; } }

Target:
public void testOffsetMissingParameter ( ) { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { offsetValidateParameters ( vm ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "status" ) ; } }
Source:
protected boolean checkImagesStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksToCheck = org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.filterImageDisks ( diskDao.getAllForVm ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.ONLY_NOT_SHAREABLE , org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.ONLY_ACTIVE ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( disksToCheck ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) && ( validate ( diskImagesValidator.diskImagesHaveNotExceededMaxNumberOfVolumesInImageChain ( ) ) ) ; }

Target:
protected org.ovirt.engine.core.bll.validator.storage.DiskVmElementValidator createDiskVmElementValidator ( org.ovirt.engine.core.compat.Guid diskId , org.ovirt.engine.core.compat.Guid vmId ) { return new org.ovirt.engine.core.bll.validator.storage.DiskVmElementValidator ( diskDao.get ( diskId ) , diskVmElementDao.get ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( diskId , vmId ) ) ) ; }
Source:
protected void processIncoming ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( ( this . ibuff ) == null ) { this . ibuff = java.nio.ByteBuffer.allocate ( 16384 ) ; readBytes ( this . ibuff ) ; } else { readBytes ( this . ibuff ) ; } }

Target:
protected void updateLastHeartbeat ( ) { this . lastHeartbeat = java.lang.System.currentTimeMillis ( ) ; }
Source:
private java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > getStorageQuotaListParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . getDiskList ( ) ) { if ( ( image.getQuotaId ( ) ) != null ) { list.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( image.getQuotaId ( ) , image.getstorage_ids ( ) . get ( 0 ) , image.getActualSize ( ) ) ) ; } } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; if ( java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getRunAsStateless ( ) ) ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( image.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , image.getstorage_ids ( ) . get ( 0 ) , image.getActualSize ( ) ) ) ; } } return list ; }
Source:
private void handleAddPermissions ( java.lang.String domainName , org.ovirt.engine.core.domains.DomainsConfigurationEntry adUserNameEntry , org.ovirt.engine.core.domains.DomainsConfigurationEntry adUserIdEntry ) { if ( addPermissions ) { updatePermissionsTable ( adUserNameEntry , adUserIdEntry ) ; } else { java.lang.System.out.println ( java.lang.String.format ( INFO_ABOUT_NOT_ADDING_PERMISSIONS , domainName ) ) ; } }

Target:
private void handleAddPermissions ( java.lang.String domainName , org.ovirt.engine.core.domains.DomainsConfigurationEntry adUserNameEntry , org.ovirt.engine.core.domains.DomainsConfigurationEntry adUserIdEntry ) { if ( addPermissions ) { updatePermissionsTable ( adUserNameEntry , adUserIdEntry ) ; } else if ( ! ( userHasPermissions ( adUserNameEntry , adUserIdEntry ) ) ) { java.lang.System.out.println ( java.lang.String.format ( INFO_ABOUT_NOT_ADDING_PERMISSIONS , domainName ) ) ; } }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ! ( vds.getvds_group_id ( ) . equals ( getVm ( ) . getvds_group_id ( ) ) ) ) || ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { sb.append ( "is not in up status or belongs to the VM's cluster" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ! ( vds.getvds_group_id ( ) . equals ( getVm ( ) . getVdsGroupId ( ) ) ) ) || ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { sb.append ( "is not in up status or belongs to the VM's cluster" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER ; } return null ; }
Source:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.ImportVmCommand.getEffectiveCompatibilityVersion ( ) ) ) ) ) { return failCanDoAction ( EngineMessage.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }

Target:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.ImportVmCommand.getEffectiveCompatibilityVersion ( ) ) ) ) ) { return failValidation ( EngineMessage.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionStop ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStop ( volumeName , remoteHost , remoteVolumeName , force ) ) ; } 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 glusterVolumeGeoRepConfigReset ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey , java.lang.String userName ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepConfigReset ( volumeName , slaveHost , slaveVolumeName , configKey , userName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getAttachedTagsToUser ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.setAttachedTagsConverter ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTagsByUserId , new org.ovirt.engine.core.common.queries.GetTagsByUserIdParameters ( id.toString ( ) ) , aQuery ) ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { if ( ( ( diskInfoDestinationMap ) != null ) && ( ! ( diskInfoDestinationMap.isEmpty ( ) ) ) ) { java.util.Map < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskInfoDestinationMap.values ( ) ) { map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.AddVmTemplateCommand.getStoragePool ( ) . getcompatibility_version ( ) ) ) ; } return true ; }

Target:
protected boolean isDisksAliasNotEmpty ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskInfoDestinationMap.values ( ) ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( diskImage.getDiskAlias ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_CANNOT_BE_CREATED_WITH_EMPTY_DISK_ALIAS ) ; } } return true ; }
Source:
private void UpdateActionAvailability ( ) { boolean temp = ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) == 1 ) ; getCloneCommand ( ) . setIsExecutionAllowed ( temp ) ; getEditCommand ( ) . setIsExecutionAllowed ( temp ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) > 0 ) ) && ( ! ( IsAnyRoleReadOnly ( getSelectedItems ( ) ) ) ) ) ) ; }

Target:
private void updateActionAvailability ( ) { boolean temp = ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) == 1 ) ; getCloneCommand ( ) . setIsExecutionAllowed ( temp ) ; getEditCommand ( ) . setIsExecutionAllowed ( temp ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) > 0 ) ) && ( ! ( isAnyRoleReadOnly ( getSelectedItems ( ) ) ) ) ) ) ; }