auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean canDoAction ( ) { boolean returnValue = ( ( ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkStoragePool ( ) ) && ( checkStoragePoolStatusNotEqual ( StoragePoolStatus.Uninitialized , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ) ) && ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkStorageDomain ( ) ) ) && ( storageDomainStatusIsValid ( ) ) ) && ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.getStorageDomain ( ) . getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) || ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkMasterDomainIsUp ( ) ) ) ) && ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkForActiveVds ( ) ) != null ) ; return returnValue ; }

Target:
protected boolean canDoAction ( ) { boolean returnValue = ( ( ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkStoragePool ( ) ) && ( checkStoragePoolStatusNotEqual ( StoragePoolStatus.Uninitialized , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ) ) && ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkStorageDomain ( ) ) ) && ( storageDomainStatusIsValid ( ) ) ) && ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.getStorageDomain ( ) . getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) || ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkMasterDomainIsUp ( ) ) ) ) && ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkForActiveVds ( ) ) != null ) ; return returnValue ; }
Source:
public void nameInUse ( ) { org.mockito.Mockito.when ( oldHost.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }

Target:
public void nameInUse ( ) { org.mockito.Mockito.when ( oldHost.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.ArgumentMatchers.any ( java.lang.String.class ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }
Source:
public void moveShareableDiskToGlusterDomain ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }

Target:
public void moveShareableDiskToGlusterDomain ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setShareable ( true ) ; initializeCommand ( diskImage , VmEntityType.VM ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }
Source:
public void testSaveMemoryPciPassthroughFailure ( ) { cmd.getParameters ( ) . setSaveMemory ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ) . when ( vmValidator ) . vmNotHavingPciPassthroughDevices ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertThat ( cmd.getReturnValue ( ) . getValidationMessages ( ) , org.hamcrest.Matchers.hasItem ( EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES.name ( ) ) ) ; }

Target:
public void testNoMemoryPciPassthroughSuccess ( ) { cmd.getParameters ( ) . setSaveMemory ( false ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ) . when ( vmValidator ) . vmNotHavingPciPassthroughDevices ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
public void setMTUOverrideSupported ( boolean mtuOverrideSupported ) { this . mtuOverrideSupported = mtuOverrideSupported ; }

Target:
public void setMTUOverrideSupported ( boolean mtuOverrideSupported ) { this . mtuOverrideSupported = mtuOverrideSupported ; if ( ! mtuOverrideSupported ) { getHasMtu ( ) . setIsChangable ( false ) ; getMtu ( ) . setIsChangable ( false ) ; getHasMtu ( ) . setEntity ( false ) ; getMtu ( ) . setEntity ( null ) ; } else { getHasMtu ( ) . setIsChangable ( true ) ; getMtu ( ) . setIsChangable ( true ) ; } }
Source:
private void initFilter ( ) { filter = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.memory.sdfilters.StorageDomainSpaceRequirementsFilter ( memoryDisks ) ) ; org.mockito.Mockito.doNothing ( ) . when ( filter ) . updateDisksStorage ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) , org.mockito.ArgumentMatchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( filter ) . getStorageDomainValidator ( storageDomain ) ; }

Target:
private void initFilter ( ) { filter = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.memory.sdfilters.StorageDomainSpaceRequirementsFilter ( memoryDisks ) ) ; org.mockito.Mockito.doNothing ( ) . when ( filter ) . updateDisksStorage ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( filter ) . getStorageDomainValidator ( storageDomain ) ; }
Source:
private org.ovirt.engine.core.compat.Guid mockSourceImage ( ) { org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setImageId ( imageId ) ; org.mockito.Mockito.doReturn ( java.util.Collections.singletonList ( image ) ) . when ( cmd ) . getSourceImages ( ) ; return imageId ; }

Target:
private org.ovirt.engine.core.compat.Guid mockSourceImage ( ) { org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setImageId ( imageId ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > list = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; list.add ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; image.setStorageIds ( list ) ; image.setActualSize ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; image.setSize ( 40 ) ; org.mockito.Mockito.doReturn ( java.util.Collections.singletonList ( image ) ) . when ( cmd ) . getSourceImages ( ) ; return imageId ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.Cancel ( ) ; vmListModel.setGuideContext ( returnValueBase.getActionReturnValue ( ) ) ; vmListModel.UpdateActionAvailability ( ) ; vmListModel.getGuideCommand ( ) . Execute ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.cancel ( ) ; vmListModel.setGuideContext ( returnValueBase.getActionReturnValue ( ) ) ; vmListModel.updateActionAvailability ( ) ; vmListModel.getGuideCommand ( ) . execute ( ) ; } }
Source:
public void canDoChangeNameExists ( ) { java.lang.String newName = org.apache.commons.lang.StringUtils.reverse ( sd.getStorageName ( ) ) ; sd.setStorageName ( newName ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ) . when ( sdsDao ) . getByName ( newName ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NAME_ALREADY_EXIST ) ; }

Target:
public void validateChangeNameExists ( ) { java.lang.String newName = org.apache.commons.lang.StringUtils.reverse ( sd.getStorageName ( ) ) ; sd.setStorageName ( newName ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ) . when ( sdsDao ) . getByName ( newName ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NAME_ALREADY_EXIST ) ; }
Source:
static void verifyModelSpecific ( org.ovirt.engine.api.model.DiskSnapshot model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskSnapshotsResourceTest.DISK_ID.toString ( ) , model.getDisk ( ) . getId ( ) ) ; }

Target:
static void verifyModelSpecific ( org.ovirt.engine.api.model.DiskSnapshot model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskSnapshotsResourceTest.DISK_ID.toString ( ) , model.getDisk ( ) . getId ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult callHasUniqueName ( org.ovirt.engine.core.compat.Guid macPool1Id , org.ovirt.engine.core.compat.Guid macPool2Id , java.lang.String macPool1Name , java.lang.String macPool2Name ) { final org.ovirt.engine.core.common.businessentities.MacPool existingMacPool = new org.ovirt.engine.core.common.businessentities.MacPool ( ) ; existingMacPool.setId ( macPool1Id ) ; existingMacPool.setName ( macPool1Name ) ; org.mockito.Mockito.when ( macPoolDaoMock.getAll ( ) ) . thenReturn ( java.util.Arrays.asList ( existingMacPool ) ) ; macPool.setId ( macPool2Id ) ; macPool.setName ( macPool2Name ) ; return macPoolValidator.hasUniqueName ( ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult callHasUniqueName ( org.ovirt.engine.core.compat.Guid macPool1Id , org.ovirt.engine.core.compat.Guid macPool2Id , java.lang.String macPool1Name , java.lang.String macPool2Name ) { final org.ovirt.engine.core.common.businessentities.MacPool existingMacPool = new org.ovirt.engine.core.common.businessentities.MacPool ( ) ; existingMacPool.setId ( macPool1Id ) ; existingMacPool.setName ( macPool1Name ) ; org.mockito.Mockito.when ( macPoolDaoMock.getAll ( ) ) . thenReturn ( java.util.Collections.singletonList ( existingMacPool ) ) ; macPool.setId ( macPool2Id ) ; macPool.setName ( macPool2Name ) ; return macPoolValidator.hasUniqueName ( ) ; }
Source:
public void createCommand ( ) { org.ovirt.engine.core.common.action.RunVmParams param = new org.ovirt.engine.core.common.action.RunVmParams ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > ( param ) ) ; mockIsoDomainListSyncronizer ( ) ; mockSuccessfulRunVmValidator ( ) ; mockSuccessfulSnapshotValidator ( ) ; mockBackend ( ) ; }

Target:
public void createCommand ( ) { org.ovirt.engine.core.common.action.RunVmParams param = new org.ovirt.engine.core.common.action.RunVmParams ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > ( param ) ) ; mockIsoDomainListSyncronizer ( ) ; mockSuccessfulRunVmValidator ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . initParametersForExternalNetworks ( ) ; mockSuccessfulSnapshotValidator ( ) ; mockBackend ( ) ; }
Source:
public void validateFailsWhenCreateAllSnapshotFromVmValidationFails ( ) { createParameters ( srcStorageId , dstStorageId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . validateCreateAllSnapshotsFromVmCommand ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }

Target:
public void validateVmShareableDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED.toString ( ) ) ) ; }
Source:
protected abstract void toggleGhost ( T value , V widget , boolean becomingGhost ) ;

Target:
private void toggleEnabled ( T value , V widget ) { setButtonsEnabled ( widget , enabled ) ; if ( widget instanceof com.google.gwt.user.client.ui.HasEnabled ) { ( ( com.google.gwt.user.client.ui.HasEnabled ) ( widget ) ) . setEnabled ( enabled ) ; } if ( ( enabled ) && ( isGhost ( value ) ) ) { toggleGhost ( value , widget , true ) ; } }
Source:
protected void updateSelectedLunWarning ( org.ovirt.engine.ui.uicommonweb.models.storage.LunModel lunModel ) { org.ovirt.engine.core.common.businessentities.LUNs lun = ( ( org.ovirt.engine.core.common.businessentities.LUNs ) ( lunModel.getEntity ( ) ) ) ; java.lang.String warning = org.ovirt.engine.ui.common.widget.uicommon.storage.AbstractSanStorageList.constants.empty ( ) ; if ( ( lun.getStorageDomainId ( ) ) != null ) { warning = org.ovirt.engine.ui.common.widget.uicommon.storage.AbstractSanStorageList.messages.lunAlreadyPartOfStorageDomainWarning ( lun.getStorageDomainName ( ) ) ; } else if ( ( lun.getDiskId ( ) ) != null ) { warning = org.ovirt.engine.ui.common.widget.uicommon.storage.AbstractSanStorageList.messages.lunUsedByDiskWarning ( lun.getDiskAlias ( ) ) ; } model.setSelectedLunWarning ( warning ) ; }

Target:
protected void updateSelectedLunWarning ( org.ovirt.engine.ui.uicommonweb.models.storage.LunModel lunModel ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = ( ( org.ovirt.engine.core.common.businessentities.storage.LUNs ) ( lunModel.getEntity ( ) ) ) ; java.lang.String warning = org.ovirt.engine.ui.common.widget.uicommon.storage.AbstractSanStorageList.constants.empty ( ) ; if ( ( lun.getStorageDomainId ( ) ) != null ) { warning = org.ovirt.engine.ui.common.widget.uicommon.storage.AbstractSanStorageList.messages.lunAlreadyPartOfStorageDomainWarning ( lun.getStorageDomainName ( ) ) ; } else if ( ( lun.getDiskId ( ) ) != null ) { warning = org.ovirt.engine.ui.common.widget.uicommon.storage.AbstractSanStorageList.messages.lunUsedByDiskWarning ( lun.getDiskAlias ( ) ) ; } model.setSelectedLunWarning ( warning ) ; }
Source:
public org.ovirt.engine.sdk.entities.Action replace ( org.ovirt.engine.sdk.entities.Action action , java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/replace" ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.entities.Response delete ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . delete ( url , org.ovirt.engine.sdk.entities.Response.class , headers ) ; }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getHostById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForDisplayNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( getNetworkCluster ( ) . isDisplay ( ) ) && ( ( ipConfiguration == null ) || ( ( ipConfiguration.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL ) . when ( failWhen ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForDisplayNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( getNetworkCluster ( ) . isDisplay ( ) ) && ( ( ipConfiguration == null ) || ( ( ipConfiguration.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL ) . when ( failWhen ) ; }
Source:
protected void addVmInterfaces ( ) { super . addVmInterfaces ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand.getVm ( ) . getInterfaces ( ) ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addInterface ( org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand.getVmId ( ) , iface.getId ( ) , iface.isPlugged ( ) , false ) ; } }

Target:
protected void addVmInterfaces ( ) { super . addVmInterfaces ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand.getVm ( ) . getInterfaces ( ) ) { org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand.getVmDeviceUtils ( ) . addInterface ( org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand.getVmId ( ) , iface.getId ( ) , iface.isPlugged ( ) , false ) ; } }
Source:
public static void GetVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }

Target:
public static void GetVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetDomainExpectations ( StorageType.NFS , true ) ; setUpGetConnectionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.DetachStorageDomainFromPool , org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetDomainExpectations ( StorageType.NFS , true ) ; setUpGetConnectionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.DetachStorageDomainFromPool , org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private java.lang.Integer calcMaxVCpu ( ) { java.lang.Integer maxSockets = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumOfVmSockets , vm.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) ; java.lang.Integer maxVCpus = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumOfVmCpus , vm.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) ; int threadsPerCore = vm.getThreadsPerCpu ( ) ; int cpuPerSocket = vm.getCpuPerSocket ( ) ; maxVCpus = ( cpuPerSocket * threadsPerCore ) * ( java.lang.Math.min ( maxSockets , ( maxVCpus / ( cpuPerSocket * threadsPerCore ) ) ) ) ; return maxVCpus ; }

Target:
private java.lang.Integer calcMaxVCpu ( ) { java.lang.Integer maxSockets = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumOfVmSockets , vm.getClusterCompatibilityVersion ( ) . getValue ( ) ) ; java.lang.Integer maxVCpus = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumOfVmCpus , vm.getClusterCompatibilityVersion ( ) . getValue ( ) ) ; int threadsPerCore = vm.getThreadsPerCpu ( ) ; int cpuPerSocket = vm.getCpuPerSocket ( ) ; maxVCpus = ( cpuPerSocket * threadsPerCore ) * ( java.lang.Math.min ( maxSockets , ( maxVCpus / ( cpuPerSocket * threadsPerCore ) ) ) ) ; return maxVCpus ; }
Source:
private void fillConnectionDetailsIfNeeded ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { if ( ( connection.getid ( ) ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > dbConnections = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . getAllForConnection ( connection ) ; if ( ! ( dbConnections.isEmpty ( ) ) ) { connection.setid ( dbConnections.get ( 0 ) . getid ( ) ) ; } } }

Target:
public static org.ovirt.engine.core.common.businessentities.StorageServerConnections findConnectionWithSameDetails ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . getAllForConnection ( connection ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections dbConnection : connections ) { if ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( dbConnection.getpassword ( ) , connection.getpassword ( ) ) ) { return dbConnection ; } } return null ; }
Source:
public org.ovirt.optimizer.common.ScoreResult verifyResult ( org.ovirt.optimizer.common.Result result , @ javax.ws.rs.PathParam ( value = "cluster" ) java.lang.String cluster ) { response.getOutputHeaders ( ) . putSingle ( "Access-Control-Allow-Origin" , "*" ) ; response.getOutputHeaders ( ) . putSingle ( "Access-Control-Allow-Methods" , "POST" ) ; response.getOutputHeaders ( ) . putSingle ( "Access-Control-Allow-Headers" , "Content-Type" ) ; return optimizer.recomputeScore ( cluster , result ) ; }

Target:
public org.ovirt.optimizer.rest.dto.ScoreResult verifyResult ( org.ovirt.optimizer.rest.dto.Result result , @ javax.ws.rs.PathParam ( value = "cluster" ) java.lang.String cluster ) { response.getOutputHeaders ( ) . putSingle ( "Access-Control-Allow-Origin" , "*" ) ; response.getOutputHeaders ( ) . putSingle ( "Access-Control-Allow-Methods" , "POST" ) ; response.getOutputHeaders ( ) . putSingle ( "Access-Control-Allow-Headers" , "Content-Type" ) ; return optimizer.recomputeScore ( cluster , result ) ; }
Source:
private java.lang.String getNetworkName ( ) { return org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) . getNetworkName ( ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.Network getNetwork ( ) { if ( ( ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) . getVnicProfileId ( ) ) != null ) && ( ( network ) == null ) ) { network = org.ovirt.engine.core.bll.network.cluster.NetworkHelper.getNetworkByVnicProfileId ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) . getVnicProfileId ( ) ) ; } return network ; }
Source:
private static void assertDiskDescriptionMap ( java.lang.String diskAlias , java.lang.String diskDescription ) throws java.io.IOException { org.junit.Assert.assertEquals ( "Should be map of disk alias and disk description" , java.lang.String.format ( ( "{\"DiskAlias\":\"%s\"," + "\"DiskDescription\":\"%s\"}" ) , diskAlias , org.apache.commons.lang.StringUtils.defaultString ( diskDescription ) ) , org.ovirt.engine.core.bll.ImagesHandler.getJsonDiskDescription ( diskAlias , diskDescription ) ) ; }

Target:
private static void assertDiskDescriptionMap ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) throws java.io.IOException { org.junit.Assert.assertEquals ( "Should be map of disk alias and disk description" , java.lang.String.format ( ( "{\"DiskAlias\":\"%s\"," + "\"DiskDescription\":\"%s\"}" ) , disk.getDiskAlias ( ) , org.apache.commons.lang.StringUtils.defaultString ( disk.getDiskDescription ( ) ) ) , org.ovirt.engine.core.bll.ImagesHandler.getJsonDiskDescription ( disk ) ) ; }
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 getAttachedTagsToHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.setAttachedTagsConverter ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTagsByVdsId , new org.ovirt.engine.core.common.queries.GetTagsByVdsIdParameters ( id.toString ( ) ) , aQuery ) ; }
Source:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { object.getRemoveLine ( ) . execute ( ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel object ) { updateKeyTitle ( object ) ; object.getKeys ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( org.ovirt.engine.ui.common.widget.form.key_value.KeyValueLineWidget.this , object ) ; updateKeyTitle ( object ) ; } } ) ; driver.edit ( object ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.GlusterVolumeRemoveBricks , org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters.class , new java.lang.String [ ] { "VolumeId" , "Bricks" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.volumeId , getBricksToRemove ( ) } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.volumeId } , helper.getVolumeEntity ( 0 ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.GlusterVolumeRemoveBricks , org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters.class , new java.lang.String [ ] { "VolumeId" , "Bricks" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.volumeId , getBricksToRemove ( ) } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
protected org.ovirt.engine.api.model.StorageDomain postPopulate ( org.ovirt.engine.api.model.StorageDomain model ) { model.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.StorageDomainType.class ) . value ( ) ) ; model.getStorage ( ) . setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.StorageType.class ) . value ( ) ) ; model.setStorageFormat ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.restapi.model.StorageFormat.class ) . value ( ) ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.StorageDomain postPopulate ( org.ovirt.engine.api.model.StorageDomain model ) { model.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.StorageDomainType.class ) ) ; model.getStorage ( ) . setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.StorageType.class ) ) ; model.setStorageFormat ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.StorageFormat.class ) ) ; return model ; }
Source:
public void shouldNotElectInactiveHostedEngineDomain ( ) { prepareStorageDomainForElection ( StorageDomainStatus.Inactive , org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBaseTest.HE_STORAGE_DOMAIN_NAME ) ; org.mockito.Mockito.when ( hostedEngineHelper.isHostedEngineStorageDomain ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ) . thenReturn ( true ) ; org.junit.Assert.assertNull ( cmd.electNewMaster ( false , true , false ) ) ; }

Target:
public void shouldNotElectActiveHostedEngineDomain ( ) { prepareStorageDomainForElection ( StorageDomainStatus.Active , org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBaseTest.HE_STORAGE_DOMAIN_NAME , true ) ; org.junit.Assert.assertNull ( cmd.electNewMaster ( ) ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { return createTask ( asyncTaskCreationInfo , parentCommand , null , entityType , entityIds ) ; }

Target:
public java.lang.Void runInTransaction ( ) { buildChildCommandInfos ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > entry : childCommandInfoMap.entrySet ( ) ) { org.ovirt.engine.core.bll.CommandBase < ? > command = getBackendCommandObjectsHandler ( ) . createAction ( entry.getValue ( ) . getFirst ( ) , entry.getValue ( ) . getSecond ( ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; childCommandsMap.put ( entry.getKey ( ) , command ) ; } return null ; }
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 : getStorageModels ( ) ) { 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:
private void UpdateTotalDiskSize ( ) { java.lang.Integer available = getStorageDynamicData ( ) . getavailable_disk_size ( ) ; java.lang.Integer used = getStorageDynamicData ( ) . getused_disk_size ( ) ; if ( ( available != null ) && ( used != null ) ) { setTotalDiskSize ( ( available + used ) ) ; } else { setTotalDiskSize ( 0 ) ; } }

Target:
private void UpdateTotalDiskSize ( ) { java.lang.Integer available = getStorageDynamicData ( ) . getAvailableDiskSize ( ) ; java.lang.Integer used = getStorageDynamicData ( ) . getUsedDiskSize ( ) ; if ( ( available != null ) && ( used != null ) ) { setTotalDiskSize ( ( available + used ) ) ; } else { setTotalDiskSize ( 0 ) ; } }
Source:
protected boolean areTemplateImagesInStorageReady ( org.ovirt.engine.core.compat.Guid storageId ) { return org.ovirt.engine.core.bll.VmTemplateCommand.isVmTemplateImagesReady ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplate ( ) , storageId , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , false , true , true , destStorages.isEmpty ( ) , storageToDisksMap.get ( storageId ) ) ; }

Target:
protected boolean areTemplateImagesInStorageReady ( org.ovirt.engine.core.compat.Guid storageId ) { return org.ovirt.engine.core.bll.VmTemplateCommand.isVmTemplateImagesReady ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplate ( ) , storageId , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getValidationMessages ( ) , false , true , true , destStorages.isEmpty ( ) , storageToDisksMap.get ( storageId ) ) ; }
Source:
void initUncaughtExceptionHandler ( final java.util.logging.Logger rootLogger ) { com.google.gwt.core.client.GWT.setUncaughtExceptionHandler ( new com.google.gwt.core.client.GWT.UncaughtExceptionHandler ( ) { @ java.lang.Override public void onUncaughtException ( java.lang.Throwable t ) { rootLogger.log ( java.util.logging.Level.SEVERE , "Uncaught exception: " , t ) ; alertManager.showUncaughtExceptionAlert ( t ) ; } } ) ; }

Target:
void initUncaughtExceptionHandler ( final java.util.logging.Logger rootLogger , final java.util.logging.Logger remoteLogger ) { com.google.gwt.core.client.GWT.setUncaughtExceptionHandler ( new com.google.gwt.core.client.GWT.UncaughtExceptionHandler ( ) { @ java.lang.Override public void onUncaughtException ( java.lang.Throwable t ) { rootLogger.log ( java.util.logging.Level.SEVERE , "Uncaught exception: " , t ) ; remoteLogger.log ( java.util.logging.Level.SEVERE , "Uncaught exception: " , t ) ; if ( org.ovirt.engine.ui.common.DisplayUncaughtUIExceptions.getValue ( ) ) { alertManager.showUncaughtExceptionAlert ( t ) ; } } } ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue == null ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; initNetworkInterfaces ( networkBehavior , nics ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue == null ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; updateNetworkInterfaces ( networkBehavior , nics ) ; }
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 getGlusterSwiftServices ( 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.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public void testGetEntityNameByIdAndTypeForStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.storage_domains storageDomain = dbFacade.getStorageDomainDAO ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertNotNull ( storageDomain ) ; java.lang.String name = storageDomain.getstorage_name ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_DOMAIN_ID , VdcObjectType.Storage ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.storage_domains storageDomain = dbFacade.getStorageDomainDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertNotNull ( storageDomain ) ; java.lang.String name = storageDomain.getstorage_name ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_DOMAIN_ID , VdcObjectType.Storage ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters buildDeleteMemoryImageParams ( java.util.List < org.ovirt.engine.core.compat.Guid > guids ) { return org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.storage.domain.PostDeleteActionHandler.class ) . fixParameters ( new org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters ( guids.get ( 1 ) , guids.get ( 0 ) , guids.get ( 2 ) , isPostZero ( ) , false ) ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters buildDeleteMemoryImageParams ( java.util.List < org.ovirt.engine.core.compat.Guid > guids ) { boolean discardAfterDelete = storageDomainDao.get ( guids.get ( 0 ) ) . isDiscardAfterDelete ( ) ; return postDeleteActionHandler.fixParameters ( new org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters ( guids.get ( 1 ) , guids.get ( 0 ) , guids.get ( 2 ) , isPostZero ( ) , discardAfterDelete , false ) ) ; }
Source:
public void getMaxVmPriority ( 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 100 ; } return source ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPriorityMaxValue , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getHostListByStatus ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > aQuery , org.ovirt.engine.core.common.businessentities.VDSStatus status , boolean doRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.SearchParameters searchParameters = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Host: " + ( status == null ? "" : "status=" + ( status.name ( ) ) ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; searchParameters.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , ( doRefresh ? searchParameters : searchParameters.withoutRefresh ( ) ) , aQuery ) ; }