auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void networkBelongsToClusterDataCenterNotValid ( ) throws java.lang.Exception { org.mockito.Mockito.when ( cluster.getStoragePoolId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.TEST_DC_ID1 ) ; org.mockito.Mockito.when ( network.getDataCenterId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.TEST_DC_ID2 ) ; org.junit.Assert.assertThat ( validator.networkBelongsToClusterDataCenter ( cluster , network ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_FROM_DIFFERENT_DC ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.hasItem ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.NETWORK_NAME_REPLACEMENT ) ) ) ) ; }

Target:
public void networkBelongsToClusterDataCenterNotValid ( ) throws java.lang.Exception { org.mockito.Mockito.when ( cluster.getStoragePoolId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.TEST_DC_ID1 ) ; org.mockito.Mockito.when ( network.getDataCenterId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.TEST_DC_ID2 ) ; org.junit.Assert.assertThat ( validator.networkBelongsToClusterDataCenter ( cluster , network ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_FROM_DIFFERENT_DC ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.hasItem ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.NETWORK_NAME_REPLACEMENT ) ) ) ) ; }
Source:
public void rerun ( ) { org.ovirt.engine.core.bll.MigrateVmCommand.setVm ( null ) ; determineMigrationFailureForAuditLog ( ) ; if ( ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) { setVdsDestinationId ( null ) ; super . rerun ( ) ; } else { org.ovirt.engine.core.bll.MigrateVmCommand.runningFailed ( ) ; _isRerun = true ; } }

Target:
public void reportCompleted ( ) { try { super . reportCompleted ( ) ; } finally { if ( ( getDestinationVdsId ( ) ) != null ) { decreasePendingVms ( getDestinationVdsId ( ) ) ; } } }
Source:
public static void getDataCenterMaxNameLength ( 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 ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
private void handleFailure ( org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking , org.codehaus.jackson.JsonNode id ) { this . runningCalls.remove ( id ) ; removeRequestFromTracking ( id ) ; tracking.getCall ( ) . addResponse ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.buildFailedResponse ( tracking.getRequest ( ) ) ) ; tracking.getClient ( ) . disconnect ( ) ; }

Target:
private void handleFailure ( org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking , org.codehaus.jackson.JsonNode id ) { remove ( tracking , id , org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.buildFailedResponse ( tracking.getRequest ( ) ) ) ; tracking.getClient ( ) . disconnect ( "Vds timeout occured" ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean value = getNoClone ( ) . getEntity ( ) ; if ( value ) { getClone ( ) . setEntity ( false ) ; getName ( ) . setIsChangable ( false ) ; getSuffix ( ) . setIsChangable ( false ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean value = getNoClone ( ) . getEntity ( ) ; if ( value ) { getClone ( ) . setEntity ( false ) ; getName ( ) . setIsChangeable ( false ) ; getSuffix ( ) . setIsChangeable ( false ) ; } }
Source:
protected boolean validateInputManagementNetwork ( ) { if ( ! ( org.ovirt.engine.core.bll.AddClusterCommand.findInputManagementNetwork ( ) ) ) { return false ; } final org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase networkClusterValidator = createNetworkClusterValidator ( ) ; return ( ( validate ( networkClusterValidator.networkBelongsToClusterDataCenter ( org.ovirt.engine.core.bll.AddClusterCommand.getCluster ( ) , managementNetwork ) ) ) && ( validate ( networkClusterValidator.managementNetworkRequired ( managementNetwork ) ) ) ) && ( validate ( networkClusterValidator.managementNetworkNotExternal ( managementNetwork ) ) ) ; }

Target:
protected boolean validateInputManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase networkClusterValidator ) { return ( ( validate ( networkClusterValidator.networkBelongsToClusterDataCenter ( org.ovirt.engine.core.bll.AddClusterCommand.getCluster ( ) , org.ovirt.engine.core.bll.AddClusterCommand.getManagementNetwork ( ) ) ) ) && ( validate ( networkClusterValidator.managementNetworkRequired ( org.ovirt.engine.core.bll.AddClusterCommand.getManagementNetwork ( ) ) ) ) ) && ( validate ( networkClusterValidator.managementNetworkNotExternal ( org.ovirt.engine.core.bll.AddClusterCommand.getManagementNetwork ( ) ) ) ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.String > getExclusiveLocks ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = org.ovirt.engine.core.bll.AddVdsCommand.getVdsGroup ( ) ; if ( ( ( cluster != null ) && ( cluster.supportsGlusterService ( ) ) ) && ( ! ( org.ovirt.engine.core.bll.AddVdsCommand.isInternalExecution ( ) ) ) ) { return java.util.Collections.singletonMap ( cluster.getId ( ) . toString ( ) , LockingGroup.GLUSTER.name ( ) ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = org.ovirt.engine.core.bll.AddVdsCommand.getVdsGroup ( ) ; if ( ( ( cluster != null ) && ( cluster.supportsGlusterService ( ) ) ) && ( ! ( org.ovirt.engine.core.bll.AddVdsCommand.isInternalExecution ( ) ) ) ) { return java.util.Collections.singletonMap ( cluster.getId ( ) . toString ( ) , LockMessagesMatchUtil.GLUSTER ) ; } return null ; }
Source:
public void canDoActionSpaceValidationFails ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockMaxPciSlots ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
public void canDoActionSpaceValidationFails ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockMaxPciSlots ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; }
Source:
private void CancelMigration ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VmOperationParameterBase ( a.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.CancelMigrateVm , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
private void Pause ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.HibernateVmParameters ( a.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.HibernateVm , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getSnapshotDAO ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.StopVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "StopVmCommandBase::EndVmCommand: Vm is null - not performing full endAction" ) ; } org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }

Target:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.StopVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "StopVmCommandBase::EndVmCommand: Vm is null - not performing full endAction" ) ; } org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }
Source:
public static org.ovirt.engine.api.model.OsType map ( int type , java.lang.Class < org.ovirt.engine.api.model.OsType > incomingType ) { java.util.HashMap < java.lang.Integer , java.lang.String > osUniqueNames = org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) ; java.lang.String name = osUniqueNames.get ( type ) ; return org.ovirt.engine.api.model.OsType.valueOf ( org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . osNameUpperCasedAndUnderscored ( name ) ) ; }

Target:
public static int mapOsType ( java.lang.String type ) { if ( OsType.UNASSIGNED.name ( ) . equalsIgnoreCase ( type ) ) { type = OsType.OTHER.name ( ) ; } return org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getOsIdByUniqueName ( type ) ; }
Source:
private boolean managementNetworkModifiedCorrectly ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( ( ( iface.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) && ( vds.getHostName ( ) . matches ( ValidationUtils.IP_PATTERN ) ) ) { return org.apache.commons.lang.StringUtils.equals ( vds.getHostName ( ) , iface.getAddress ( ) ) ; } return true ; }

Target:
private boolean networkIpAddressWasSameAsHostnameAndChanged ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( ( iface.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingIface = getExistingIfaceByNetwork ( iface.getNetworkName ( ) ) ; if ( existingIface != null ) { java.lang.String oldAddress = existingIface.getAddress ( ) ; java.lang.String hostName = vds.getHostName ( ) ; return ( org.apache.commons.lang.StringUtils.equals ( oldAddress , hostName ) ) && ( ! ( org.apache.commons.lang.StringUtils.equals ( oldAddress , iface.getAddress ( ) ) ) ) ; } } return false ; }
Source:
public boolean storageDomainRemoved ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain ) { int numOfRemovedLuns = removeStorageDomainLuns ( storageDomain ) ; if ( numOfRemovedLuns > 0 ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . getAllForVolumeGroup ( storageDomain.getstorage ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : FilterConnectionsUsedByOthers ( list , storageDomain.getstorage ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getid ( ) ) ; } } return true ; }

Target:
public boolean storageDomainRemoved ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain ) { int numOfRemovedLuns = removeStorageDomainLuns ( storageDomain ) ; if ( numOfRemovedLuns > 0 ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . getAllForVolumeGroup ( storageDomain.getStorage ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : FilterConnectionsUsedByOthers ( list , storageDomain.getStorage ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getid ( ) ) ; } } return true ; }
Source:
protected void addStorageDomainStatusIllegalMessage ( ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; addCanDoActionMessageVariable ( "status" , getStorageDomainStatus ( ) ) ; }

Target:
protected void addStorageDomainStatusIllegalMessage ( ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = getStorageDomainStatus ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus sharedStatus = getStorageDomainSharedStatus ( ) ; java.lang.Object messageParameter = status ; if ( ( status == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Unknown ) ) && ( sharedStatus != null ) ) { messageParameter = sharedStatus ; } org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.addCanDoActionMessageVariable ( "status" , messageParameter ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel localStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( returnValue ) ) ; localStorageModel.getPath ( ) . setEntity ( connection.getconnection ( ) ) ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel prepareStorageForEdit ( org.ovirt.engine.core.common.businessentities.StorageDomain storage , org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model ) { final org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel storageTypeModel = getStorageModelByStorage ( storage ) ; storageTypeModel.setContainer ( model ) ; storageTypeModel.setRole ( storage.getStorageDomainType ( ) ) ; storageTypeModel.prepareForEdit ( storage ) ; return storageTypeModel ; }
Source:
public static void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm > externalVms = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm ( vm ) ) ; } this . externalVms.setItems ( externalVms ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { updateVms ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( returnValue ) ) ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > buildResponse ( javax.servlet.http.HttpServletRequest request , org.ovirt.engine.core.sso.utils.SsoSession ssoSession , java.lang.String clientId , java.lang.String clientSecret ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.Object > payload = buildResponse ( ssoSession ) ; if ( org.ovirt.engine.core.sso.utils.SsoUtils.scopeAsList ( ssoSession.getScope ( ) ) . contains ( SsoConstants.OPENID_SCOPE ) ) { payload.put ( "id_token" , org.ovirt.engine.core.sso.utils.SsoUtils.createJWT ( request , ssoSession , clientId , clientSecret ) ) ; } return payload ; }

Target:
protected void issueTokenForAuthCode ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.lang.String scope ) throws java.lang.Exception { java.lang.String [ ] clientIdAndSecret = org.ovirt.engine.core.sso.utils.SsoUtils.getClientIdClientSecret ( request ) ; org.ovirt.engine.core.sso.utils.SsoUtils.validateClientRequest ( request , clientIdAndSecret [ 0 ] , clientIdAndSecret [ 1 ] , scope , null ) ; org.ovirt.engine.core.sso.utils.SsoSession ssoSession = handleIssueTokenForAuthCode ( request , clientIdAndSecret [ 0 ] , scope ) ; org.ovirt.engine.core.sso.servlets.OAuthTokenServlet.log.debug ( "Sending json response" ) ; org.ovirt.engine.core.sso.utils.SsoUtils.sendJsonData ( response , buildResponse ( ssoSession ) ) ; }
Source:
public void testValidRemovedBondsWhenReferencedInterfaceBondViaInexistingId ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid idOfInexistingInterface = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedBonds ( idOfInexistingInterface ) ) . build ( ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_BOND_RECORDS_DOES_NOT_EXISTS ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getListVariableAssignmentString ( engineMessage , java.util.Collections.singletonList ( idOfInexistingInterface ) ) ) ) ; }

Target:
public void testValidRemovedBondsWhenReferencedInterfaceBondViaInexistingId ( ) { org.ovirt.engine.core.compat.Guid idOfInexistingInterface = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedBonds ( idOfInexistingInterface ) ) . build ( ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_BOND_RECORDS_DOES_NOT_EXISTS ; org.hamcrest.MatcherAssert.assertThat ( validator.validRemovedBonds ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getListVariableAssignmentString ( engineMessage , java.util.Collections.singletonList ( idOfInexistingInterface ) ) ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setIsFingerprintVerified ( false ) ; if ( ( ( getGlusterHostAddress ( ) . getEntity ( ) ) == null ) || ( ( ( ( java.lang.String ) ( getGlusterHostAddress ( ) . getEntity ( ) ) ) . trim ( ) . length ( ) ) == 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( "" ) ; return ; } fetchFingerprint ( ( ( java.lang.String ) ( getGlusterHostAddress ( ) . getEntity ( ) ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.Boolean entity = getAllowOverbooking ( ) . getEntity ( ) ; if ( entity ) { getOptimizeForUtilization ( ) . setEntity ( true ) ; } getOptimizeForSpeed ( ) . setIsChangable ( ( ! entity ) ) ; }
Source:
private void externalHostGroups_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.ExternalHostGroup dhg = ( ( org.ovirt.engine.core.common.businessentities.ExternalHostGroup ) ( getExternalHostGroups ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; if ( dhg != null ) { vds.setVdsName ( getName ( ) . getEntity ( ) ) ; vds.setHostName ( ( ( ( getName ( ) . getEntity ( ) ) + "." ) + ( dhg.getDomainName ( ) ) ) ) ; } updateModelFromVds ( vds , null , false , null ) ; }

Target:
protected void updateProvisionedHosts ( ) { updateDiscoveredHostList ( getProviderSearchFilter ( ) . getEntity ( ) ) ; }
Source:
public void init ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostNicModel model ) { if ( ( model.getVfsConfigModel ( ) ) != ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostNicModel.EMPTY_VFS_CONFIG_MODEL ) ) { if ( ( model.getInterface ( ) . getBondName ( ) ) == null ) { getView ( ) . showTabs ( ) ; } else { getView ( ) . showOnlyVfsConfig ( ) ; } } else { getView ( ) . showOnlyPf ( ) ; } super . init ( model ) ; }

Target:
public void init ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostNicModel model ) { if ( model.hasVfsConfig ( ) ) { if ( model.hasLabels ( ) ) { getView ( ) . showTabs ( ) ; } else { getView ( ) . showOnlyVfsConfig ( ) ; } } else { getView ( ) . showOnlyPf ( ) ; } super . init ( model ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.Snapshot.name ( ) . toLowerCase ( ) , getParameters ( ) . getDescription ( ) ) ; } return jobProperties ; }

Target:
public void init ( ) { org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getParameters ( ) . setUseCinderCommandCallback ( isCinderDisksExist ( ) ) ; }
Source:
protected void updateDiskProfile ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { if ( isDiskImage ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) ; if ( ! ( java.util.Objects.equals ( oldDisk.getDiskProfileId ( ) , diskImage.getDiskProfileId ( ) ) ) ) { org.ovirt.engine.core.bll.UpdateVmDiskCommand.getImageStorageDomainMapDao ( ) . updateDiskProfileForImageAndSnapshots ( diskImage.getId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getDiskProfileIds ( ) . get ( 0 ) ) ; } } }

Target:
protected boolean setAndValidateDiskProfiles ( ) { if ( isDiskImage ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getNewDisk ( ) ) ) ; java.util.Map < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) . getcompatibility_version ( ) ) ) ; } return true ; }
Source:
public void testEvalDifferentName ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockOtherIface.getName ( ) ) . thenReturn ( ( "not" + ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_NAME ) ) ) ; org.mockito.Mockito.when ( mockOtherIface.getAddress ( ) ) . thenReturn ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_ADDRESS ) ; org.junit.Assert.assertFalse ( underTest.eval ( mockOtherIface ) ) ; }

Target:
public void testEvalDifferentName ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockOtherIface.getName ( ) ) . thenReturn ( ( "not" + ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_NAME ) ) ) ; org.mockito.Mockito.when ( mockOtherIface.getAddress ( ) ) . thenReturn ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_ADDRESS ) ; org.junit.Assert.assertFalse ( underTest.test ( mockOtherIface ) ) ; }
Source:
protected org.ovirt.engine.api.model.VmPool deprecatedPopulate ( org.ovirt.engine.api.model.VmPool model , org.ovirt.engine.core.common.businessentities.vm_pools entity ) { if ( ( model.isSetSize ( ) ) && ( ( model.getSize ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , SearchType.VM , ( "Vms: pool=" + ( model.getName ( ) ) ) ) ; model.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; model.getTemplate ( ) . setId ( vm.getVmtGuid ( ) . toString ( ) ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.VmPool deprecatedPopulate ( org.ovirt.engine.api.model.VmPool model , org.ovirt.engine.core.common.businessentities.vm_pools entity ) { if ( ( model.isSetSize ( ) ) && ( ( model.getSize ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.VM vm = getVM ( model ) ; model.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; model.getTemplate ( ) . setId ( vm.getVmtGuid ( ) . toString ( ) ) ; } return model ; }
Source:
public void isConnWithSameDetailsExistCheckSameConn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; connections.add ( newISCSIConnection ) ; org.mockito.Mockito.when ( storageConnDao.getAllForConnection ( newISCSIConnection ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }

Target:
public void isConnWithSameDetailsExistCheckSameConn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; org.mockito.Mockito.when ( command.findConnectionWithSameDetails ( newISCSIConnection ) ) . thenReturn ( newISCSIConnection ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }
Source:
protected org.ovirt.engine.core.bll.snapshots.SnapshotsValidator getSnapshotsValidator ( ) { return new org.ovirt.engine.core.bll.snapshots.SnapshotsValidator ( ) ; }

Target:
private java.util.Map < org.ovirt.engine.core.common.businessentities.VmDevice , java.lang.Integer > vmDeviceUnitMapForController ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.Integer , java.util.Map < org.ovirt.engine.core.common.businessentities.VmDevice , java.lang.Integer > > vmDeviceUnitMap ) { int numOfDisks = org.ovirt.engine.core.bll.storage.disk.AbstractDiskVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) . size ( ) ; int controllerId = vmInfoBuildUtils.getControllerForScsiDisk ( vmDevice , org.ovirt.engine.core.bll.storage.disk.AbstractDiskVmCommand.getVm ( ) , numOfDisks ) ; if ( ! ( vmDeviceUnitMap.containsKey ( controllerId ) ) ) { return new java.util.HashMap < > ( ) ; } return vmDeviceUnitMap.get ( controllerId ) ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { java.util.Map < org.ovirt.engine.core.common.businessentities.storage.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getVm ( ) . getImages ( ) ) { map.put ( diskImage , org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getStorageDomainId ( ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getCurrentUser ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { java.util.Map < org.ovirt.engine.core.common.businessentities.storage.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getVm ( ) . getImages ( ) ) { map.put ( diskImage , org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getStorageDomainId ( ) ) ; } return validate ( diskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getCurrentUser ( ) ) ) ; }
Source:
public void initTable ( ) { org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . enableColumnResizing ( ) ; addTypeColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addUserColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addAuthzColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addNameSpaceColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addRoleColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addCreationDateColum ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addAddPermissionsButton ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addRemovePermissionsButton ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; }

Target:
private void addRoleColumn ( ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Permission > roleColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Permission > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Permission object ) { return object.getRoleName ( ) ; } } ; roleColumn.makeSortable ( ) ; org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addColumn ( roleColumn , org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants.rolePermission ( ) , "300px" ) ; }
Source:
public static 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.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.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.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void IsLiveStorageMigrationEnabled ( 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 params = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.LiveStorageMigrationEnabled ) ; params.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( params , aQuery ) ; }
Source:
public void vmNameNullVm ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setVmName ( null ) ; final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; v.setVmName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVm ( v ) ; final java.lang.String n = b.getVmName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }

Target:
public void vmNameNullVm ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setVmName ( null ) ; final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; v.setName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVm ( v ) ; final java.lang.String n = b.getVmName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }
Source:
protected void setUpFormatDomain ( boolean shouldFail ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue ret = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; ret.setSucceeded ( ( ! shouldFail ) ) ; org.mockito.Mockito.doReturn ( ret ) . when ( command ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.FormatStorageDomain ) , org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
protected void setUpFormatDomain ( boolean shouldFail ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue ret = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; ret.setSucceeded ( ( ! shouldFail ) ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.FormatStorageDomain ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( ret ) ; }
Source:
private void testConnectionMountOptionsValidations ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String mountOptions , boolean shouldSucceed ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createConnection ( storageType , mountOptions ) ; params.setStorageServerConnection ( newPosixConnection ) ; org.ovirt.engine.core.bll.ValidationResult result = command.validateMountOptions ( ) ; if ( shouldSucceed ) { org.junit.Assert.assertTrue ( result.isValid ( ) ) ; } else { org.junit.Assert.assertThat ( result , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ) ; } }

Target:
private void testConnectionMountOptionsValidations ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String mountOptions , boolean shouldSucceed ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createConnection ( storageType , mountOptions ) ; params.setStorageServerConnection ( newPosixConnection ) ; org.ovirt.engine.core.bll.ValidationResult result = command.validateMountOptions ( ) ; if ( shouldSucceed ) { org.junit.Assert.assertTrue ( result.isValid ( ) ) ; } else { org.junit.Assert.assertThat ( result , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ) ; } }
Source:
protected boolean setAndValidateCpuProfile ( ) { if ( ( isInstanceType ( ) ) || ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.isBlankTemplate ( ) ) ) { return true ; } return validate ( cpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getUserId ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { if ( ( isInstanceType ( ) ) || ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.isBlankTemplate ( ) ) ) { return true ; } return validate ( cpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getUserIdIfExternal ( ) ) ) ; }
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 ( ) { super . 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:
private void UpdateActionAvailability ( ) { java.util.ArrayList items = ( ( ( java.util.ArrayList ) ( getSelectedItems ( ) ) ) != null ) ? ( ( java.util.ArrayList ) ( getSelectedItems ( ) ) ) : new java.util.ArrayList ( ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( items.size ( ) ) > 0 ) && ( org.ovirt.engine.core.common.VdcActionUtils.CanExecute ( items , org.ovirt.engine.core.common.businessentities.DbUser.class , VdcActionType.RemoveUser ) ) ) ) ; getAssignTagsCommand ( ) . setIsExecutionAllowed ( ( ( items.size ( ) ) > 0 ) ) ; }

Target:
private void updateActionAvailability ( ) { java.util.ArrayList items = ( ( ( java.util.ArrayList ) ( getSelectedItems ( ) ) ) != null ) ? ( ( java.util.ArrayList ) ( getSelectedItems ( ) ) ) : new java.util.ArrayList ( ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( items.size ( ) ) > 0 ) && ( org.ovirt.engine.core.common.VdcActionUtils.CanExecute ( items , org.ovirt.engine.core.common.businessentities.DbUser.class , VdcActionType.RemoveUser ) ) ) ) ; getAssignTagsCommand ( ) . setIsExecutionAllowed ( ( ( items.size ( ) ) > 0 ) ) ; }
Source:
private static void initDisplayTypes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.displayTypes = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDisplayTypes ) , callback ) ; }

Target:
public void initWindowsOsTypes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { windowsOsIds = ( ( java.util.ArrayList < java.lang.Integer > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetWindowsOss ) , callback ) ; }