auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static org.ovirt.engine.core.bll.provider.storage.OpenStackVolumeProviderProxy getFromStorageDomainId ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered , org.ovirt.engine.core.bll.provider.ProviderProxyFactory providerProxyFactory ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = getDbFacade ( ) . getStorageDomainDao ( ) . get ( storageDomainId , userID , isFiltered ) ; if ( storageDomain != null ) { org.ovirt.engine.core.common.businessentities.Provider provider = getDbFacade ( ) . getProviderDao ( ) . get ( new org.ovirt.engine.core.compat.Guid ( storageDomain.getStorage ( ) ) ) ; return providerProxyFactory.create ( provider ) ; } return null ; }

Target:
public static org.ovirt.engine.core.bll.provider.storage.OpenStackVolumeProviderProxy getFromStorageDomainId ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered , org.ovirt.engine.core.bll.provider.ProviderProxyFactory providerProxyFactory ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.dao.StorageDomainDao.class ) . get ( storageDomainId , userID , isFiltered ) ; if ( storageDomain != null ) { org.ovirt.engine.core.common.businessentities.Provider provider = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.dao.provider.ProviderDao.class ) . get ( new org.ovirt.engine.core.compat.Guid ( storageDomain.getStorage ( ) ) ) ; return providerProxyFactory.create ( provider ) ; } return null ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult isPassDiscardSupportedByUnderlyingStorageForDirectLun ( ) { java.lang.Long discardMaxSize = ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( disk ) ) . getLun ( ) . getDiscardMaxSize ( ) ; if ( ( discardMaxSize != null ) && ( discardMaxSize > 0 ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_FOR_DIRECT_LUN_BY_UNDERLYING_STORAGE , getDiskAliasVarReplacement ( ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult isPassDiscardSupportedByUnderlyingStorageForDirectLun ( ) { if ( ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( disk ) ) . getLun ( ) . supportsDiscard ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_FOR_DIRECT_LUN_BY_UNDERLYING_STORAGE , getDiskAliasVarReplacement ( ) ) ; }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public void getClusterList ( 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static void getGlusterSwiftServerServices ( 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.ImageTransfer imageTransfer ) { org.ovirt.engine.core.common.action.TransferDiskImageParameters params = new org.ovirt.engine.core.common.action.TransferDiskImageParameters ( ) ; if ( ( imageTransfer.isSetDirection ( ) ) && ( ( imageTransfer.getDirection ( ) ) == ( org.ovirt.engine.api.model.ImageTransferDirection.DOWNLOAD ) ) ) { params.setTransferType ( TransferType.Download ) ; } params.setImageId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( imageTransfer.getImage ( ) . getId ( ) ) ) ; return performCreate ( VdcActionType.TransferDiskImage , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetImageTransferById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.ImageTransfer imageTransfer ) { org.ovirt.engine.core.common.action.TransferDiskImageParameters params = new org.ovirt.engine.core.common.action.TransferDiskImageParameters ( ) ; if ( ( imageTransfer.isSetDirection ( ) ) && ( ( imageTransfer.getDirection ( ) ) == ( org.ovirt.engine.api.model.ImageTransferDirection.DOWNLOAD ) ) ) { params.setTransferType ( TransferType.Download ) ; } params.setImageId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( imageTransfer.getImage ( ) . getId ( ) ) ) ; return performCreate ( ActionType.TransferDiskImage , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetImageTransferById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public static org.ovirt.engine.core.bll.ValidationResult canRunActionOnNonManagedVm ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.bll.ValidationResult validationResult = ValidationResult.VALID ; if ( ! ( vm.isManagedVm ( ) ) ) { if ( ! ( org.ovirt.engine.core.bll.VmHandler.COMMANDS_ALLOWED_ON_NON_MANAGED_VMS.contains ( actionType ) ) ) { validationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_RUN_ACTION_ON_NON_MANAGED_VM ) ; } } return validationResult ; }

Target:
public static org.ovirt.engine.core.bll.ValidationResult canRunActionOnNonManagedVm ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.bll.ValidationResult validationResult = ValidationResult.VALID ; if ( ( ( vm.isHostedEngine ( ) ) && ( ! ( org.ovirt.engine.core.bll.VmHandler.COMMANDS_ALLOWED_ON_HOSTED_ENGINE.contains ( actionType ) ) ) ) || ( ( vm.isExternalVm ( ) ) && ( ! ( org.ovirt.engine.core.bll.VmHandler.COMMANDS_ALLOWED_ON_EXTERNAL_VMS.contains ( actionType ) ) ) ) ) { validationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_RUN_ACTION_ON_NON_MANAGED_VM ) ; } return validationResult ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateProvider , org.ovirt.engine.core.common.action.ProviderParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyModel ( resource.update ( getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpGetEntityExpectationsOnDoPopulate ( false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateProvider , org.ovirt.engine.core.common.action.ProviderParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyModel ( resource.update ( getModel ( 0 ) ) , 0 ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { allBonds = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; initNicModels ( ) ; hostSetupNetworksParametersData.allNics = allNics ; hostSetupNetworksParametersData.existingNetworkAttachments = existingNetworkAttachments ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; this . allNics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( returnValue2 ) ) ; queryNetworkAttachments ( ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; control.replay ( ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
public void testAddLunDiskMissingType ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . setType ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "HostStorage" , "testAddLunDiskMissingType" , "type" ) ; } }

Target:
public void testAddLunDiskMissingType ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . setType ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "HostStorage" , "testAddLunDiskMissingType" , "type" ) ; } }
Source:
protected void onReset ( ) { super . onReset ( ) ; if ( ! ( hasReportsModelRefreshEvent ( ) ) ) { org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.reportsWebappDeployed = false ; getModel ( ) . getReportModelRefreshEvent ( ) . addListener ( new org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.ReportsModelRefreshEvent ( ) ) ; } setSubTabPanelVisible ( false ) ; getModel ( ) . refreshReportModel ( ) ; }

Target:
protected void onReset ( ) { super . onReset ( ) ; if ( ! ( hasReportsModelRefreshEvent ( ) ) ) { org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.reportsWebappDeployed = false ; getModel ( ) . getReportsAvailabilityEvent ( ) . addListener ( new org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.ReportsModelRefreshEvent ( ) ) ; } setSubTabPanelVisible ( false ) ; getModel ( ) . refreshReportModel ( ) ; }
Source:
protected boolean validateCanUpdateReadOnly ( org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator ) { if ( updateReadOnlyRequested ( ) ) { if ( ( ( org.ovirt.engine.core.bll.storage.disk.UpdateVmDiskCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) && ( vmDeviceForVm.getIsPlugged ( ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return validate ( diskValidator.isReadOnlyPropertyCompatibleWithInterface ( ) ) ; } return true ; }

Target:
protected boolean validateCanUpdateReadOnly ( org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator ) { if ( updateReadOnlyRequested ( ) ) { if ( ( ( org.ovirt.engine.core.bll.storage.disk.UpdateVmDiskCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) && ( vmDeviceForVm.getIsPlugged ( ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return validate ( diskValidator.isReadOnlyPropertyCompatibleWithInterface ( ) ) ; } return true ; }
Source:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { 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.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { 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.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }
Source:
public void testGetAllByClusterAndNetworkId ( ) { dao.updateBrickNetworkId ( FixturesTool.GLUSTER_BRICK_UUID1 , FixturesTool.NETWORK_ENGINE ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = dao.getAllByClusterAndNetworkId ( FixturesTool.GLUSTER_CLUSTER_ID , FixturesTool.NETWORK_ENGINE ) ; org.junit.Assert.assertNotNull ( bricks ) ; org.junit.Assert.assertEquals ( 1 , bricks.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.GLUSTER_BRICK_UUID1 , bricks.get ( 0 ) . getId ( ) ) ; }

Target:
public void testGetAllByClusterAndNetworkId ( ) { dao.updateBrickNetworkId ( FixturesTool.GLUSTER_BRICK_UUID1 , FixturesTool.NETWORK_ENGINE ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = dao.getAllByClusterAndNetworkId ( FixturesTool.GLUSTER_CLUSTER_ID , FixturesTool.NETWORK_ENGINE ) ; org.junit.jupiter.api.Assertions.assertNotNull ( bricks ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , bricks.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.GLUSTER_BRICK_UUID1 , bricks.get ( 0 ) . getId ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNic ( java.lang.String name , java.lang.String bondName , org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol bootProtocol , java.lang.String network ) { return createVdsInterface ( name , false , bondName , null , bootProtocol , network , null , null ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNic ( java.lang.String name , java.lang.String bondName , org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol bootProtocol , java.lang.String network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( name , false , bondName , null , bootProtocol , network , null , null ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( nic ) ) . thenReturn ( nic ) ; return nic ; }
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.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public static void GetClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { networkEditor.setLabel ( constants.networkProfilePopup ( ) ) ; nameEditor.setLabel ( constants.nameNetworkIntefacePopup ( ) ) ; portMirroringEditor.setLabel ( constants.portMirroringNetworkIntefacePopup ( ) ) ; publicUseEditor.setLabel ( constants.profilePublicUseLabel ( ) ) ; }

Target:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { networkEditor.setLabel ( constants.networkProfilePopup ( ) ) ; nameEditor.setLabel ( constants.nameProfilePopup ( ) ) ; descriptionEditor.setLabel ( constants.descriptionProfilePopup ( ) ) ; portMirroringEditor.setLabel ( constants.portMirroringProfilePopup ( ) ) ; publicUseEditor.setLabel ( constants.publicUseProfilePopup ( ) ) ; }
Source:
private void NfsStorageModel_PathChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel senderModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) ( sender ) ) ; for ( java.lang.Object item : getItems ( ) ) { if ( ( item instanceof org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) && ( item != sender ) ) { org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) ( item ) ) ; model.getPath ( ) . setEntity ( senderModel.getPath ( ) . getEntity ( ) ) ; } } }

Target:
private void nfsStorageModel_PathChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel senderModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) ( sender ) ) ; for ( java.lang.Object item : getItems ( ) ) { if ( ( item instanceof org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) && ( item != sender ) ) { org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) ( item ) ) ; model.getPath ( ) . setEntity ( senderModel.getPath ( ) . getEntity ( ) ) ; } } }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , true ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , true ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ! ( sameEntity ( listModel.getSelectedItem ( ) , model ) ) ) { getView ( ) . setNotSelected ( model.IsVmUp ( ) ) ; } else { getView ( ) . setSelected ( ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { executeCommand ( getRunCommand ( ) ) ; }
Source:
private void updateAuditLog ( org.ovirt.engine.core.bll.storage.disk.cinder.ExtendCinderDiskCommand command , org.ovirt.engine.core.common.AuditLogType auditLogType , java.lang.Long imageSizeInGigabytes ) { command.addCustomValue ( "DiskAlias" , getDisk ( command ) . getDiskAlias ( ) ) ; command.addCustomValue ( "NewSize" , java.lang.String.valueOf ( imageSizeInGigabytes ) ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( command , auditLogType ) ; }

Target:
private void updateAuditLog ( org.ovirt.engine.core.bll.storage.disk.cinder.ExtendCinderDiskCommand command , org.ovirt.engine.core.common.AuditLogType auditLogType , java.lang.Long imageSizeInGigabytes ) { command.addCustomValue ( "DiskAlias" , getDisk ( command ) . getDiskAlias ( ) ) ; command.addCustomValue ( "NewSize" , java.lang.String.valueOf ( imageSizeInGigabytes ) ) ; auditLogDirector.log ( command , auditLogType ) ; }
Source:
private boolean shouldUpdateImageProperties ( ) { if ( ( getOldDisk ( ) . getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return false ; } org.ovirt.engine.core.compat.Guid oldQuotaId = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) . getQuotaId ( ) ; return ! ( java.util.Objects.equals ( oldQuotaId , getQuotaId ( ) ) ) ; }

Target:
private boolean updateImageParametersRequiringVmDownRequested ( ) { if ( ( getOldDisk ( ) . getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return false ; } org.ovirt.engine.core.compat.Guid oldQuotaId = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) . getQuotaId ( ) ; return ! ( java.util.Objects.equals ( oldQuotaId , getQuotaId ( ) ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface findInterfaceByIsBond ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ( ( i.getBonded ( ) ) != null ) && ( i.getBonded ( ) ) ) { return i ; } } return null ; }

Target:
public boolean match ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i ) { return ( ( i.getBonded ( ) ) != null ) && ( i.getBonded ( ) ) ; }
Source:
public void testIsNetworkInSyncWhenIpConfigurationIsEmpty ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockedIpConfiguration.hasIpv4PrimaryAddressSet ( ) ) . thenReturn ( false ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpConfigurationIsEmpty ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockedIpConfiguration.hasIpv4PrimaryAddressSet ( ) ) . thenReturn ( false ) ; org.mockito.Mockito.when ( mockedIpConfiguration.hasIpv6PrimaryAddressSet ( ) ) . thenReturn ( false ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public static void GetCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static void GetTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { 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.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , 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:
protected void syncSearch ( ) { org.ovirt.engine.core.common.queries.SearchParameters tempVar = new org.ovirt.engine.core.common.queries.SearchParameters ( applySortOptions ( getSearchString ( ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VM , isCaseSensitiveSearch ( ) ) ; tempVar.setMaxCount ( getSearchPageSize ( ) ) ; super . syncSearch ( VdcQueryType.Search , tempVar ) ; }

Target:
private void newVm ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) ) != null ) { return ; } java.util.List < org.ovirt.engine.ui.uicommonweb.UICommand > commands = new java.util.ArrayList < > ( ) ; commands.add ( org.ovirt.engine.ui.uicommonweb.UICommand.createDefaultOkUiCommand ( "OnSave" , this ) ) ; commands.add ( org.ovirt.engine.ui.uicommonweb.UICommand.createCancelUiCommand ( "Cancel" , this ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ( new org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior ( ) , this ) ; setupNewVmModel ( model , VmType.Server , getSystemTreeSelectedItem ( ) , commands ) ; }
Source:
public void testSortItems_retainOrder ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.TestItem > initial = java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_2_1 , org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_2_2 , org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_1_2 , org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_1_1 ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.TestItem > expected = java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_1_2 , org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_1_1 , org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_2_1 , org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_2_2 ) ; testedModel.setComparator ( makeValueComparator ( ) ) ; java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.TestItem > sorted = testedModel.sortItems ( initial ) ; org.junit.Assert.assertArrayEquals ( sorted.toArray ( ) , expected.toArray ( ) ) ; }

Target:
public void testSortItems_retainOrder ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.TestItem > initial = java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_2_1 , org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_2_2 , org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_1_2 , org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_1_1 ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.TestItem > expected = java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_1_2 , org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_1_1 , org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_2_1 , org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.ITEM_2_2 ) ; testedModel.setComparator ( makeValueComparator ( ) ) ; java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.SortedListModelTest.TestItem > sorted = testedModel.sortItems ( initial ) ; org.junit.jupiter.api.Assertions.assertArrayEquals ( sorted.toArray ( ) , expected.toArray ( ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage i = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeInBytes ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return i ; }

Target:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage i = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeInBytes ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return i ; }
Source:
private static void initClusterPolicySeverities ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_ADD_CLUSTER_POLICY , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_FAILED_TO_ADD_CLUSTER_POLICY , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_REMOVE_CLUSTER_POLICY , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_FAILED_TO_REMOVE_CLUSTER_POLICY , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_UPDATE_CLUSTER_POLICY , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_FAILED_TO_UPDATE_CLUSTER_POLICY , AuditLogSeverity.ERROR ) ; }

Target:
private static void initClusterPolicySeverities ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_ADD_CLUSTER_POLICY , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_FAILED_TO_ADD_CLUSTER_POLICY , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_REMOVE_CLUSTER_POLICY , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_FAILED_TO_REMOVE_CLUSTER_POLICY , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_UPDATE_CLUSTER_POLICY , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_FAILED_TO_UPDATE_CLUSTER_POLICY , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.FAILED_TO_CONNECT_TO_SCHEDULER_PROXY , AuditLogSeverity.ERROR ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunAction: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback != null ) { callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( actionType , parameters , null , state ) ) ; } }

Target:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; if ( callback != null ) { callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( actionType , parameters , null , state ) ) ; } }
Source:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
public void testCleanNotExpiredUsersSessionsWithUsers ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; }

Target:
private void initDataForClearTest ( java.lang.String key ) { container.setData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , key , org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.DbUser.class ) ) ; container.setData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.SOFT_LIMIT , org.apache.commons.lang.time.DateUtils.addMinutes ( new java.util.Date ( ) , ( - 1 ) ) ) ; }
Source:
protected boolean validateFreeSpace ( org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > snapshots = getAllImageSnapshots ( diskImage ) ; diskImage.getSnapshots ( ) . addAll ( snapshots ) ; } return validate ( storageDomainValidator.hasSpaceForClonedDisks ( disksList ) ) ; }

Target:
protected boolean validateFreeSpace ( org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > snapshots = getAllImageSnapshots ( diskImage ) ; diskImage.getSnapshots ( ) . addAll ( snapshots ) ; } return validate ( storageDomainValidator.hasSpaceForClonedDisks ( disksList ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Cluster setUpClusterExpectations ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.Cluster group = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ; org.mockito.Mockito.when ( group.getId ( ) ) . thenReturn ( id ) ; org.mockito.Mockito.when ( group.getStoragePoolId ( ) ) . thenReturn ( GUIDS [ 2 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClusterByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { id } , group ) ; return group ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Cluster setUpClusterExpectations ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.Cluster group = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ; org.mockito.Mockito.when ( group.getId ( ) ) . thenReturn ( id ) ; org.mockito.Mockito.when ( group.getStoragePoolId ( ) ) . thenReturn ( GUIDS [ 2 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { id } , group ) ; return group ; }
Source:
public javax.ws.rs.core.Response remove ( java.lang.String id , org.ovirt.engine.api.model.Action action ) { getEntity ( id ) ; return performAction ( VdcActionType.RemoveVm , new org.ovirt.engine.core.common.action.RemoveVmParameters ( asGuid ( id ) , ( ( action != null ) && ( action.isSetForce ( ) ) ? action.isForce ( ) : false ) ) ) ; }

Target:
protected org.ovirt.engine.api.model.VMs mapCollection ( java.util.List < org.ovirt.engine.api.model.VM > entities , boolean isFiltered ) { org.ovirt.engine.api.model.VMs collection = new org.ovirt.engine.api.model.VMs ( ) ; for ( org.ovirt.engine.api.model.VM entity : entities ) { org.ovirt.engine.api.model.VM vm = map ( entity ) ; if ( isFiltered ) { removeRestrictedInfoFromVM ( vm ) ; } collection.getVMs ( ) . add ( addLinks ( populate ( vm , entity ) ) ) ; } return collection ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > locksMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : getParameters ( ) . getParametersList ( ) ) { locksMap.put ( parameters.getImageGroupID ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.DISK , getDiskIsBeingMigratedMessage ( getDiskImageByDiskId ( parameters.getImageGroupID ( ) ) ) ) ) ; } return locksMap ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > locksMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getParametersList ( ) ) { locksMap.put ( parameters.getImageGroupID ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.DISK , getDiskIsBeingMigratedMessage ( getDiskImageByDiskId ( parameters.getImageGroupID ( ) ) ) ) ) ; } return locksMap ; }
Source:
public boolean isSessionValid ( java.lang.String token ) { boolean isValid = false ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( token ) ) { try { java.util.Map < java.lang.String , java.lang.Object > response = org.ovirt.engine.core.aaa.SSOOAuthServiceUtils.getTokenInfo ( token , "ovirt-ext=token-info:validate" ) ; if ( ( response.get ( "error" ) ) == null ) { isValid = true ; } } catch ( java.lang.Exception e ) { log.error ( ( "Session not valid session id = " + token ) , e.getMessage ( ) ) ; } } return isValid ; }

Target:
public boolean isSessionValid ( java.lang.String token ) { boolean isValid = false ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( token ) ) { try { java.util.Map < java.lang.String , java.lang.Object > response = org.ovirt.engine.core.aaa.SsoOAuthServiceUtils.getTokenInfo ( token , "ovirt-ext=token-info:validate" ) ; if ( ( response.get ( "error" ) ) == null ) { isValid = true ; } } catch ( java.lang.Exception e ) { log.error ( ( "Session not valid session id = " + token ) , e.getMessage ( ) ) ; } } return isValid ; }