auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
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 ; }

Target:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > > aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
public void onAcccept ( final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client ) { client.addEventListener ( new org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.MessageListener ( ) { @ java.lang.Override public void onMessageReceived ( byte [ ] message ) { org.ovirt.vdsmfake.rpc.json.JsonRpcServer.MessageHandler handler = new org.ovirt.vdsmfake.rpc.json.JsonRpcServer.MessageHandler ( client , message ) ; service.submit ( handler ) ; } } ) ; }

Target:
public void onAcccept ( final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client ) { org.ovirt.vdsmfake.rpc.json.JsonRpcServer.log.info ( ( "Accepting connection from " + ( client.getHostname ( ) ) ) ) ; client.addEventListener ( new org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.MessageListener ( ) { @ java.lang.Override public void onMessageReceived ( byte [ ] message ) { org.ovirt.vdsmfake.rpc.json.JsonRpcServer.MessageHandler handler = new org.ovirt.vdsmfake.rpc.json.JsonRpcServer.MessageHandler ( client , message ) ; service.submit ( handler ) ; } } ) ; }
Source:
private void initRadioButtonEditors ( ) { enableOvirtServiceOptionEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "service" ) ; enableGlusterServiceOptionEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "service" ) ; optimizationNoneEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "1" ) ; optimizationForServerEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "1" ) ; optimizationForDesktopEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "1" ) ; optimizationCustomEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "1" ) ; migrateOnErrorOption_YESEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "2" ) ; migrateOnErrorOption_HA_ONLYEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "2" ) ; migrateOnErrorOption_NOEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "2" ) ; }

Target:
private void initRadioButtonEditors ( ) { enableOvirtServiceOptionEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "service" ) ; enableGlusterServiceOptionEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "service" ) ; optimizationNoneEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "1" ) ; optimizationForServerEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "1" ) ; optimizationForDesktopEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "1" ) ; optimizationCustomEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "1" ) ; migrateOnErrorOption_YESEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "2" ) ; migrateOnErrorOption_HA_ONLYEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "2" ) ; migrateOnErrorOption_NOEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "2" ) ; optimizeForUtilizationEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "3" ) ; optimizeForSpeedEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "3" ) ; }
Source:
public void postUpdateNumOfSockets2 ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; java.lang.String version = cluster.getcompatibility_version ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxNumOfCPUsPerSocket ( 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 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; behavior.maxCpusPerSocket = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.totalCpuCoresChanged ( ) ; } } , getModel ( ) . getHash ( ) ) , version ) ; }

Target:
public void postUpdateNumOfSockets2 ( ) { java.lang.String version = getClusterCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxNumOfCPUsPerSocket ( 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 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; behavior.maxCpusPerSocket = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.totalCpuCoresChanged ( ) ; } } , getModel ( ) . getHash ( ) ) , version ) ; }
Source:
public org.ovirt.engine.api.v3.types.V3Host get ( @ javax.ws.rs.core.Context javax.ws.rs.core.HttpHeaders headers , @ javax.ws.rs.core.Context javax.ws.rs.core.UriInfo ui ) { boolean force = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( headers , ui , "force" , true , false ) ; if ( force ) { try { getDelegate ( ) . refresh ( new org.ovirt.engine.api.model.Action ( ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } } return adaptGet ( getDelegate ( ) :: get ) ; }

Target:
public org.ovirt.engine.api.v3.types.V3Host get ( @ javax.ws.rs.core.Context javax.ws.rs.core.HttpHeaders headers , @ javax.ws.rs.core.Context javax.ws.rs.core.UriInfo ui ) { boolean force = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( headers , ui , "force" , true , false ) ; if ( force ) { try { getDelegate ( ) . refresh ( new org.ovirt.engine.api.model.Action ( ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } } return adaptGet ( getDelegate ( ) :: get ) ; }
Source:
public java.lang.Integer getmem_commited_percent ( ) { java.lang.Integer commited = mVdsDynamic.getmem_commited ( ) ; java.lang.Integer physical = mVdsDynamic.getphysical_mem_mb ( ) ; if ( ( ( commited == null ) || ( physical == null ) ) || ( physical == 0 ) ) { return 0 ; } return ( commited * 100 ) / physical ; }

Target:
public java.lang.Integer getMemCommitedPercent ( ) { java.lang.Integer commited = mVdsDynamic.getmem_commited ( ) ; java.lang.Integer physical = mVdsDynamic.getphysical_mem_mb ( ) ; if ( ( ( commited == null ) || ( physical == null ) ) || ( physical == 0 ) ) { return 0 ; } return ( commited * 100 ) / physical ; }
Source:
public com.google.gwt.event.dom.client.HasClickHandlers addShutdownButton ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model , org.ovirt.engine.ui.uicommonweb.UICommand command ) { org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton button = new org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton ( constants.shutdownVm ( ) , resources.stopIcon ( ) , resources.stopDisabledIcon ( ) , style.shutdownButtonAdditionalStyle ( ) ) ; button.setElementId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , "shutdownButton" ) ) ; addButtonToPanel ( button ) ; updateButton ( button , command ) ; return button ; }

Target:
public void updateRunButton ( org.ovirt.engine.ui.uicommonweb.UICommand command , boolean isPool ) { runButton.setTitle ( ( isPool ? constants.takeVm ( ) : constants.runVm ( ) ) ) ; updateButton ( runButton , command ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc importCandidate ( java.lang.String sdUUID , java.lang.String vmGUID , java.lang.String templateGUID , java.lang.String templateVolGUID , java.lang.String path , java.lang.String type , java.lang.String force ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = irsServer.importCandidate ( sdUUID , vmGUID , templateGUID , templateVolGUID , path , type , force ) ; org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.ResizeStorageDomainPVMapReturnForXmlRpc resizeStorageDomainPV ( java.lang.String sdUUID , java.lang.String spUUID , java.lang.String device ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = irsServer.resizePV ( sdUUID , spUUID , device ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ResizeStorageDomainPVMapReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.ResizeStorageDomainPVMapReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }
Source:
protected boolean isVirtioScsiEnabled ( ) { java.lang.Boolean virtioScsiEnabled = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isVirtioScsiEnabled ( ) ; boolean isOsSupportedForVirtIoScsi = org.ovirt.engine.core.bll.validator.VmValidationUtils.isDiskInterfaceSupportedByOs ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) , DiskInterface.VirtIO_SCSI ) ; return virtioScsiEnabled != null ? virtioScsiEnabled : ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) && isOsSupportedForVirtIoScsi ; }

Target:
protected boolean isBalloonEnabled ( ) { java.lang.Boolean balloonEnabled = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isBalloonEnabled ( ) ; return balloonEnabled != null ? balloonEnabled : osRepository.isBalloonEnabled ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getOsId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; }
Source:
public void getNextAvailableDiskAliasNameByVMId ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public static java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceVlanIdIsEmpty ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ( i.getVlanId ( ) ) == null ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceVlanIdIsEmpty ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { return org.ovirt.engine.ui.uicommonweb.Linq.where ( items , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i ) { return ( i.getVlanId ( ) ) == null ; } } ) ; }
Source:
public void testGetGlusterVolumeSnapshotConfigByVolumeId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > configs = dao.getConfigByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.VOLUME_ID ) ; org.junit.Assert.assertNotNull ( configs ) ; org.junit.Assert.assertEquals ( 2 , configs.size ( ) ) ; org.junit.Assert.assertTrue ( configs.contains ( existingConfig1 ) ) ; }

Target:
public void testGetGlusterVolumeSnapshotConfigByVolumeId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > configs = dao.getConfigByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.VOLUME_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( configs ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , configs.size ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( configs.contains ( existingConfig1 ) ) ; }
Source:
public void canDoActionThinProvisioningSpaceCheckSucceeds ( ) throws java.lang.Exception { final int availableSize = 6 ; final int usedSize = 4 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionSucceedsOnDiskDomainCheckWhenStorageGuidInParamsMismatches ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId ) ; mockVmWithDisk ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
Source:
protected void updateMemoryBalloon ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { updateMemoryBalloon ( getModel ( ) . getSelectedCluster ( ) . getCompatibilityVersion ( ) ) ; } }

Target:
protected void updateMemoryBalloon ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; java.lang.Integer osType = getModel ( ) . getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster != null ) && ( osType != null ) ) { updateMemoryBalloon ( cluster.getCompatibilityVersion ( ) , osType ) ; } }
Source:
public static void getVmById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VM vm = null ; org.ovirt.engine.core.common.businessentities.VmPool vmpool = vmPoolDao.getByName ( org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getParameters ( ) . getName ( ) ) ; if ( vmpool != null ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue getVmRet = backend.runInternalQuery ( VdcQueryType.GetVmDataByPoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmpool.getVmPoolId ( ) ) ) ; if ( getVmRet != null ) { vm = getVmRet.getReturnValue ( ) ; } } org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getQueryReturnValue ( ) . setReturnValue ( vm ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VM vm = null ; org.ovirt.engine.core.common.businessentities.VmPool vmpool = vmPoolDao.getByName ( org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getParameters ( ) . getName ( ) ) ; if ( vmpool != null ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue getVmRet = backend.runInternalQuery ( QueryType.GetVmDataByPoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmpool.getVmPoolId ( ) ) ) ; if ( getVmRet != null ) { vm = getVmRet.getReturnValue ( ) ; } } org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getQueryReturnValue ( ) . setReturnValue ( vm ) ; }
Source:
public void validateSpaceAndThreshold ( ) { org.junit.Assert.assertTrue ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.times ( org.ovirt.engine.core.bll.TOTAL_NUM_DOMAINS ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
public void validateSpaceAndThreshold ( ) { org.junit.jupiter.api.Assertions.assertTrue ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.times ( org.ovirt.engine.core.bll.TOTAL_NUM_DOMAINS ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public void lunDiskValid ( ) { 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.singletonList ( lunDisk.getLun ( ) ) ; 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.isValid ( ) ) ; }

Target:
public void lunDiskValid ( ) { 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.singletonList ( lunDisk.getLun ( ) ) ; 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.mockito.Matchers.any ( java.lang.String.class ) ) ; org.junit.Assert.assertThat ( lunValidator.isLunDiskVisible ( lunDisk.getLun ( ) , vds ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.Object > constructStringAttributes ( ) { java.util.Map < java.lang.String , java.lang.Object > attributes = super . constructStringAttributes ( ) ; attributes.put ( "baseInterface" , getBaseInterface ( ) ) ; attributes.put ( "vlanId" , getVlanId ( ) ) ; return attributes ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "baseInterface" , getBaseInterface ( ) ) . append ( "vlanId" , getVlanId ( ) ) ; }
Source:
protected void performLogin ( T loginModel ) { org.ovirt.engine.core.common.businessentities.DbUser loggedUser = loginModel.getLoggedUser ( ) ; java.lang.String loginPassword = loginModel.getPassword ( ) . getEntity ( ) ; frontend.initLoggedInUser ( loggedUser , loginPassword ) ; beforeUiCommonInitEvent ( loginModel ) ; org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent.fire ( eventBus ) ; user.onUserLogin ( loggedUser ) ; loginModel.getPassword ( ) . setEntity ( null ) ; }

Target:
protected void performLogin ( T loginModel ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser loggedUser = loginModel.getLoggedUser ( ) ; java.lang.String loginPassword = loginModel.getPassword ( ) . getEntity ( ) ; frontend.initLoggedInUser ( loggedUser , loginPassword ) ; beforeUiCommonInitEvent ( loginModel ) ; org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent.fire ( eventBus ) ; user.onUserLogin ( loggedUser ) ; loginModel.getPassword ( ) . setEntity ( null ) ; }
Source:
public static void GetTimeZoneList ( 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.HashMap < java.lang.String , java.lang.String > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTimeZones , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void GetTimeZoneList ( 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.HashMap < java.lang.String , java.lang.String > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setWindowsOS ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( aQuery.getModel ( ) ) ) . getModel ( ) . getIsWindowsOS ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTimeZones , params , aQuery ) ; }
Source:
private void initInterface ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; iface.setVmName ( getVm ( ) . getVmName ( ) ) ; }

Target:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; iface.setVmName ( getVm ( ) . getVmName ( ) ) ; }
Source:
private void checkIncompatibleIpv6AddressDetailsBootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv6BootProtocol ipv6BootProtocol ) { final boolean initAddress = random.nextBoolean ( ) ; initIpv6ConfigurationDetails ( ipv6BootProtocol , initAddress , ( ! initAddress ) ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_INCOMPATIBLE_BOOT_PROTOCOL_AND_IP_ADDRESS_DETAILS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_BOOT_PROTOCOL , ipv6BootProtocol.getDisplayName ( ) ) ) ) ; }

Target:
private void checkIncompatibleIpv6AddressDetailsBootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv6BootProtocol ipv6BootProtocol ) { final boolean initAddress = random.nextBoolean ( ) ; initIpv6ConfigurationDetails ( ipv6BootProtocol , initAddress , ( ! initAddress ) ) ; org.hamcrest.MatcherAssert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_INCOMPATIBLE_BOOT_PROTOCOL_AND_IP_ADDRESS_DETAILS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_BOOT_PROTOCOL , ipv6BootProtocol.getDisplayName ( ) ) ) ) ; }
Source:
public static void fillImagesBySnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : vm.getDiskMap ( ) . values ( ) ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; diskImage.getSnapshots ( ) . addAll ( org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots ( diskImage.getImageId ( ) ) ) ; } } }

Target:
public static void fillImagesBySnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : vm.getDiskMap ( ) . values ( ) ) { if ( disk.getDiskStorageType ( ) . isInternal ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; diskImage.getSnapshots ( ) . addAll ( org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots ( diskImage.getImageId ( ) ) ) ; } } }
Source:
public org.ovirt.engine.ui.webadmin.section.main.presenter.DynamicUrlContentTabProxy create ( com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.RequestTabsHandler > requestTabsEventType , com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.proxy.RevealContentHandler < ? > > revealContentEventType , java.lang.String label , java.lang.String historyToken , boolean isMainTab , java.lang.String contentUrl ) { return new org.ovirt.engine.ui.webadmin.section.main.presenter.DynamicUrlContentTabProxy ( ginjector , requestTabsEventType , revealContentEventType , viewProvider , label , java.lang.Float.MAX_VALUE , historyToken , isMainTab , contentUrl ) ; }

Target:
public org.ovirt.engine.ui.webadmin.section.main.presenter.DynamicUrlContentTabProxy create ( com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.RequestTabsHandler > requestTabsEventType , com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.proxy.RevealContentHandler < ? > > revealContentEventType , java.lang.String label , java.lang.String historyToken , boolean isMainTab , java.lang.String contentUrl , org.ovirt.engine.ui.common.widget.Align align ) { return new org.ovirt.engine.ui.webadmin.section.main.presenter.DynamicUrlContentTabProxy ( ginjector , requestTabsEventType , revealContentEventType , viewProvider , label , java.lang.Float.MAX_VALUE , historyToken , isMainTab , contentUrl , align ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomain ( int availableSpace ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setStorageDomainType ( StorageDomainType.Master ) ; sd.setStatus ( StorageDomainStatus.Active ) ; sd.setAvailableDiskSize ( availableSpace ) ; sd.setUsedDiskSize ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) ; sd.setId ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ; return sd ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomain ( int availableSpace ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setStorageDomainType ( StorageDomainType.Master ) ; sd.setStatus ( StorageDomainStatus.Active ) ; sd.setAvailableDiskSize ( availableSpace ) ; sd.setUsedDiskSize ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) ; sd.setId ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ; return sd ; }
Source:
private void failureEventHandler ( final java.lang.Throwable caught ) { java.lang.String errorMessage ; if ( caught instanceof com.google.gwt.user.client.rpc.StatusCodeException ) { errorMessage = ( ( getConstants ( ) . requestToServerFailedWithCode ( ) ) + ": " ) + ( ( ( com.google.gwt.user.client.rpc.StatusCodeException ) ( caught ) ) . getStatusCode ( ) ) ; } else { errorMessage = ( ( getConstants ( ) . requestToServerFailed ( ) ) + ": " ) + ( caught.getLocalizedMessage ( ) ) ; } failureEventHandler ( errorMessage ) ; }

Target:
private void failureEventHandler ( final java.lang.Throwable caught ) { java.lang.String errorMessage ; if ( caught instanceof com.google.gwt.user.client.rpc.StatusCodeException ) { errorMessage = ( ( getConstants ( ) . requestToServerFailedWithCode ( ) ) + ": " ) + ( ( ( com.google.gwt.user.client.rpc.StatusCodeException ) ( caught ) ) . getStatusCode ( ) ) ; } else { errorMessage = ( ( getConstants ( ) . requestToServerFailed ( ) ) + ": " ) + ( caught.getLocalizedMessage ( ) ) ; } failureEventHandler ( null , java.util.Collections.singletonList ( errorMessage ) ) ; }
Source:
protected void setUpGetEntityExpectations ( int times , boolean notFound , org.ovirt.engine.core.common.businessentities.VDS entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : entity ) ) ; } if ( ! notFound ) { setUpGetCertificateInfo ( ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , boolean notFound , org.ovirt.engine.core.common.businessentities.VDS entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : entity ) ) ; } if ( ! notFound ) { setUpGetCertificateInfo ( ) ; } }
Source:
public static org.ovirt.engine.api.model.RSDL loadRsdl ( org.ovirt.engine.core.common.mode.ApplicationMode applicationMode ) throws java.io.IOException { java.lang.String fileName = ( applicationMode == ( org.ovirt.engine.core.common.mode.ApplicationMode.AllModes ) ) ? "/" + ( RsdlIOManager.RSDL_RESOURCE_NAME ) : "/" + ( RsdlIOManager.GLUSTER_RSDL_RESOURCE_NAME ) ; java.io.InputStream rsdlAsStrem = null ; try { rsdlAsStrem = org.ovirt.engine.api.rsdl.RsdlIOManager.loadAsStream ( fileName ) ; return javax.xml.bind.JAXB.unmarshal ( rsdlAsStrem , org.ovirt.engine.api.model.RSDL.class ) ; } finally { if ( rsdlAsStrem != null ) { rsdlAsStrem.close ( ) ; } } }

Target:
public static org.ovirt.engine.api.model.RSDL loadRsdl ( org.ovirt.engine.core.common.mode.ApplicationMode applicationMode ) throws java.io.IOException { java.lang.String fileName = ( applicationMode == ( org.ovirt.engine.core.common.mode.ApplicationMode.GlusterOnly ) ) ? "/" + ( RsdlIOManager.GLUSTER_RSDL_RESOURCE_NAME ) : "/" + ( RsdlIOManager.RSDL_RESOURCE_NAME ) ; java.io.InputStream rsdlAsStrem = null ; try { rsdlAsStrem = org.ovirt.engine.api.rsdl.RsdlIOManager.loadAsStream ( fileName ) ; return javax.xml.bind.JAXB.unmarshal ( rsdlAsStrem , org.ovirt.engine.api.model.RSDL.class ) ; } finally { if ( rsdlAsStrem != null ) { rsdlAsStrem.close ( ) ; } } }
Source:
protected void executeCommand ( ) { if ( ( ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) != null ) && ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.CanRemoveVmPoolWithoutReasons ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDAO ( ) . remove ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) ; org.ovirt.engine.core.bll.RemoveVmPoolCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { if ( ( ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) != null ) && ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.CanRemoveVmPoolWithoutReasons ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . remove ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) ; org.ovirt.engine.core.bll.RemoveVmPoolCommand.setSucceeded ( true ) ; } }
Source:
public void processResponse ( org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse response ) { org.codehaus.jackson.JsonNode id = response.getId ( ) ; if ( org.codehaus.jackson.node.NullNode.class . isInstance ( id ) ) { this . tracker.processIssue ( response ) ; } org.ovirt.vdsm.jsonrpc.client.internal.JsonRpcCall call = this . tracker.removeCall ( response.getId ( ) ) ; if ( call == null ) { return ; } call.addResponse ( response ) ; }

Target:
public void processResponse ( org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse response ) { org.codehaus.jackson.JsonNode id = response.getId ( ) ; if ( org.codehaus.jackson.node.NullNode.class . isInstance ( id ) ) { this . tracker.processIssue ( response ) ; } org.ovirt.vdsm.jsonrpc.client.internal.JsonRpcCall call = this . tracker.removeCall ( response.getId ( ) ) ; if ( call == null ) { this . log.error ( "No able to update response for {}" , response.getId ( ) ) ; return ; } call.addResponse ( response ) ; }
Source:
protected void onEntityChanged ( ) { if ( ( getEntity ( ) ) == null ) { return ; } super . onEntityChanged ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolumeEntity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( getEntity ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity glusterVolumeOption : glusterVolumeEntity.getOptions ( ) ) { list.add ( glusterVolumeOption ) ; } setItems ( list ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolumeEntity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( getEntity ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity glusterVolumeOption : glusterVolumeEntity.getOptions ( ) ) { list.add ( glusterVolumeOption ) ; } setItems ( list ) ; }
Source:
public static void GetNextAvailableDiskAliasNameByVMId ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) , aQuery ) ; }

Target:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testGetAllForRoleAndAdElement ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > result = dao.getAllForRoleAndAdElement ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions permission : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , permission.getRoleId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , permission.getAdElementId ( ) ) ; } }

Target:
public void testGetAllForRoleAndAdElement ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permission > result = dao.getAllForRoleAndAdElement ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , permission.getRoleId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , permission.getAdElementId ( ) ) ; } }
Source:
protected boolean validateVdsCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupDao ( ) . get ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; return vdsGroup == null ? failCanDoAction ( EngineMessage.VDS_CLUSTER_IS_NOT_VALID ) : ( vdsGroup.getArchitecture ( ) ) != ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getClusterArch ( ) ) ? failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_CANNOT_IMPORT_VM_ARCHITECTURE_NOT_SUPPORTED_BY_CLUSTER ) : true ; }

Target:
protected boolean validateVdsCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupDao ( ) . get ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; return vdsGroup == null ? failValidation ( EngineMessage.VDS_CLUSTER_IS_NOT_VALID ) : ( vdsGroup.getArchitecture ( ) ) != ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getClusterArch ( ) ) ? failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_CANNOT_IMPORT_VM_ARCHITECTURE_NOT_SUPPORTED_BY_CLUSTER ) : true ; }
Source:
public static void GetPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }

Target:
public static void GetSANWipeAfterDelete ( 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SANWipeAfterDelete , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void perform ( ) { if ( org.ovirt.engine.core.bll.PauseVmCommand.getVm ( ) . isRunning ( ) ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.Pause , new org.ovirt.engine.core.common.vdscommands.PauseVDSCommandParameters ( org.ovirt.engine.core.bll.PauseVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.PauseVmCommand.getVmId ( ) ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.PauseVmCommand.setSucceeded ( true ) ; } else { setActionReturnValue ( org.ovirt.engine.core.bll.PauseVmCommand.getVm ( ) . getStatus ( ) ) ; } }

Target:
protected void perform ( ) { if ( org.ovirt.engine.core.bll.PauseVmCommand.getVm ( ) . isRunning ( ) ) { setActionReturnValue ( runVdsCommand ( VDSCommandType.Pause , new org.ovirt.engine.core.common.vdscommands.PauseVDSCommandParameters ( org.ovirt.engine.core.bll.PauseVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.PauseVmCommand.getVmId ( ) ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.PauseVmCommand.setSucceeded ( true ) ; } else { setActionReturnValue ( org.ovirt.engine.core.bll.PauseVmCommand.getVm ( ) . getStatus ( ) ) ; } }
Source:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.VAR_NETWORK_ATTACHMENT_NOT_EXISTS_ENTITY , networkAttachmentId.toString ( ) ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { boolean doesNotReferenceExistingNetworkAttachment = networkAttachmentId == null ; if ( doesNotReferenceExistingNetworkAttachment ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.VAR_NETWORK_ATTACHMENT_NOT_EXISTS_ENTITY , networkAttachmentId.toString ( ) ) ) ; }
Source:
private void UpdateActionAvailability ( ) { getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( getSelectedItem ( ) ) != null ) || ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) > 0 ) ) ) ) ; }

Target:
private void updateActionAvailability ( ) { getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( getSelectedItem ( ) ) != null ) || ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) > 0 ) ) ) ) ; }
Source:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) == ( event.getNativeEvent ( ) . getKeyCode ( ) ) ) { model.setSearchString ( getView ( ) . getSearchString ( ) . getValue ( ) ) ; getView ( ) . getSearchButton ( ) . getCommand ( ) . Execute ( ) ; } }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) == ( event.getNativeEvent ( ) . getKeyCode ( ) ) ) { model.setSearchString ( getView ( ) . getSearchString ( ) . getValue ( ) ) ; getView ( ) . getSearchButton ( ) . getCommand ( ) . execute ( ) ; } }