auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean isSourceAndDestTheSame ( ) { if ( ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Move ) ) && ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getSourceDomainId ( ) . equals ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME ) ; } return true ; }

Target:
protected boolean isSourceAndDestTheSame ( ) { if ( ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Move ) ) && ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getSourceDomainId ( ) . equals ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME ) ; } return true ; }
Source:
public void initTable ( final org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { super . initTable ( constants ) ; getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.AbstractBooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > portMirroringColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractBooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( constants.portMirroringEnabled ( ) ) { @ java.lang.Override public java.lang.Boolean getRawValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { return object.isPortMirroring ( ) ; } @ java.lang.Override public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { return null ; } } ; portMirroringColumn.makeSortable ( ) ; getTable ( ) . addColumnWithHtmlHeader ( portMirroringColumn , constants.portMirroring ( ) , "85px" ) ; }

Target:
public void initTable ( ) { super . initTable ( ) ; getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.AbstractBooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > portMirroringColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractBooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( org.ovirt.engine.ui.webadmin.section.main.view.tab.virtualMachine.SubTabVirtualMachineNetworkInterfaceView.constants.portMirroringEnabled ( ) ) { @ java.lang.Override public java.lang.Boolean getRawValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { return object.isPortMirroring ( ) ; } } ; portMirroringColumn.makeSortable ( ) ; getTable ( ) . addColumn ( portMirroringColumn , org.ovirt.engine.ui.webadmin.section.main.view.tab.virtualMachine.SubTabVirtualMachineNetworkInterfaceView.constants.portMirroring ( ) , "85px" ) ; }
Source:
protected org.ovirt.engine.api.model.Vm setVmOvfConfiguration ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.core.common.businessentities.VM entity ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = runQuery ( QueryType.GetVmOvfByVmId , new org.ovirt.engine.core.common.queries.GetVmOvfByVmIdParameters ( entity.getId ( ) , entity.getDbGeneration ( ) ) ) ; if ( ( queryReturnValue.getSucceeded ( ) ) && ( ( queryReturnValue.getReturnValue ( ) ) != null ) ) { java.lang.String configuration = queryReturnValue.getReturnValue ( ) ; return org.ovirt.engine.api.restapi.types.VmMapper.map ( configuration , ConfigurationType.OVF , model ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.Vm setVmOvfConfiguration ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.core.common.businessentities.VM entity ) { org.ovirt.engine.core.common.queries.QueryReturnValue queryReturnValue = runQuery ( QueryType.GetVmOvfByVmId , new org.ovirt.engine.core.common.queries.GetVmOvfByVmIdParameters ( entity.getId ( ) , entity.getDbGeneration ( ) ) ) ; if ( ( queryReturnValue.getSucceeded ( ) ) && ( ( queryReturnValue.getReturnValue ( ) ) != null ) ) { java.lang.String configuration = queryReturnValue.getReturnValue ( ) ; return org.ovirt.engine.api.restapi.types.VmMapper.map ( configuration , ConfigurationType.OVF , model ) ; } return model ; }
Source:
public void refuseBalloonOnPPC ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddPpcTest ( ) ; cmd.getParameters ( ) . setBalloonEnabled ( true ) ; org.mockito.Mockito.when ( osRepository.isBalloonEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; }

Target:
public void refuseSoundDeviceOnPPC ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddPpcTest ( ) ; cmd.getParameters ( ) . setSoundDeviceEnabled ( true ) ; org.mockito.Mockito.when ( osRepository.isSoundDeviceEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getCluster ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.SOUND_DEVICE_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; }
Source:
public void multiQueryValid ( ) { java.util.ArrayList < org.ovirt.engine.core.common.queries.QueryType > queryTypeList = new java.util.ArrayList ( java.util.Arrays.asList ( QueryType.Search , QueryType.Search ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > queryParamsList = new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ) ; underTest.runMultipleQueries ( queryTypeList , queryParamsList ) ; org.mockito.Mockito.verify ( backendLocal , org.mockito.Mockito.times ( 2 ) ) . runQuery ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.QueryType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; }

Target:
public void multiQueryValid ( ) { java.util.ArrayList < org.ovirt.engine.core.common.queries.QueryType > queryTypeList = new java.util.ArrayList ( java.util.Arrays.asList ( QueryType.Search , QueryType.Search ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.QueryParametersBase > queryParamsList = new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) , new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) ) ) ; underTest.runMultipleQueries ( queryTypeList , queryParamsList ) ; org.mockito.Mockito.verify ( backendLocal , org.mockito.Mockito.times ( 2 ) ) . runQuery ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.QueryType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.QueryParametersBase.class ) ) ; }
Source:
private void externalNetworkPortMirroringTest ( boolean externalNetwork , boolean portMirroring , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.mockito.Mockito.when ( networkDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( network ) ; org.mockito.Mockito.when ( network.isExternal ( ) ) . thenReturn ( externalNetwork ) ; org.mockito.Mockito.when ( vnicProfile.isPortMirroring ( ) ) . thenReturn ( portMirroring ) ; org.junit.Assert.assertThat ( validator.portMirroringNotSetIfExternalNetwork ( ) , matcher ) ; }

Target:
private void externalNetworkPortMirroringTest ( boolean externalNetwork , boolean portMirroring , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.mockito.Mockito.when ( networkDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( network ) ; org.mockito.Mockito.when ( network.isExternal ( ) ) . thenReturn ( externalNetwork ) ; org.mockito.Mockito.when ( vnicProfile.isPortMirroring ( ) ) . thenReturn ( portMirroring ) ; org.junit.Assert.assertThat ( validator.portMirroringNotSetIfExternalNetwork ( ) , matcher ) ; }
Source:
public void testGetNotFound_2 ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( asList ( getEntity ( 2 ) ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound2 ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( asList ( getEntity ( 2 ) ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private void managePrestartedVmsInPool ( org.ovirt.engine.core.common.businessentities.VmPool vmPool ) { org.ovirt.engine.core.compat.Guid vmPoolId = vmPool.getVmPoolId ( ) ; int prestartedVms = org.ovirt.engine.core.bll.VmPoolCommandBase.getNumOfPrestartedVmsInPool ( vmPoolId ) ; int missingPrestartedVms = ( vmPool.getPrestartedVms ( ) ) - prestartedVms ; if ( missingPrestartedVms > 0 ) { int numOfVmsToPrestart = java.lang.Math.min ( missingPrestartedVms , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VmPoolMonitorBatchSize ) ) ; org.ovirt.engine.core.bll.VmPoolMonitor.log.infoFormat ( "VmPool {0} is missing {1} prestarted Vms, attempting to prestart {2} Vms" , vmPoolId , missingPrestartedVms , numOfVmsToPrestart ) ; prestartVms ( vmPoolId , numOfVmsToPrestart ) ; } }

Target:
private void managePrestartedVmsInPool ( org.ovirt.engine.core.common.businessentities.VmPool vmPool ) { org.ovirt.engine.core.compat.Guid vmPoolId = vmPool.getVmPoolId ( ) ; int prestartedVms = org.ovirt.engine.core.bll.VmPoolCommandBase.getNumOfPrestartedVmsInPool ( vmPoolId ) ; int missingPrestartedVms = ( vmPool.getPrestartedVms ( ) ) - prestartedVms ; if ( missingPrestartedVms > 0 ) { int numOfVmsToPrestart = java.lang.Math.min ( missingPrestartedVms , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VmPoolMonitorBatchSize ) ) ; org.ovirt.engine.core.bll.VmPoolMonitor.log.info ( "VmPool '{}' is missing prestarted Vms, attempting to prestart Vms" , vmPoolId , missingPrestartedVms , numOfVmsToPrestart ) ; prestartVms ( vmPoolId , numOfVmsToPrestart ) ; } }
Source:
public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { if ( ( ( storage.getAvailableDiskSize ( ) ) == null ) || ( ( storage.getAvailableDiskSize ( ) ) < 1 ) ) { return "< 1 GB" ; } return ( storage.getAvailableDiskSize ( ) ) + " GB" ; }

Target:
public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { if ( ( ( storage.getAvailableDiskSize ( ) ) == null ) || ( ( storage.getAvailableDiskSize ( ) ) < 1 ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.datacenter.RecoveryStorageConfirmationPopupView.messages.gigabytes ( "< 1" ) ; } return org.ovirt.engine.ui.webadmin.section.main.view.popup.datacenter.RecoveryStorageConfirmationPopupView.messages.gigabytes ( java.lang.String.valueOf ( storage.getAvailableDiskSize ( ) ) ) ; }
Source:
public void getClusterFeaturesByVersionAndCategory ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.mode.ApplicationMode category ) { 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.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByVersionAndCategory , new org.ovirt.engine.core.common.queries.GetClusterFeaturesByVersionAndCategoryParameters ( version , category ) , aQuery ) ; }

Target:
public void getClusterFeaturesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
private static java.lang.String getEffectiveSpiceProxy ( org.ovirt.engine.api.restapi.types.VM entity ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( entity.getVmPoolSpiceProxy ( ) ) ) { return entity.getVmPoolSpiceProxy ( ) ; } if ( org.apache.commons.lang.StringUtils.isNotBlank ( entity.getVdsGroupSpiceProxy ( ) ) ) { return entity.getVdsGroupSpiceProxy ( ) ; } java.lang.String globalSpiceProxy = org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.SpiceProxyDefault ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( globalSpiceProxy ) ) { return globalSpiceProxy ; } return null ; }

Target:
private static java.lang.String getEffectiveSpiceProxy ( org.ovirt.engine.api.restapi.types.VM entity ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( entity.getVmPoolSpiceProxy ( ) ) ) { return entity.getVmPoolSpiceProxy ( ) ; } if ( org.apache.commons.lang.StringUtils.isNotBlank ( entity.getClusterSpiceProxy ( ) ) ) { return entity.getClusterSpiceProxy ( ) ; } java.lang.String globalSpiceProxy = org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.SpiceProxyDefault ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( globalSpiceProxy ) ) { return globalSpiceProxy ; } return null ; }
Source:
public void testNicExistsWhenNicNameIsNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNicName ( null ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( attachment , new org.ovirt.engine.core.common.businessentities.VDS ( ) ) . nicExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }

Target:
public void testNicExistsWhenNicNameIsNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNicName ( null ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . nicExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
private void updateSpiceFullScreenDefault ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigurationValueBoolean ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spice.getOptions ( ) . setFullScreen ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) , spiceFullScreenConfigKey ( ) ) ; }

Target:
private void updateSpiceFullScreenDefault ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigurationValueBoolean ( new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.Boolean > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Boolean returnValue ) { spice.getOptions ( ) . setFullScreen ( returnValue ) ; } } ) , spiceFullScreenConfigKey ( ) ) ; }
Source:
private void checkConnection ( ) throws java.sql.SQLException { if ( ! ( connection.isValid ( 0 ) ) ) { throw new java.sql.SQLException ( "The connection has been closed or invalid." ) ; } }

Target:
private void checkConnection ( ) throws java.sql.SQLException { java.sql.Statement statement = null ; java.sql.ResultSet rs = null ; try { statement = connection.createStatement ( ) ; rs = statement.executeQuery ( "select null" ) ; rs.next ( ) ; } finally { if ( rs != null ) { rs.close ( ) ; } if ( statement != null ) { statement.close ( ) ; } } }
Source:
public java.lang.String render ( T size ) { if ( isUnavailable ( size ) ) { return org.ovirt.engine.ui.common.widget.renderer.DiskSizeRenderer.CONSTANTS.unAvailablePropertyLabel ( ) ; } long sizeInGB = - 1 ; switch ( unit ) { case BYTE : sizeInGB = ( ( long ) ( ( size.longValue ( ) ) / ( java.lang.Math.pow ( 1024 , 3 ) ) ) ) ; break ; case GIGABYTE : sizeInGB = size.longValue ( ) ; break ; } return sizeInGB >= 1 ? sizeInGB + " GB" : "< 1 GB" ; }

Target:
public java.lang.String render ( T size ) { if ( isUnavailable ( size ) ) { return org.ovirt.engine.ui.common.widget.renderer.DiskSizeRenderer.CONSTANTS.unAvailablePropertyLabel ( ) ; } switch ( format ) { case GIGABYTE : return renderGigabyteSize ( size.longValue ( ) ) ; case HUMAN_READABLE : return renderHumanReadableSize ( size.longValue ( ) ) ; default : throw new java.lang.RuntimeException ( ( ( "Format '" + ( format ) ) + "' is not supported!" ) ) ; } }
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 , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > emptyList ( ) , null , null , managementNetworkUtil ) ; 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 testValidRemovedBondsWhenBondIsNotRequired ( ) throws java.lang.Exception { java.lang.String nicName = "nicName" ; bond.setName ( nicName ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setRemovedBonds ( java.util.Collections.singleton ( bond.getId ( ) ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( params , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > singletonList ( bond ) ) ; 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 getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
public void testStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( "AppErrors" ) ; java.util.List < java.lang.String > error = et.TranslateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_WITH_REPLACEMENT , "$action SOMEACTION" , "$type SOME Type" ) ) ; java.lang.String result = "Cannot SOMEACTION SOME Type. VM's Image doesn't exist." ; assertTrue ( "Size" , ( ( error.size ( ) ) == 1 ) ) ; assertEquals ( "String should equal" , result , error.get ( 0 ) ) ; }

Target:
public void testStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( org.ovirt.engine.core.utils.ErrorTranslatorTest.FILENAME ) ; java.util.List < java.lang.String > error = et.TranslateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_WITH_REPLACEMENT , "$action SOMEACTION" , "$type SOME Type" ) ) ; java.lang.String result = "Cannot SOMEACTION SOME Type. VM's Image doesn't exist." ; assertTrue ( "Size" , ( ( error.size ( ) ) == 1 ) ) ; assertEquals ( "String should equal" , result , error.get ( 0 ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.FenceAgent createRealAgent ( org.ovirt.engine.core.common.businessentities.FenceAgent agent , org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { org.ovirt.engine.core.common.businessentities.FenceAgent realAgent = new org.ovirt.engine.core.common.businessentities.FenceAgent ( agent ) ; realAgent.setOptions ( getRealAgentOptions ( agent , proxyHost ) ) ; realAgent.setType ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.getRealAgent ( agent.getType ( ) ) ) ; return realAgent ; }

Target:
protected org.ovirt.engine.core.common.businessentities.pm.FenceAgent createRealAgent ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent , org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { org.ovirt.engine.core.common.businessentities.pm.FenceAgent realAgent = new org.ovirt.engine.core.common.businessentities.pm.FenceAgent ( agent ) ; realAgent.setOptions ( getRealAgentOptions ( agent , proxyHost ) ) ; realAgent.setType ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.getRealAgent ( agent.getType ( ) ) ) ; return realAgent ; }
Source:
public void OnSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue1 ) { org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel poolGeneralModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel ) ( model1 ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storage = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue1 ) ) . getReturnValue ( ) ) ) ; poolGeneralModel1.setStorageDomain ( storage.getstorage_name ( ) ) ; poolGeneralModel1.getUpdateCompleteEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
public void OnSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue1 ) { org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel poolGeneralModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel ) ( model1 ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storage = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue1 ) ) . getReturnValue ( ) ) ) ; poolGeneralModel1.setStorageDomain ( storage.getStorageName ( ) ) ; poolGeneralModel1.getUpdateCompleteEvent ( ) . raise ( this , EventArgs.Empty ) ; }
Source:
public org.ovirt.engine.api.model.RSDL build ( ) throws java.io.IOException , java.lang.ClassNotFoundException { rsdl = construct ( ) ; rsdl.setRel ( getRel ( ) ) ; rsdl.setHref ( getHref ( ) ) ; rsdl.setDescription ( getDescription ( ) ) ; rsdl.setSchema ( getSchema ( ) ) ; rsdl.setGeneral ( getGeneralMetadata ( ) ) ; return rsdl ; }

Target:
public org.ovirt.engine.api.model.Rsdl build ( ) throws java.io.IOException , java.lang.ClassNotFoundException { rsdl = construct ( ) ; rsdl.setRel ( getRel ( ) ) ; rsdl.setHref ( getHref ( ) ) ; rsdl.setDescription ( getDescription ( ) ) ; rsdl.setSchema ( getSchema ( ) ) ; rsdl.setGeneral ( getGeneralMetadata ( ) ) ; return rsdl ; }
Source:
protected boolean checkCpuSockets ( ) { return org.ovirt.engine.core.bll.AddVmCommand.checkCpuSockets ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfSockets ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getCpuPerSocket ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) . toString ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean checkCpuSockets ( ) { return org.ovirt.engine.core.bll.AddVmCommand.checkCpuSockets ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfSockets ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getCpuPerSocket ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) . toString ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
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 GetRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
private void setRngDevice ( org.ovirt.engine.api.model.InstanceType model ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > rngDevices = getEntity ( java.util.List.class , VdcQueryType.GetRngDevice , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( model.getId ( ) ) ) , "GetRngDevice" , true ) ; if ( ( rngDevices != null ) && ( ! ( rngDevices.isEmpty ( ) ) ) ) { model.setRngDevice ( org.ovirt.engine.api.restapi.types.RngDeviceMapper.map ( rngDevices.get ( 0 ) , null ) ) ; } }

Target:
private void setRngDevice ( org.ovirt.engine.api.model.InstanceType model ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > rngDevices = getEntity ( java.util.List.class , QueryType.GetRngDevice , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( model.getId ( ) ) ) , "GetRngDevice" , true ) ; if ( ( rngDevices != null ) && ( ! ( rngDevices.isEmpty ( ) ) ) ) { model.setRngDevice ( org.ovirt.engine.api.restapi.types.RngDeviceMapper.map ( rngDevices.get ( 0 ) , null ) ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( ( succeeded ? ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( retVal.getActionReturnValue ( ) ) ) : null ) , succeeded ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { postAddNetwork ( result1.getReturnValue ( ) ) ; }
Source:
private boolean isBalloonActiveOnHost ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getDbFacade ( ) . getVdsGroupDao ( ) . get ( _vds.getVdsGroupId ( ) ) ; return ( cluster != null ) && ( cluster.isEnableBallooning ( ) ) ; }

Target:
protected boolean isBalloonWorking ( org.ovirt.engine.core.common.businessentities.VmBalloonInfo balloonInfo ) { return ( java.lang.Math.abs ( ( ( balloonInfo.getBalloonLastMemory ( ) ) - ( balloonInfo.getBalloonTargetMemory ( ) ) ) ) ) > ( java.lang.Math.abs ( ( ( balloonInfo.getCurrentMemory ( ) ) - ( balloonInfo.getBalloonTargetMemory ( ) ) ) ) ) ; }
Source:
public void canDoActionFailedVMHasNotDisk ( ) throws java.lang.Exception { initializeCommand ( ) ; mockVmStatusDown ( ) ; createNullDisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionFailedVMHasNotDisk ( ) throws java.lang.Exception { initializeCommand ( createParameters ( ) ) ; createNullDisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDAO ( ) . getAllForCluster ( vds.getvds_group_id ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : networks ) { org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.SetNetworkStatus ( vds.getvds_group_id ( ) , net ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForCluster ( vds.getvds_group_id ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : networks ) { org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.SetNetworkStatus ( vds.getvds_group_id ( ) , net ) ; } return null ; }
Source:
public void onSearchableModelActivation ( org.ovirt.engine.ui.userportal.section.main.presenter.SearchableModelActivationEvent event ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel currentModel = modelProvider.getModel ( ) ; if ( ( event.getListModel ( ) ) == currentModel ) { currentModel.getSearchCommand ( ) . execute ( ) ; } else { currentModel.setItems ( null ) ; currentModel.stopRefresh ( ) ; } }

Target:
protected void onReveal ( ) { super . onReveal ( ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel currentModel = modelProvider.getModel ( ) ; currentModel.getSearchCommand ( ) . execute ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; setItems ( disks ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = result.getReturnValue ( ) ; if ( vm == null ) { return ; } org.ovirt.engine.core.common.queries.IdQueryParameters queryParameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vm.getId ( ) ) ; queryParameters.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksPartialDataByVmId , queryParameters , new org.ovirt.engine.ui.uicommonweb.models.userportal.SetSortedItemsAsyncQuery ( new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ) ; } }
Source:
private void refreshBootSequenceParameter ( org.ovirt.engine.core.common.action.RunVmParams runVmParameters ) { if ( runVmParameters != null ) { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setboot_sequence ( ( ( runVmParameters.getBootSequence ( ) ) != null ? runVmParameters.getBootSequence ( ) : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getdefault_boot_sequence ( ) ) ) ; } }

Target:
protected void refreshBootParameters ( org.ovirt.engine.core.common.action.RunVmParams runVmParameters ) { if ( runVmParameters == null ) { return ; } org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setboot_sequence ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getdefault_boot_sequence ( ) ) ; }
Source:
private void removeVmStatlessImages ( ) { runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.IdParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.RunVmCommand.getContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }

Target:
private void removeVmStatlessImages ( ) { runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.ProcessDownVmParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , true ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.RunVmCommand.getContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }
Source:
protected void verify ( org.ovirt.engine.api.model.Tag model , org.ovirt.engine.api.model.Tag transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertEquals ( model.getName ( ) , transform.getName ( ) ) ; org.junit.Assert.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.Assert.assertEquals ( model.getDescription ( ) , transform.getDescription ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.Tag model , org.ovirt.engine.api.model.Tag transform ) { org.junit.jupiter.api.Assertions.assertNotNull ( transform ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getName ( ) , transform.getName ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getDescription ( ) , transform.getDescription ( ) ) ; }
Source:
private void initManualWidgets ( ) { networkEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < java.lang.Object > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( java.lang.Object object ) { return ( ( org.ovirt.engine.core.common.businessentities.network ) ( object ) ) . getname ( ) ; } } ) ; nicTypeEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer ( ) ) ; }

Target:
private void initManualWidgets ( ) { networkEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < java.lang.Object > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( java.lang.Object object ) { return ( ( org.ovirt.engine.core.common.businessentities.network ) ( object ) ) . getname ( ) ; } } ) ; nicTypeEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer ( ) ) ; activateCheckBox = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }
Source:
public static void GetVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( id ) , aQuery ) ; }

Target:
public static void GetVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
protected void handleSpecificCommandActions ( ) { if ( ( mVmList.size ( ) ) > 0 ) { org.ovirt.engine.core.bll.RestartVdsVmsOperation restartVmsOper = new org.ovirt.engine.core.bll.RestartVdsVmsOperation ( org.ovirt.engine.core.bll.StopVdsCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) ) ; restartVmsOper.restartVms ( mVmList ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) . getId ( ) ) ) ; } }

Target:
protected void handleSpecificCommandActions ( ) { if ( ( mVmList.size ( ) ) > 0 ) { org.ovirt.engine.core.bll.RestartVdsVmsOperation restartVmsOper = new org.ovirt.engine.core.bll.RestartVdsVmsOperation ( org.ovirt.engine.core.bll.StopVdsCommand.getContext ( ) , org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) ) ; restartVmsOper.restartVms ( mVmList ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) . getId ( ) ) ) ; } }
Source:
private boolean validate ( ) { getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( 50 ) , new org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation ( ) } ) ; getDescription ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( 400 ) , new org.ovirt.engine.ui.uicommonweb.validation.AsciiOrNoneValidation ( ) } ) ; return ( getName ( ) . getIsValid ( ) ) && ( getDescription ( ) . getIsValid ( ) ) ; }

Target:
private boolean validate ( ) { getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( 50 ) , new org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation ( ) } ) ; getDescription ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( 400 ) , new org.ovirt.engine.ui.uicommonweb.validation.AsciiOrNoneValidation ( ) } ) ; return ( ( getName ( ) . getIsValid ( ) ) && ( getDescription ( ) . getIsValid ( ) ) ) && ( getCustomPropertySheet ( ) . validate ( ) ) ; }
Source:
protected void onBind ( ) { super . onBind ( ) ; roleModelProvider.getModel ( ) . Search ( ) ; systemPermissionModelProvider.getModel ( ) . Search ( ) ; registerHandler ( getView ( ) . getCloseButton ( ) . addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getView ( ) . hide ( ) ; } } ) ) ; }

Target:
public void onKeyPress ( com.google.gwt.dom.client.NativeEvent event ) { if ( ( com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE ) == ( event.getKeyCode ( ) ) ) { getView ( ) . hide ( ) ; unbind ( ) ; } }
Source:
public static void clearNetworks ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel nic , org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > attachedNetworks = nic.getItems ( ) ; if ( ( attachedNetworks.size ( ) ) > 0 ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel : new java.util.ArrayList ( attachedNetworks ) ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.DETACH_NETWORK.getCommand ( networkModel , null , dataFromHostSetupNetworksModel ) . execute ( ) ; } } }

Target:
public static void detachAllNetworks ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel nic , org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > attachedNetworks = nic.getItems ( ) ; if ( ( attachedNetworks.size ( ) ) > 0 ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel : new java.util.ArrayList ( attachedNetworks ) ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.DETACH_NETWORK.getCommand ( networkModel , null , dataFromHostSetupNetworksModel ) . execute ( ) ; } } }
Source:
public static < T extends org.ovirt.engine.sdk.entities.BaseResource > T getItemByName ( java.lang.String name , java.util.List < T > collection ) { for ( T item : collection ) { if ( item.getName ( ) . equals ( name ) ) { return item ; } } return null ; }

Target:
public static < T extends org.ovirt.engine.sdk.entities.BaseResource > T getItemByName ( java.lang.String name , java.util.List < T > collection ) { for ( T item : collection ) { if ( ( ! ( org.ovirt.engine.sdk.utils.StringUtils.isNull ( item.getName ( ) ) ) ) && ( item.getName ( ) . equals ( name ) ) ) { return item ; } } return null ; }
Source:
public org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse process ( org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request ) { return org.ovirt.vdsmfake.rpc.json.CommandFactory.createCommand ( request.getMethod ( ) ) . run ( request.getParams ( ) , request.getId ( ) ) ; }

Target:
public org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse process ( org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request ) { org.ovirt.vdsmfake.rpc.json.commands.JsonCommand jsonCommand = javax.enterprise.inject.spi.CDI.current ( ) . select ( org.ovirt.vdsmfake.rpc.json.commands.JsonCommand.class , new org.ovirt.vdsmfake.rpc.json.DefaultCommandExecutor.VerbLiteral ( request.getMethod ( ) ) ) . get ( ) ; if ( jsonCommand == null ) { java.lang.String msg = java.lang.String.format ( "Couldn't instantiate a command instance from method %s" , request.getMethod ( ) ) ; org.ovirt.vdsmfake.rpc.json.DefaultCommandExecutor.log.error ( msg ) ; throw new java.lang.IllegalArgumentException ( msg ) ; } return jsonCommand.run ( request.getParams ( ) , request.getId ( ) ) ; }
Source:
public void testAddNameSuppliedButNoId ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setName ( "orcus" ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUpEntityQueryExpectations ( 1 , null ) ; setUpGetNetworksByDataCenterExpectations ( 1 , null ) ; setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpActionExpectations ( VdcActionType.AttachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , true , true ) ; collection.add ( model ) ; }

Target:
public void testAddNameSuppliedButNoId ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setName ( "orcus" ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUpEntityQueryExpectations ( 1 , null ) ; setUpGetNetworksByDataCenterExpectations ( 1 , null ) ; setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpActionExpectations ( ActionType.AttachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , true , true ) ; collection.add ( model ) ; }