auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getView ( ) . flush ( ) ; getView ( ) . getTestButton ( ) . getCommand ( ) . Execute ( ) ; }

Target:
private void addPowerManagementListener ( final org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model ) { model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( ! ( "IsPowerManagementTabSelected" . equals ( propName ) ) ) { return ; } if ( model.getIsPowerManagementTabSelected ( ) ) { getView ( ) . showPowerManagement ( ) ; } } } ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.Map < java.lang.String , java.lang.String > glusterServers = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.common.businessentities.VDS upServer = getClusterUtils ( ) . getUpServer ( org.ovirt.engine.core.bll.gluster.GetAddedGlusterServersQuery.getParameters ( ) . getClusterId ( ) ) ; if ( upServer != null ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.GlusterServersList , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( upServer.getId ( ) ) ) ; glusterServers = getAddedGlusterServers ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > ) ( returnValue.getReturnValue ( ) ) ) ) ; } org.ovirt.engine.core.bll.gluster.GetAddedGlusterServersQuery.getQueryReturnValue ( ) . setReturnValue ( glusterServers ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.Map < java.lang.String , java.lang.String > glusterServers = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.common.businessentities.VDS upServer = getGlusterUtils ( ) . getUpServer ( org.ovirt.engine.core.bll.gluster.GetAddedGlusterServersQuery.getParameters ( ) . getClusterId ( ) ) ; if ( upServer != null ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.GlusterServersList , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( upServer.getId ( ) ) ) ; glusterServers = getAddedGlusterServers ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > ) ( returnValue.getReturnValue ( ) ) ) ) ; } org.ovirt.engine.core.bll.gluster.GetAddedGlusterServersQuery.getQueryReturnValue ( ) . setReturnValue ( glusterServers ) ; }
Source:
private void initTabAvailabilityListeners ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel pool ) { pool.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "IsPoolTabValid" . equals ( propName ) ) { poolTab.markAsInvalid ( null ) ; } } } ) ; poolTab.setVisible ( true ) ; }

Target:
private void initTabAvailabilityListeners ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel pool ) { pool.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "IsPoolTabValid" . equals ( propName ) ) { poolTab.markAsInvalid ( null ) ; } } } ) ; poolTab.setVisible ( true ) ; }
Source:
public void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getAAAProfilesEntriesList ( 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.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private void OnApproveInternal ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.ApproveVds , new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.action.VdcActionParametersBase [ ] { new org.ovirt.engine.core.common.action.ApproveVdsParameters ( vds.getId ( ) ) } ) ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
private void onApproveInternal ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.ApproveVds , new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.action.VdcActionParametersBase [ ] { new org.ovirt.engine.core.common.action.ApproveVdsParameters ( vds.getId ( ) ) } ) ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getView ( ) . flush ( ) ; getView ( ) . getTestButton ( ) . getCommand ( ) . execute ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( "IsCiscoUcsPrimaryPmTypeSelected" . equals ( propName ) ) { getView ( ) . updatePrimaryPmSlotLabelText ( model.isCiscoUcsPrimaryPmTypeSelected ( ) ) ; } else if ( "IsCiscoUcsSecondaryPmTypeSelected" . equals ( propName ) ) { getView ( ) . updateSecondaryPmSlotLabelText ( model.isCiscoUcsSecondaryPmTypeSelected ( ) ) ; } }
Source:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getSucceeded ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.AttachStorageDomainToPool , new org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters ( org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getStorageDomain ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getStoragePool ( ) . getId ( ) ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getReturnValue ( ) . setFault ( returnValue.getFault ( ) ) ; } } }

Target:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getSucceeded ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( ActionType.AttachStorageDomainToPool , new org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters ( org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getStorageDomain ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getStoragePool ( ) . getId ( ) ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getReturnValue ( ) . setFault ( returnValue.getFault ( ) ) ; } } }
Source:
public static java.lang.String getRandomNumWithHighValue ( int min , int high ) { java.lang.String HighValue ; int Low = 1 ; if ( min > 1 ) { Low = min ; } int High = high ; HighValue = java.lang.String.valueOf ( ( ( org.ovirt.vdsmfake.Utils.RND.nextInt ( ( High - Low ) ) ) + Low ) ) ; return HighValue ; }

Target:
public static java.lang.String rangeParsser ( java.util.ArrayList a ) { return java.lang.String.valueOf ( ( ( org.ovirt.vdsmfake.Utils.RND.nextInt ( ( ( java.lang.Integer.valueOf ( a.get ( 1 ) . toString ( ) ) ) - ( java.lang.Integer.valueOf ( a.get ( 0 ) . toString ( ) ) ) ) ) ) + ( java.lang.Integer.valueOf ( a.get ( 0 ) . toString ( ) ) ) ) ) ; }
Source:
public void testGetEntityNameByIdAndTypeForHost ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic vds = dbFacade.getVdsStaticDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VDS_ID ) ; org.junit.Assert.assertNotNull ( vds ) ; java.lang.String name = vds.getvds_name ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VDS_ID , VdcObjectType.VDS ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForHost ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic vds = dbFacade.getVdsStaticDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VDS_ID ) ; org.junit.Assert.assertNotNull ( vds ) ; java.lang.String name = vds.getVdsName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VDS_ID , VdcObjectType.VDS ) ) ) ; }
Source:
public void testComplexCommand ( ) { java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . privateKey ( java.nio.file.Paths.get ( "/mykey" ) ) . inventoryFile ( java.nio.file.Paths.get ( "/myinventory" ) ) . limit ( "mylimit" ) . verboseLevel ( AnsibleVerbosity.LEVEL3 ) . variables ( new org.ovirt.engine.core.common.utils.Pair ( "a" , "1" ) , new org.ovirt.engine.core.common.utils.Pair ( "b" , "2" ) ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.Assert.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , "-vvv" , "--private-key=/mykey" , "--inventory=/myinventory" , "--limit=mylimit" , "--extra-vars=a=1" , "--extra-vars=b=2" , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }

Target:
public void testComplexCommand ( ) { java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . privateKey ( java.nio.file.Paths.get ( "/mykey" ) ) . inventoryFile ( java.nio.file.Paths.get ( "/myinventory" ) ) . limit ( "mylimit" ) . verboseLevel ( AnsibleVerbosity.LEVEL3 ) . variables ( new org.ovirt.engine.core.common.utils.Pair ( "a" , "1" ) , new org.ovirt.engine.core.common.utils.Pair ( "b" , "2" ) ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.Assert.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.IGNORE_SSH_CONFIG , "-vvv" , "--private-key=/mykey" , "--inventory=/myinventory" , "--limit=mylimit" , "--extra-vars=a=1" , "--extra-vars=b=2" , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }
Source:
protected void enterPressed ( ) { super . enterPressed ( ) ; getContentWidget ( ) . setText ( ( ( getContentWidget ( ) . getText ( ) ) + '\n' ) ) ; }

Target:
protected void enterPressed ( ) { super . enterPressed ( ) ; int pos = getContentWidget ( ) . getCursorPos ( ) ; getContentWidget ( ) . setText ( ( ( ( getContentWidget ( ) . getText ( ) . substring ( 0 , pos ) ) + '\n' ) + ( getContentWidget ( ) . getText ( ) . substring ( pos ) ) ) ) ; getContentWidget ( ) . setCursorPos ( ( pos + 1 ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getExternalVmFromOva ( java.lang.String ovaPath ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getExternalVmFromOva" ) . withParameter ( "ova_path" , ovaPath ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc getExternalVmFromOva ( java.lang.String ovaPath ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getExternalVmFromOva" ) . withParameter ( "ova_path" , ovaPath ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( response ) ; }
Source:
private boolean shouldOverrideSoundDevice ( ) { return ( ( ( ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isSoundDeviceEnabled ( ) ) == null ) && ( ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) ) != null ) ) && ( isSoundDeviceEnabled ( ) ) ) && ( ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getVmType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) ; }

Target:
private boolean checkCreateInstancePermission ( org.ovirt.engine.core.bll.utils.PermissionSubject permSubject ) { final java.util.List < org.ovirt.engine.core.common.VdcObjectType > overriddenPermissionObjectTypes = java.util.Arrays.asList ( VdcObjectType.VdsGroups , VdcObjectType.VmTemplate ) ; final boolean instanceCreateObjectType = overriddenPermissionObjectTypes.contains ( permSubject.getObjectType ( ) ) ; if ( ! instanceCreateObjectType ) { return false ; } final org.ovirt.engine.core.bll.utils.PermissionSubject alteredPermissionSubject = new org.ovirt.engine.core.bll.utils.PermissionSubject ( permSubject.getObjectId ( ) , permSubject.getObjectType ( ) , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_INSTANCE , permSubject.getMessage ( ) ) ; return checkSinglePermission ( alteredPermissionSubject , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
public boolean isFenceAgentVersionCompatible ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent , java.lang.String clusterCompatibilityVersion , java.util.List < java.lang.String > messages ) { if ( ! ( org.ovirt.engine.core.compat.Regex.IsMatch ( org.ovirt.engine.core.utils.pm.FenceConfigHelper.getFenceConfigurationValue ( ConfigValues.VdsFenceType.name ( ) , clusterCompatibilityVersion ) , java.lang.String.format ( "(,|^)%1$s(,|$)" , agent.getType ( ) ) ) ) ) { messages.add ( VdcBllMessages.ACTION_TYPE_FAILED_AGENT_NOT_SUPPORTED.name ( ) ) ; return false ; } else { return true ; } }

Target:
public boolean isFenceAgentVersionCompatible ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent , java.lang.String clusterCompatibilityVersion , java.util.List < java.lang.String > messages ) { if ( ! ( org.ovirt.engine.core.compat.Regex.IsMatch ( org.ovirt.engine.core.utils.pm.FenceConfigHelper.getFenceConfigurationValue ( ConfigValues.VdsFenceType.name ( ) , clusterCompatibilityVersion ) , java.lang.String.format ( "(,|^)%1$s(,|$)" , agent.getType ( ) ) ) ) ) { messages.add ( EngineMessage.ACTION_TYPE_FAILED_AGENT_NOT_SUPPORTED.name ( ) ) ; return false ; } else { return true ; } }
Source:
public static void getStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void setFocus ( boolean focused ) { asSuggestBox ( ) . setFocus ( focused ) ; }

Target:
public void setAcceptableValues ( java.util.Collection < java.lang.Object > values ) { java.util.Collection < java.lang.String > stringValues = org.ovirt.engine.ui.uicommonweb.Linq.cast ( values ) ; com.google.gwt.user.client.ui.MultiWordSuggestOracle suggestOracle = ( ( com.google.gwt.user.client.ui.MultiWordSuggestOracle ) ( asSuggestBox ( ) . getSuggestOracle ( ) ) ) ; suggestOracle.clear ( ) ; suggestOracle.addAll ( stringValues ) ; suggestOracle.setDefaultSuggestionsFromText ( stringValues ) ; }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct ) ; adjustDisplayIp ( vmDynamic.getGraphicsInfos ( ) ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmLunDisksData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getVdsmCallTimestamp ( xmlRpcStruct ) ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct , org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmLunDisksData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getVdsmCallTimestamp ( xmlRpcStruct ) ) ; }
Source:
public java.lang.String toString ( ) { return new java.lang.StringBuilder ( "DestroyImageParameters{" ) . append ( super . toString ( ) ) . append ( ", vmId=" ) . append ( vmId ) . append ( ", imageGroupId=" ) . append ( imageGroupId ) . append ( ", imageList=" ) . append ( imageList ) . append ( ", postZero=" ) . append ( postZero ) . append ( ", force=" ) . append ( force ) . append ( '}' ) . toString ( ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "vmId" , vmId ) . append ( "imageGroupId" , imageGroupId ) . append ( "imageList" , imageList ) . append ( "postZero" , postZero ) . append ( "force" , force ) ; }
Source:
public static void cancelAllTimers ( ) { for ( java.lang.String name : org.ovirt.engine.ui.common.uicommon.TimerFactory.timerList.keySet ( ) ) { org.ovirt.engine.ui.common.uicommon.TimerFactory.logger.fine ( ( ( "Cancelling the timer '" + name ) + "'" ) ) ; org.ovirt.engine.ui.common.uicommon.TimerFactory.timerList.get ( name ) . cancel ( ) ; } }

Target:
public static void cancelAllTimers ( ) { for ( java.util.Map.Entry < java.lang.String , com.google.gwt.user.client.Timer > stringTimerEntry : org.ovirt.engine.ui.common.uicommon.TimerFactory.timerList.entrySet ( ) ) { org.ovirt.engine.ui.common.uicommon.TimerFactory.logger.fine ( ( ( "Cancelling the timer '" + ( stringTimerEntry.getKey ( ) ) ) + "'" ) ) ; stringTimerEntry.getValue ( ) . cancel ( ) ; } }
Source:
public void testImportVMFromConfigurationWhenStorageDomainIsInactive ( ) { initCommand ( getOvfEntityData ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = createStorageDomain ( ) ; storageDomain.setStatus ( StorageDomainStatus.Inactive ) ; org.mockito.Mockito.doReturn ( storageDomain ) . when ( cmd ) . getStorageDomain ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; }

Target:
public void testImportVMFromConfigurationWhenStorageDomainIsInactive ( ) { initCommand ( getOvfEntityData ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = createStorageDomain ( ) ; storageDomain.setStatus ( StorageDomainStatus.Inactive ) ; final org.ovirt.engine.core.dao.StorageDomainDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDAO.class ) ; org.mockito.Mockito.doReturn ( dao ) . when ( cmd ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.when ( dao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotDelete ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotDelete ( volumeName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterVolumeSnapshotList ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotList ( ( volumeName == null ? "" : volumeName ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.aaa.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) , org.ovirt.engine.api.restapi.resource.aaa.BACKEND_FAILED_SERVER_LOCALE , t ) ; }
Source:
private void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.NFS , true ) ; setUpGetConnectionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachStorageDomainFromPool , org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.NFS , true ) ; setUpGetConnectionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachStorageDomainFromPool , org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult canDisableVirtioScsi ( java.util.Collection < ? extends org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks ) { if ( vmDisks == null ) { vmDisks = getDiskDao ( ) . getAllForVm ( vm.getId ( ) , true ) ; } boolean isVirtioScsiDiskExist = vmDisks.stream ( ) . anyMatch ( ( d ) -> ( d.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO_SCSI ) ) ; if ( isVirtioScsiDiskExist ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult canDisableVirtioScsi ( java.util.Collection < ? extends org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks ) { if ( vmDisks == null ) { vmDisks = getDiskDao ( ) . getAllForVm ( vm.getId ( ) , true ) ; } boolean isVirtioScsiDiskExist = vmDisks.stream ( ) . anyMatch ( ( d ) -> ( d.getDiskVmElementForVm ( vm.getId ( ) ) . getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO_SCSI ) ) ; if ( isVirtioScsiDiskExist ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected boolean validateCanUpdateReadOnly ( org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator ) { if ( updateReadOnlyRequested ( ) ) { if ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) && ( vmDeviceForVm.getIsPlugged ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return validate ( diskValidator.isReadOnlyPropertyCompatibleWithInterface ( ) ) ; } return true ; }

Target:
protected boolean validateCanUpdateReadOnly ( org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator ) { if ( updateReadOnlyRequested ( ) ) { if ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) && ( vmDeviceForVm.getIsPlugged ( ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return validate ( diskValidator.isReadOnlyPropertyCompatibleWithInterface ( ) ) ; } return true ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc desktopLock ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.desktopLock ( vmId ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterHooksListReturnForXmlRpc glusterHooksList ( ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHooksList ( ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterHooksListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterHooksListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static void GetHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public void remove ( ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveProvider , new org.ovirt.engine.core.common.action.ProviderParameters ( ( ( org.ovirt.engine.core.common.businessentities.Provider ) ( getSelectedItem ( ) ) ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { getSearchCommand ( ) . Execute ( ) ; } } ) ; }

Target:
private void remove ( ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveProvider , new org.ovirt.engine.core.common.action.ProviderParameters ( ( ( org.ovirt.engine.core.common.businessentities.Provider ) ( getSelectedItem ( ) ) ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { getSearchCommand ( ) . execute ( ) ; } } ) ; }
Source:
public void testValidRemovedBondsWhenNotRemovingAnyBond ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Bond > emptyList ( ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , params , null , null , null ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testValidRemovedBondsWhenNotRemovingAnyBond ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.compat.Guid > emptySet ( ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( params , null ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , null , false , false ) ; }

Target:
public void testNetworksUniquelyConfiguredOnHostWhenNotUniquelyConfigured ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.Network networkA = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; networkA.setId ( id ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( networkA ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachmentReferencingSameNetwork = createNetworkAttachment ( networkA ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( java.util.Collections.singletonList ( networkA ) ) ; org.junit.Assert.assertThat ( validator.networksUniquelyConfiguredOnHost ( java.util.Arrays.asList ( networkAttachment , networkAttachmentReferencingSameNetwork ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORKS_ALREADY_ATTACHED_TO_IFACES ) ) ; }
Source:
private static int getNumOfMonitors ( org.ovirt.engine.core.common.businessentities.VM vm ) { int maxMonitorsSpice = ( vm.getSingleQxlPci ( ) ) ? org.ovirt.engine.core.bll.utils.VmDeviceUtils.SINGLE_QXL_MONITORS : vm.getNumOfMonitors ( ) ; int maxMonitorsVnc = java.lang.Math.max ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.VNC_MIN_MONITORS , vm.getNumOfMonitors ( ) ) ; return java.lang.Math.min ( maxMonitorsSpice , maxMonitorsVnc ) ; }

Target:
private static int getNeededNumberOfVideoDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { int maxMonitorsSpice = ( vmBase.getSingleQxlPci ( ) ) ? org.ovirt.engine.core.bll.utils.VmDeviceUtils.SINGLE_QXL_MONITORS : vmBase.getNumOfMonitors ( ) ; int maxMonitorsVnc = java.lang.Math.max ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.VNC_MIN_MONITORS , vmBase.getNumOfMonitors ( ) ) ; return java.lang.Math.min ( maxMonitorsSpice , maxMonitorsVnc ) ; }
Source:
protected void itemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . itemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Storage ) ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storage = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.StoragePredicate ( storage.getId ( ) ) ) ) ; } }

Target:
protected void itemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . itemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Storage ) ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storage = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.StoragePredicate ( storage.getId ( ) ) ) ) ; } }
Source:
public void lunDiskInvalid ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createVds ( ) ; setupForLun ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( luns ) . when ( lunValidator ) . executeGetDeviceList ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.StorageType.class ) ) ; org.junit.Assert.assertThat ( lunValidator.isLunDiskVisible ( lunDisk.getLun ( ) , vds ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_INVALID ) ) ; }

Target:
public void lunDiskInvalid ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createVds ( ) ; setupForLun ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( luns ) . when ( lunValidator ) . executeGetDeviceList ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.StorageType.class ) ) ; org.junit.Assert.assertThat ( lunValidator.isLunDiskVisible ( lunDisk.getLun ( ) , vds ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISK_LUN_INVALID ) ) ; }
Source:
public void getAllErrata ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Erratum > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetErrataForSystem , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
private void createAndRunThreadsForRunner ( java.lang.Runnable runnable , int numOfThreads ) throws java.lang.Exception { if ( runnable == null ) { return ; } latch = new java.util.concurrent.CountDownLatch ( numOfThreads ) ; java.util.concurrent.ExecutorService threadPool = java.util.concurrent.Executors.newFixedThreadPool ( numOfThreads ) ; for ( int counter = 0 ; counter < numOfThreads ; counter ++ ) { threadPool.execute ( new org.ovirt.engine.core.utils.thread.LatchedRunnableWrapper ( runnable , latch ) ) ; } latch.await ( ) ; }

Target:
private void createAndRunThreadsForRunner ( java.lang.Runnable runnable , int numOfThreads ) throws java.lang.Exception { if ( runnable == null ) { return ; } latch = new java.util.concurrent.CountDownLatch ( numOfThreads ) ; java.util.concurrent.ExecutorService threadPool = java.util.concurrent.Executors.newFixedThreadPool ( numOfThreads ) ; for ( int counter = 0 ; counter < numOfThreads ; counter ++ ) { threadPool.execute ( new org.ovirt.engine.core.dao.LatchedRunnableWrapper ( runnable , latch ) ) ; } latch.await ( ) ; }
Source:
private void mockVdsDao ( final org.ovirt.engine.core.dao.VdsDao vdsDao ) { org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter search = new org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter ( ) ; org.mockito.Mockito.when ( vdsDao.getAllWithQuery ( org.mockito.Matchers.matches ( org.ovirt.engine.core.bll.SearchQueryTest.getVdsRegexString ( search ) ) ) ) . thenReturn ( vdsResultList ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setCpuFlags ( "flag" ) ; vds.setVdsGroupCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; vdsResultList.add ( vds ) ; }

Target:
private void mockVdsDao ( final org.ovirt.engine.core.dao.VdsDao vdsDao ) { org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter search = new org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter ( ) ; org.mockito.Mockito.when ( vdsDao.getAllWithQuery ( org.mockito.Matchers.matches ( org.ovirt.engine.core.bll.SearchQueryTest.getVdsRegexString ( search ) ) ) ) . thenReturn ( vdsResultList ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setCpuFlags ( "flag" ) ; vds.setClusterCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; vdsResultList.add ( vds ) ; }
Source:
public void delay ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debug ( "Try to wait for te engine update the host memory and cpu stats" ) ; try { long t = java.lang.Math.max ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( vdsId ) . getLastUpdateElapsed ( ) , java.util.concurrent.TimeUnit.SECONDS.toMillis ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( org.ovirt.engine.core.common.config.ConfigValues.VdsRefreshRate ) ) ) ; t = java.lang.Math.max ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ThrottlerMaxWaitForVdsUpdateInMillis ) , t ) ; getBlockingQueue ( vdsId ) . poll ( t , java.util.concurrent.TimeUnit.MILLISECONDS ) ; } catch ( java.lang.InterruptedException e ) { } }

Target:
public void delay ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debug ( "Try to wait for te engine update the host memory and cpu stats" ) ; try { long t = java.lang.Math.max ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getVdsManager ( vdsId ) . getLastUpdateElapsed ( ) , java.util.concurrent.TimeUnit.SECONDS.toMillis ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( org.ovirt.engine.core.common.config.ConfigValues.VdsRefreshRate ) ) ) ; t = java.lang.Math.max ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ThrottlerMaxWaitForVdsUpdateInMillis ) , t ) ; getBlockingQueue ( vdsId ) . poll ( t , java.util.concurrent.TimeUnit.MILLISECONDS ) ; } catch ( java.lang.InterruptedException e ) { } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = runVdsCommand ( VDSCommandType.SetSafeNetworkConfig , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getParameters ( ) . getVdsId ( ) ) ) ; org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getDbFacade ( ) . getVdsDynamicDao ( ) . updateNetConfigDirty ( org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getParameters ( ) . getVdsId ( ) , false ) ; setSucceeded ( retVal.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = runVdsCommand ( VDSCommandType.SetSafeNetworkConfig , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getParameters ( ) . getVdsId ( ) ) ) ; vdsDynamicDao.updateNetConfigDirty ( org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getParameters ( ) . getVdsId ( ) , false ) ; setSucceeded ( retVal.getSucceeded ( ) ) ; }