auphong2707/dl4se-code-review-dataset huggingface dataset:
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 ) { 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 ( getSessionId ( ) ) ; } java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues = getBackend ( ) . RunMultipleActions ( actionType , multipleParams , isRunOnlyIfAllCanDoPass ) ; 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 isRunOnlyIfAllCanDoPass ) { 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 ( getSessionId ( ) ) ; } java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues = getBackend ( ) . runMultipleActions ( actionType , multipleParams , isRunOnlyIfAllCanDoPass ) ; return returnValues ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setstatus ( VMStatus.Up ) ; vm.setvm_os ( VmOsType.RHEL6 ) ; vm.setId ( vmId ) ; vm.setrun_on_vds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDAO ) ; mockVMDAO ( vm ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( VmOsType.RHEL6 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDAO ) ; mockVMDAO ( vm ) ; return vm ; }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants , org.ovirt.engine.ui.webadmin.ApplicationDynamicMessages dynamicMessages ) { userNameEditor.setLabel ( constants.loginFormUserNameLabel ( ) ) ; passwordEditor.setLabel ( constants.loginFormPasswordLabel ( ) ) ; domainEditor.setLabel ( constants.loginFormDomainLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }

Target:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants , org.ovirt.engine.ui.webadmin.ApplicationDynamicMessages dynamicMessages ) { userNameEditor.setLabel ( constants.loginFormUserNameLabel ( ) ) ; passwordEditor.setLabel ( constants.loginFormPasswordLabel ( ) ) ; profileEditor.setLabel ( constants.loginFormProfileLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }
Source:
public void testDetachSuccess ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpActionExpectations ( ActionType.DetachStorageConnectionFromStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ; javax.ws.rs.core.Response response = resource.remove ( ) ; org.junit.Assert.assertEquals ( 200 , response.getStatus ( ) ) ; }

Target:
public void testDetachSuccess ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpActionExpectations ( ActionType.DetachStorageConnectionFromStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ; javax.ws.rs.core.Response response = resource.remove ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( 200 , response.getStatus ( ) ) ; }
Source:
protected boolean canDoAction ( ) { return ( ( ( ( validate ( networkExists ( geRemovedtNetwork ( ) ) ) ) && ( validate ( notManagementNetwork ( ) ) ) ) && ( validate ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.networkNotUsedByVms ( ) ) ) ) && ( validate ( networkNotUsedByTemplates ( geRemovedtNetwork ( ) ) ) ) ) && ( validate ( networkNotUsedByHosts ( geRemovedtNetwork ( ) ) ) ) ; }

Target:
protected boolean canDoAction ( ) { return ( ( ( ( validate ( networkExists ( getRemovedNetwork ( ) ) ) ) && ( validate ( notManagementNetwork ( ) ) ) ) && ( validate ( networkNotUsedByVms ( getRemovedNetwork ( ) ) ) ) ) && ( validate ( networkNotUsedByTemplates ( getRemovedNetwork ( ) ) ) ) ) && ( validate ( networkNotUsedByHosts ( getRemovedNetwork ( ) ) ) ) ; }
Source:
private void setUpAddUserExpectations ( java.lang.String query ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( query , SearchType.AdUser , getAdUser ( 0 ) ) ; setUpCreationExpectations ( VdcActionType.AddUser , org.ovirt.engine.core.common.action.AddUserParameters.class , new java.lang.String [ ] { "VdcUser.UserId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true , null , VdcQueryType.GetDbUserByUserId , org.ovirt.engine.core.common.queries.GetDbUserByUserIdParameters.class , new java.lang.String [ ] { "UserId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; }

Target:
private void setUpAddUserExpectations ( java.lang.String query ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( query , SearchType.AdUser , getAdUser ( 0 ) ) ; setUpCreationExpectations ( VdcActionType.AddUser , org.ovirt.engine.core.common.action.AddUserParameters.class , new java.lang.String [ ] { "VdcUser.UserId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true , null , VdcQueryType.GetDbUserByUserId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; }
Source:
public void testRefreshStatusNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( false ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionStatus ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.Matchers.any ( java.util.List.class ) ) ; }

Target:
public void testRefreshStatusNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( false ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionStatus ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.ArgumentMatchers.any ( java.util.List.class ) ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( "INITIALIZED" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } else { } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( "INITIALIZED" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } else if ( "ARCHITECTURE" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ; } return retval ; }
Source:
protected void executeCommand ( ) { addCustomValue ( "NicName" , getNic ( ) . getName ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( ActionType.HostSetupNetworks , createHostSetupNetworksParameters ( ) , org.ovirt.engine.core.bll.network.host.LabelNicCommand.cloneContextAndDetachFromParent ( ) ) ; if ( result.getSucceeded ( ) ) { org.ovirt.engine.core.bll.network.host.LabelNicCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; } else { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { addCustomValue ( "NicName" , getNic ( ) . getName ( ) ) ; org.ovirt.engine.core.common.action.ActionReturnValue result = runInternalAction ( ActionType.HostSetupNetworks , createHostSetupNetworksParameters ( ) , org.ovirt.engine.core.bll.network.host.LabelNicCommand.cloneContextAndDetachFromParent ( ) ) ; if ( result.getSucceeded ( ) ) { org.ovirt.engine.core.bll.network.host.LabelNicCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; } else { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }
Source:
protected void handleCredentials ( java.net.HttpURLConnection connection ) { if ( ( ( hostProvider.getUsername ( ) ) != null ) && ( ( hostProvider.getPassword ( ) ) != null ) ) { connection.setRequestProperty ( "Authorization" , java.lang.String.format ( "Basic %1$s" , new org.apache.commons.codec.binary.Base64 ( 0 ) . encodeToString ( java.lang.String.format ( "%1$s:%2$s" , hostProvider.getUsername ( ) , hostProvider.getPassword ( ) ) . getBytes ( java.nio.charset.Charset.forName ( "UTF-8" ) ) ) ) . toString ( ) ) ; } }

Target:
protected void handleCredentials ( java.net.HttpURLConnection connection ) { if ( ( ( hostProvider.getUsername ( ) ) != null ) && ( ( hostProvider.getPassword ( ) ) != null ) ) { connection.setRequestProperty ( "Authorization" , java.lang.String.format ( "Basic %1$s" , new org.apache.commons.codec.binary.Base64 ( 0 ) . encodeToString ( java.lang.String.format ( "%1$s:%2$s" , hostProvider.getUsername ( ) , hostProvider.getPassword ( ) ) . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ) . toString ( ) ) ; } }
Source:
public void testGetNonExitingKey ( ) throws java.lang.Exception { final java.lang.String key = "NonExistignKeyDB" ; org.ovirt.engine.core.config.entity.ConfigKey configKey = org.ovirt.engine.core.config.EngineConfigLogicTest.engineConfigLogic.fetchConfigKey ( key , null ) ; junit.framework.Assert.assertTrue ( ( ( configKey == null ) || ( ( configKey.getKey ( ) ) == null ) ) ) ; }

Target:
public void testGetNonExitingKey ( ) throws java.lang.Exception { final java.lang.String key = "NonExistignKeyDB" ; org.ovirt.engine.core.config.entity.ConfigKey configKey = org.ovirt.engine.core.config.EngineConfigLogicTest.engineConfigLogic.fetchConfigKey ( key , null ) ; org.junit.Assert.assertTrue ( ( ( configKey == null ) || ( ( configKey.getKey ( ) ) == null ) ) ) ; }
Source:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getParameters ( ) . getImagesParameters ( ) ) { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getBackend ( ) . endAction ( VdcActionType.CopyImageGroup , p , org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }

Target:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getParameters ( ) . getImagesParameters ( ) ) { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getBackend ( ) . endAction ( ActionType.CopyImageGroup , p , org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }
Source:
protected void onBind ( ) { super . onBind ( ) ; registerHandler ( getView ( ) . getAboutLink ( ) . addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.gwtplatform.mvp.client.proxy.RevealRootPopupContentEvent.fire ( org.ovirt.engine.ui.userportal.section.main.presenter.HeaderPresenterWidget.this , aboutPopup ) ; } } ) ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { org.ovirt.engine.ui.uicommonweb.models.OptionsModel model = optionsProvider.getModel ( ) ; model.executeCommand ( model.getEditCommand ( ) ) ; }
Source:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case noVM : org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase outEx = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.createDefaultConcreteException ( "Cancel migration has failed. Please try again in a few moments and track the VM's event log for details" ) ; initializeVdsError ( returnStatus ) ; outEx.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( org.ovirt.engine.core.common.errors.VdcBllErrors.MIGRATION_CANCEL_ERROR_NO_VM , org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getReturnStatus ( ) . mMessage ) ) ; throw outEx ; default : super . proceedProxyReturnValue ( ) ; } }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case noVM : org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase outEx = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.createDefaultConcreteException ( "Cancel migration has failed. Please try again in a few moments and track the VM's event log for details" ) ; initializeVdsError ( returnStatus ) ; outEx.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( org.ovirt.engine.core.common.errors.VdcBllErrors.MIGRATION_CANCEL_ERROR_NO_VM , org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getReturnStatus ( ) . mMessage ) ) ; throw outEx ; default : super . proceedProxyReturnValue ( ) ; } }
Source:
public void testAddLabelToNicAndValidateWhenUsingValidLabel ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; java.util.List < java.lang.Class < ? > > validationGroups = java.util.Arrays.< java.lang.Class < ? > > asList ( javax.validation.groups.Default.class , org.ovirt.engine.core.common.validation.group.UpdateEntity.class , org.ovirt.engine.core.common.validation.group.CreateEntity.class ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . addLabelToNicAndValidate ( "ok" , validationGroups ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testInterfaceByNameExistsWhenInterfacesNameIsNull ( ) throws java.lang.Exception { org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( createVdsNetworkInterfaceWithName ( null ) ) . interfaceByNameExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
private void mockIsValidVdsCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setReturnValue ( java.lang.Boolean.TRUE ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.IsValid ) , org.mockito.Matchers.< org.ovirt.engine.core.common.vdscommands.VDSParametersBase > any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( returnValue ) ; }

Target:
private void mockIsValidVdsCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setReturnValue ( java.lang.Boolean.TRUE ) ; org.mockito.Mockito.doReturn ( returnValue ) . when ( command ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.IsValid ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ; }
Source:
protected boolean IsValidExportDomain ( ) { org.ovirt.engine.core.common.businessentities.storage_domains domain = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDAO ( ) . getForStoragePool ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStoragePoolId ( ) ) ; if ( ( domain != null ) && ( ( domain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return true ; } return false ; }

Target:
protected boolean isValidExportDomain ( ) { org.ovirt.engine.core.common.businessentities.storage_domains domain = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDAO ( ) . getForStoragePool ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStoragePoolId ( ) ) ; if ( ( domain != null ) && ( ( domain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return true ; } return false ; }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosCommitmentNicSetup ( int totalCommitment , java.lang.Integer nicSpeed ) { return qosCommitmentSetup ( false , totalCommitment , null , nicSpeed , null ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
private void endInternalCommandWithFailure ( ) { org.ovirt.engine.core.common.action.ExtendImageSizeParameters params = createExtendImageSizeParameters ( ) ; params.setTaskGroupSuccess ( false ) ; org.ovirt.engine.core.bll.UpdateVmDiskCommand.getBackend ( ) . endAction ( VdcActionType.ExtendImageSize , params ) ; }

Target:
protected void endSuccessfully ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase ret = org.ovirt.engine.core.bll.UpdateVmDiskCommand.getBackend ( ) . endAction ( VdcActionType.ExtendImageSize , createExtendImageSizeParameters ( ) , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; if ( ret.getSucceeded ( ) ) { performDiskUpdate ( true ) ; } else { unlockImageInDb ( ) ; } org.ovirt.engine.core.bll.UpdateVmDiskCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; setSucceeded ( ret.getSucceeded ( ) ) ; }
Source:
private void logFailure ( ) { org.ovirt.engine.core.compat.Guid createdDiskId = ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.storage.ovfstore.CreateOvfVolumeForStorageDomainCommand.getActionReturnValue ( ) ) ) ; if ( createdDiskId != null ) { addCustomValue ( "DiskId" , createdDiskId.toString ( ) ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( this , AuditLogType.CREATE_OVF_STORE_FOR_STORAGE_DOMAIN_FAILED ) ; } else { new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( this , AuditLogType.CREATE_OVF_STORE_FOR_STORAGE_DOMAIN_INITIATE_FAILED ) ; } }

Target:
private void logFailure ( ) { org.ovirt.engine.core.compat.Guid createdDiskId = ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.storage.ovfstore.CreateOvfVolumeForStorageDomainCommand.getActionReturnValue ( ) ) ) ; if ( createdDiskId != null ) { addCustomValue ( "DiskId" , createdDiskId.toString ( ) ) ; auditLogDirector.log ( this , AuditLogType.CREATE_OVF_STORE_FOR_STORAGE_DOMAIN_FAILED ) ; } else { auditLogDirector.log ( this , AuditLogType.CREATE_OVF_STORE_FOR_STORAGE_DOMAIN_INITIATE_FAILED ) ; } }
Source:
protected long getEngineSessionSeqId ( ) { if ( ( engineContext.getSessionId ( ) ) == null ) { throw new java.lang.RuntimeException ( ( "No sessionId found for query " + ( getClass ( ) . getName ( ) ) ) ) ; } return org.ovirt.engine.core.bll.aaa.SessionDataContainer.getInstance ( ) . getEngineSessionSeqId ( engineContext.getSessionId ( ) ) ; }

Target:
protected long getEngineSessionSeqId ( ) { if ( ( engineContext.getSessionId ( ) ) == null ) { throw new java.lang.RuntimeException ( ( "No sessionId found for query " + ( getClass ( ) . getName ( ) ) ) ) ; } return getSessionDataContainer ( ) . getEngineSessionSeqId ( engineContext.getSessionId ( ) ) ; }
Source:
public void testWriteFileToStream ( ) throws java.io.IOException { java.io.File file = new java.io.File ( canReadFileName ) ; long hostSize = file.length ( ) ; org.junit.Assert.assertTrue ( "We should be able to read this file." , org.ovirt.engine.core.utils.servlet.ServletUtils.canReadFile ( file ) ) ; java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream ( 4096 ) ; org.ovirt.engine.core.utils.servlet.ServletUtils.writeFileToStream ( out , file ) ; org.junit.Assert.assertEquals ( "The bytes in the buffer have to match the length of the file" , ( ( int ) ( hostSize ) ) , out.size ( ) ) ; }

Target:
public void testWriteFileToStream ( ) throws java.io.IOException { java.io.File file = new java.io.File ( canReadFileName ) ; long hostSize = file.length ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( org.ovirt.engine.core.utils.servlet.ServletUtils.canReadFile ( file ) , "We should be able to read this file." ) ; java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream ( 4096 ) ; org.ovirt.engine.core.utils.servlet.ServletUtils.writeFileToStream ( out , file ) ; org.junit.jupiter.api.Assertions.assertEquals ( ( ( int ) ( hostSize ) ) , out.size ( ) , "The bytes in the buffer have to match the length of the file" ) ; }
Source:
public void hostAttachedToLocalStorageWithoutDataCenter ( ) { org.mockito.Mockito.when ( storagePoolDao.getForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( dbFacade.getStoragePoolDao ( ) ) . thenReturn ( storagePoolDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; org.junit.Assert.assertThat ( validator.validateSingleHostAttachedToLocalStorage ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void hostAttachedToLocalStorageWithoutDataCenter ( ) { org.mockito.Mockito.when ( storagePoolDao.getForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( dbFacade.getStoragePoolDao ( ) ) . thenReturn ( storagePoolDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; org.junit.Assert.assertThat ( validator.validateSingleHostAttachedToLocalStorage ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalDiscoveredHostsListModel = getExternalDiscoveredHosts ( ) ; externalDiscoveredHostsListModel.setItems ( hosts ) ; externalDiscoveredHostsListModel.setIsChangable ( true ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( java.lang.Boolean.TRUE.equals ( getIsDiscoveredHosts ( ) . getEntity ( ) ) ) { discoverHostName_SelectedItemChanged ( ) ; } else if ( java.lang.Boolean.FALSE.equals ( getIsDiscoveredHosts ( ) . getEntity ( ) ) ) { hostName_SelectedItemChanged ( ) ; } }
Source:
public void testExecuteCommandByClusterIdForStart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_START ) ) ) ; setUpMockUpForStart ( ) ; mockBackend ( true , null , GlusterServiceStatus.STOPPED ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.times ( 4 ) ) . update ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_STARTED ) ; }

Target:
public void testExecuteCommandByClusterIdForStart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_START ) ) ) ; setUpMockUpForStart ( ) ; mockBackend ( true , null , GlusterServiceStatus.STOPPED ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.times ( 4 ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_STARTED ) ; }
Source:
public void testDifferentClusters ( ) { org.ovirt.engine.core.common.businessentities.VmBase vmBase = createVmBase ( cpuProfile1.getId ( ) ) ; vmBase.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.ValidationResult res = cpuProfileHelper.setAndValidateCpuProfile ( vmBase , org.ovirt.engine.core.bll.profiles.CpuProfileHelperTest.USER_1_ID ) ; org.junit.Assert.assertThat ( res , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_CPU_PROFILE_NOT_MATCH_CLUSTER ) ) ; }

Target:
public void testDifferentClusters ( ) { org.ovirt.engine.core.common.businessentities.VmBase vmBase = createVmBase ( cpuProfile1.getId ( ) ) ; vmBase.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.ValidationResult res = cpuProfileHelper.setAndValidateCpuProfile ( vmBase , org.ovirt.engine.core.bll.profiles.CpuProfileHelperTest.USER_1_ID ) ; org.hamcrest.MatcherAssert.assertThat ( res , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_CPU_PROFILE_NOT_MATCH_CLUSTER ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createDefaultVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setcpu_name ( "Intel Conroe" ) ; group.setcompatibility_version ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.STORAGE_POOL_ID ) ; group.setArchitecture ( ArchitectureType.x86_64 ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createDefaultVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setCpuName ( "Intel Conroe" ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DC_ID1 ) ; group.setArchitecture ( ArchitectureType.x86_64 ) ; return group ; }
Source:
public java.lang.String getButtonToolTip ( ) { if ( ( ( ! ( getModel ( ) . isVmDown ( ) ) ) && ( getModel ( ) . isHotPlugAvailable ( ) ) ) && ( ! ( getModel ( ) . getIsDiskHotPlugSupported ( ) ) ) ) { return org.ovirt.engine.ui.common.widget.uicommon.vm.VmDiskListModelTable.constants.diskHotPlugNotSupported ( ) ; } else { return this . getText ( ) ; } }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( ) { java.lang.String tooltip = null ; if ( ( ( ! ( getModel ( ) . isVmDown ( ) ) ) && ( getModel ( ) . isHotPlugAvailable ( ) ) ) && ( ! ( getModel ( ) . getIsDiskHotPlugSupported ( ) ) ) ) { tooltip = org.ovirt.engine.ui.common.widget.uicommon.vm.VmDiskListModelTable.constants.diskHotPlugNotSupported ( ) ; } else { tooltip = this . getText ( ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( tooltip ) ; }
Source:
public static void addFileHandler ( java.lang.String fileName ) { try { java.util.logging.FileHandler fh = new java.util.logging.FileHandler ( fileName , true ) ; fh.setFormatter ( new java.util.logging.SimpleFormatter ( ) ) ; java.util.logging.Logger.getLogger ( "" ) . addHandler ( fh ) ; } catch ( java.lang.SecurityException | java.io.IOException ex ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Error accessing log file '%s': '%s'" , fileName , ex.getMessage ( ) ) , ex ) ; } }

Target:
public static void addFileHandler ( java.lang.String fileName ) { try { java.util.logging.FileHandler fh = new java.util.logging.FileHandler ( fileName , true ) ; fh.setFormatter ( new org.ovirt.engine.core.logutils.TimeZoneBasedFormatter ( ) ) ; java.util.logging.Logger.getLogger ( "" ) . addHandler ( fh ) ; } catch ( java.lang.SecurityException | java.io.IOException ex ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Error accessing log file '%s': '%s'" , fileName , ex.getMessage ( ) ) , ex ) ; } }
Source:
public void testFailInterfaceCanUpdateReadOnly ( ) { initializeCommand ( new org.ovirt.engine.core.common.action.VmDiskOperationParameterBase ( vmId , createDiskImage ( ) ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . updateReadOnlyRequested ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ) . when ( diskValidator ) . isReadOnlyPropertyCompatibleWithInterface ( ) ; org.junit.Assert.assertFalse ( command.validateCanUpdateReadOnly ( diskValidator ) ) ; }

Target:
public void testFailInterfaceCanUpdateReadOnly ( ) { initializeCommand ( new org.ovirt.engine.core.common.action.VmDiskOperationParameterBase ( new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( diskImageGuid , vmId ) , createDiskImage ( ) ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . updateReadOnlyRequested ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ) . when ( diskValidator ) . isReadOnlyPropertyCompatibleWithInterface ( ) ; org.junit.Assert.assertFalse ( command.validateCanUpdateReadOnly ( diskValidator ) ) ; }
Source:
public static java.lang.String getDefaultManagementNetworkName ( ) { return org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.DefaultManagementNetwork ) ; }

Target:
public static boolean qosConfiguredOnInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.network.Network network ) { if ( iface.isQosOverridden ( ) ) { return ( iface.getQos ( ) ) != null ; } else { return ( network != null ) && ( ( network.getQosId ( ) ) != null ) ; } }
Source:
private void MemSize_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.UpdateMinAllocatedMemory ( ) ; }

Target:
private void WatchdogModel_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "" . equals ( getWatchdogModel ( ) . getEntity ( ) ) ) { getWatchdogAction ( ) . setIsChangable ( false ) ; getWatchdogAction ( ) . setSelectedItem ( "" ) ; } else { getWatchdogAction ( ) . setIsChangable ( true ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.image_storage_domain_map mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.image_storage_domain_map entity = new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( ) ; entity.setimage_id ( getGuidDefaultEmpty ( rs , "image_id" ) ) ; entity.setstorage_domain_id ( getGuidDefaultEmpty ( rs , "storage_domain_id" ) ) ; entity.setQuotaId ( getGuid ( rs , "quota_id" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.image_storage_domain_map mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.image_storage_domain_map entity = new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( ) ; entity.setimage_id ( getGuidDefaultEmpty ( rs , "image_id" ) ) ; entity.setstorage_domain_id ( getGuidDefaultEmpty ( rs , "storage_domain_id" ) ) ; entity.setQuotaId ( getGuid ( rs , "quota_id" ) ) ; entity.setDiskProfileId ( getGuid ( rs , "disk_profile_id" ) ) ; return entity ; }
Source:
public void onSuccessDontTryNextAgent ( ) { mockExecutor ( agent1 , true ) ; mockCheckStatus ( "on" ) ; org.mockito.Mockito.when ( executor.fence ( org.mockito.Matchers.eq ( FenceActionType.START ) , org.mockito.Matchers.eq ( agent2 ) ) ) . thenThrow ( new java.lang.IllegalStateException ( ) ) ; command.executeCommand ( ) ; }

Target:
public void onSuccessReturnValueOk ( ) { mockExecutor ( true ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getSucceeded ( ) ) ; java.lang.Object commandReturnValue = command.getActionReturnValue ( ) ; org.junit.Assert.assertNotNull ( commandReturnValue ) ; org.junit.Assert.assertTrue ( ( commandReturnValue instanceof org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult commandReturnValueCasted = ( ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ) ( commandReturnValue ) ) ; org.junit.Assert.assertEquals ( Status.SUCCESS , commandReturnValueCasted.getStatus ( ) ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase RunUserAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( parameters.getHttpSessionId ( ) ) ) { return org.ovirt.engine.core.bll.Backend.NotAutorizedError ( ) ; } return RunAction ( actionType , parameters ) ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase notAllowedInPrepForMaintMode ( org.ovirt.engine.core.common.action.VdcActionType action ) { java.lang.Class < org.ovirt.engine.core.bll.CommandBase < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > > clazz = org.ovirt.engine.core.bll.CommandsFactory.getCommandClass ( action.name ( ) ) ; if ( clazz.isAnnotationPresent ( org.ovirt.engine.core.bll.DisableInPrepareMode.class ) ) { return getErrorCommandReturnValue ( VdcBllMessages.ENGINE_IS_RUNNING_IN_PREPARE_MODE ) ; } return null ; }
Source:
protected void setUpCommand ( ) { command = createCommand ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areTemplateImagesInStorageReady ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isMemorySizeLegal ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . verifyAddVM ( ) ; }

Target:
private void mockVds ( ) { mockGetStorageDomainList ( 100 , 100 ) ; mockGetImagesList ( ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics cloneVdsNetworkStatistics ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics instance ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics obj = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics ( ) ; org.ovirt.engine.ui.uicommonweb.Cloner.cloneNetworkStatisticss ( instance , obj ) ; obj.setVdsId ( instance.getVdsId ( ) ) ; return obj ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.FenceAgent > cloneAgents ( java.util.List < org.ovirt.engine.core.common.businessentities.FenceAgent > agents ) { if ( ( agents == null ) || ( agents.isEmpty ( ) ) ) { return null ; } else { java.util.List < org.ovirt.engine.core.common.businessentities.FenceAgent > clonedAgents = new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.FenceAgent > ( ) ; for ( org.ovirt.engine.core.common.businessentities.FenceAgent agent : agents ) { clonedAgents.add ( org.ovirt.engine.ui.uicommonweb.Cloner.cloneAgent ( agent ) ) ; } return clonedAgents ; } }
Source:
void localize ( ) { vCenterEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vCenter ( ) ) ; esxEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.esxi ( ) ) ; vmwareDatacenterEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vmwareDataCenter ( ) ) ; proxyHostEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.proxyHost ( ) ) ; verifySSLEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vmwareVerifyCredentials ( ) ) ; }

Target:
void localize ( ) { vCenterEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vCenter ( ) ) ; esxEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.esxi ( ) ) ; vmwareDatacenterEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vmwareDataCenter ( ) ) ; vmwareClusterEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vmwareCluster ( ) ) ; proxyHostEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.proxyHost ( ) ) ; verifySSLEditor.setLabel ( org.ovirt.engine.ui.webadmin.widget.provider.VmwarePropertiesWidget.constants.vmwareVerifyCredentials ( ) ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Template incoming , org.ovirt.engine.core.common.businessentities.VmTemplate entity ) { org.ovirt.engine.core.common.businessentities.VmTemplate updated = getMapper ( modelType , org.ovirt.engine.core.common.businessentities.VmTemplate.class ) . map ( incoming , entity ) ; updated.setUsbPolicy ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( incoming.getUsb ( ) , entity.getUsbPolicy ( ) , lookupCluster ( updated.getVdsGroupId ( ) ) ) ) ; return new org.ovirt.engine.core.common.action.UpdateVmTemplateParameters ( updated ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Template incoming , org.ovirt.engine.core.common.businessentities.VmTemplate entity ) { org.ovirt.engine.core.common.businessentities.VmTemplate updated = getMapper ( modelType , org.ovirt.engine.core.common.businessentities.VmTemplate.class ) . map ( incoming , entity ) ; updated.setUsbPolicy ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( incoming.getUsb ( ) , entity.getUsbPolicy ( ) , lookupCluster ( updated.getVdsGroupId ( ) ) ) ) ; return getMapper ( modelType , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class ) . map ( incoming , new org.ovirt.engine.core.common.action.UpdateVmTemplateParameters ( updated ) ) ; }
Source:
private void addPermission ( ) { if ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . isPublicUse ( ) ) { org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; perms.setad_element_id ( MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID ) ; perms.setObjectType ( VdcObjectType.VmTemplate ) ; perms.setObjectId ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getVmTemplateId ( ) ) ; perms.setrole_id ( PredefinedRoles.TEMPLATE_USER.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; } }

Target:
private void addPermissionForTempalte ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.bll.PredefinedRoles role ) { org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; perms.setad_element_id ( userId ) ; perms.setObjectType ( VdcObjectType.VmTemplate ) ; perms.setObjectId ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getVmTemplateId ( ) ) ; perms.setrole_id ( role.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; javax.ws.rs.core.Response performAction = null ; try { performAction = performAction ( VdcActionType.RemoveClusterPolicy , new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( asGuid ( id ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetClusterPolicyById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) . lookupEntity ( asGuid ( id ) ) ) ) ; } catch ( org.ovirt.engine.api.restapi.resource.BackendFailureException e ) { e.printStackTrace ( ) ; } return performAction ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; javax.ws.rs.core.Response performAction = null ; try { performAction = performAction ( VdcActionType.RemoveClusterPolicy , new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( asGuid ( id ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetClusterPolicyById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) . lookupEntity ( asGuid ( id ) ) ) ) ; } catch ( org.ovirt.engine.api.restapi.resource.BackendFailureException e ) { org.ovirt.engine.api.restapi.resource.BackendSchedulingPolicyResource.log.error ( "Failed performing action" , e ) ; } return performAction ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.ReportedDevice model , int index ) { org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.PARENT_ID.toString ( ) , model.getVm ( ) . getId ( ) ) ; verifyIps ( model ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.ReportedDevice model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.PARENT_ID.toString ( ) , model.getVm ( ) . getId ( ) ) ; verifyIps ( model ) ; verifyLinks ( model ) ; }
Source:
private void updateNumOfMonitors ( ) { if ( ( getDisplayType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) { getNumOfMonitors ( ) . setIsChangable ( true ) ; } else { getNumOfMonitors ( ) . setSelectedItem ( 1 ) ; getNumOfMonitors ( ) . setIsChangable ( false ) ; } }

Target:
private void updateNumOfMonitors ( ) { if ( ( getDisplayType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) { getNumOfMonitors ( ) . setIsChangeable ( true ) ; } else { getNumOfMonitors ( ) . setSelectedItem ( 1 ) ; getNumOfMonitors ( ) . setIsChangeable ( false ) ; } }
Source:
public void testAddLabelToNicAndValidateWhenUsingInvalidLabel ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . addLabelToNicAndValidate ( "☠☠uups!☠☠" , new java.util.ArrayList < java.lang.Class < ? > > ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.IMPROPER_INTERFACE_IS_LABELED ) ) ; }

Target:
public void testAddLabelToNicAndValidateWhenUsingInvalidLabel ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . addLabelToNicAndValidate ( "**uups!**" , new java.util.ArrayList < java.lang.Class < ? > > ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.IMPROPER_INTERFACE_IS_LABELED ) ) ; }