auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; sb.append ( "valid: " ) . append ( valid ) . append ( " sum: " ) . append ( sum ) . append ( "priority: " ) . append ( priority ) . append ( " weight: " ) . append ( weight ) . append ( " hostport: " ) . append ( address ) ; return sb.toString ( ) ; }

Target:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "valid" , valid ) . append ( "sum" , sum ) . append ( "priority" , priority ) . append ( "weight" , weight ) . append ( "hostport" , address ) . build ( ) ; }
Source:
private void handleTicketGenerationError ( org.ovirt.engine.core.common.action.VdcReturnValueBase commandResult ) { org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; if ( commandResult.getValidationMessages ( ) . contains ( EngineMessage.USER_CANNOT_FORCE_RECONNECT_TO_VM.name ( ) ) ) { org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery.getQueryReturnValue ( ) . setExceptionString ( EngineMessage.USER_CANNOT_FORCE_RECONNECT_TO_VM.name ( ) ) ; return ; } org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery.getQueryReturnValue ( ) . setExceptionString ( EngineMessage.SETTING_VM_TICKET_FAILED.name ( ) ) ; }

Target:
private void handleTicketGenerationError ( org.ovirt.engine.core.common.action.ActionReturnValue commandResult ) { org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; if ( commandResult.getValidationMessages ( ) . contains ( EngineMessage.USER_CANNOT_FORCE_RECONNECT_TO_VM.name ( ) ) ) { org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery.getQueryReturnValue ( ) . setExceptionString ( EngineMessage.USER_CANNOT_FORCE_RECONNECT_TO_VM.name ( ) ) ; return ; } org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery.getQueryReturnValue ( ) . setExceptionString ( EngineMessage.SETTING_VM_TICKET_FAILED.name ( ) ) ; }
Source:
public void testGetAllUsersWithPermissionsOnEntity ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > result = dao.getAllForEntity ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , org.ovirt.engine.core.dao.PRIVILEGED_USER_SESSION_ID , true , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 2 , result.size ( ) ) ; org.ovirt.engine.core.dao.PermissionDAOTest.assertGetAllForEntityResult ( result ) ; }

Target:
public void testGetAllUsersWithPermissionsOnEntity ( ) { org.junit.Assert.assertNotNull ( privilegedUserSession ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > result = dao.getAllForEntity ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , privilegedUserSession.getId ( ) , true , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 2 , result.size ( ) ) ; org.ovirt.engine.core.dao.PermissionDAOTest.assertGetAllForEntityResult ( result ) ; }
Source:
private void managePrestartedVmsInPool ( org.ovirt.engine.core.common.businessentities.VmPool vmPool ) { org.ovirt.engine.core.compat.Guid vmPoolId = vmPool.getVmPoolId ( ) ; int prestartedVms = org.ovirt.engine.core.bll.VmPoolCommandBase.getNumOfPrestartedVmsInPool ( vmPoolId , new java.util.ArrayList < > ( ) ) ; int missingPrestartedVms = ( vmPool.getPrestartedVms ( ) ) - prestartedVms ; if ( missingPrestartedVms > 0 ) { int numOfVmsToPrestart = java.lang.Math.min ( missingPrestartedVms , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VmPoolMonitorBatchSize ) ) ; org.ovirt.engine.core.bll.VmPoolMonitor.log.info ( "VmPool '{}' is missing prestarted Vms, attempting to prestart Vms" , vmPoolId , missingPrestartedVms , numOfVmsToPrestart ) ; prestartVms ( vmPoolId , numOfVmsToPrestart ) ; } }

Target:
private void managePrestartedVmsInPool ( org.ovirt.engine.core.common.businessentities.VmPool vmPool ) { org.ovirt.engine.core.compat.Guid vmPoolId = vmPool.getVmPoolId ( ) ; int prestartedVms = org.ovirt.engine.core.bll.VmPoolCommandBase.getNumOfPrestartedVmsInPool ( vmPoolId , new java.util.ArrayList < > ( ) ) ; int missingPrestartedVms = ( vmPool.getPrestartedVms ( ) ) - prestartedVms ; if ( missingPrestartedVms > 0 ) { int numOfVmsToPrestart = java.lang.Math.min ( missingPrestartedVms , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VmPoolMonitorBatchSize ) ) ; org.ovirt.engine.core.bll.VmPoolMonitor.log.info ( "VmPool '{}' is missing prestarted VMs, attempting to prestart VMs" , vmPoolId , missingPrestartedVms , numOfVmsToPrestart ) ; prestartVms ( vmPoolId , numOfVmsToPrestart ) ; } }
Source:
public void setVmIdOnHostDeviceTest ( ) { org.ovirt.engine.core.common.businessentities.HostDevice before = getNetworkDevice ( ) ; org.junit.Assert.assertNull ( before.getVmId ( ) ) ; org.ovirt.engine.core.compat.Guid vmId = FixturesTool.VM_WITH_NO_ATTACHED_DISKS ; dao.setVmIdOnHostDevice ( before.getId ( ) , vmId ) ; before.setVmId ( vmId ) ; org.ovirt.engine.core.common.businessentities.HostDevice after = dao.get ( before.getId ( ) ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void setVmIdOnHostDeviceTest ( ) { org.ovirt.engine.core.common.businessentities.HostDevice before = getNetworkDevice ( ) ; org.junit.jupiter.api.Assertions.assertNull ( before.getVmId ( ) ) ; org.ovirt.engine.core.compat.Guid vmId = FixturesTool.VM_WITH_NO_ATTACHED_DISKS ; dao.setVmIdOnHostDevice ( before.getId ( ) , vmId ) ; before.setVmId ( vmId ) ; org.ovirt.engine.core.common.businessentities.HostDevice after = dao.get ( before.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( before , after ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; return qRetVal.getSucceeded ( ) ? qRetVal.< java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) : null ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ) ; return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( qRetVal.getSucceeded ( ) ? qRetVal.getReturnValue ( ) : java.util.Collections.emptyList ( ) ) ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.models.userportal.IUserPortalListModel flush ( ) { ctrlAltDel.asEditor ( ) . getSubEditor ( ) . getValue ( ) ; enableUsbAutoshare.asEditor ( ) . getSubEditor ( ) . getValue ( ) ; openInFullScreen.asEditor ( ) . getSubEditor ( ) . getValue ( ) ; useLocalDrives.asEditor ( ) . getSubEditor ( ) . getValue ( ) ; return model ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.userportal.IUserPortalListModel flush ( ) { flushCheckBoxes ( ctrlAltDel , enableUsbAutoshare , openInFullScreen , useLocalDrives , wanEnabled ) ; return model ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmImageDisks ( ) { if ( ( cachedVmImageDisks ) == null ) { cachedVmImageDisks = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( getVmDisks ( ) , true , false , false ) ; cachedVmImageDisks.addAll ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterDisksBasedOnCinder ( getVmDisks ( ) , true ) ) ; } return cachedVmImageDisks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmImageDisks ( ) { if ( ( cachedVmImageDisks ) == null ) { cachedVmImageDisks = org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.filterImageDisks ( getVmDisks ( ) , org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.ONLY_NOT_SHAREABLE ) ; cachedVmImageDisks.addAll ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterDisksBasedOnCinder ( getVmDisks ( ) , true ) ) ; } return cachedVmImageDisks ; }
Source:
protected boolean isPostZero ( ) { if ( ( cachedPostZero ) == null ) { cachedPostZero = vm.getDiskMap ( ) . values ( ) . contains ( new java.lang.Object ( ) { @ java.lang.Override public boolean equals ( java.lang.Object obj ) { return ( ( org.ovirt.engine.core.common.businessentities.Disk ) ( obj ) ) . isWipeAfterDelete ( ) ; } } ) ; } return cachedPostZero ; }

Target:
protected boolean isPostZero ( ) { if ( ( cachedPostZero ) == null ) { cachedPostZero = isVmContainsWipeAfterDeleteDisk ( ) ; } return cachedPostZero ; }
Source:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , bond.getName ( ) ) ; }

Target:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = java.util.Collections.singletonList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , bond.getName ( ) ) ; }
Source:
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 ) ; }

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 Init ( ) { for ( org.ovirt.engine.core.common.businessentities.StoragePool sp : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . getAll ( ) ) { if ( ! ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.containsKey ( sp.getId ( ) ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.put ( sp.getId ( ) , new org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData ( sp.getId ( ) ) ) ; } } }

Target:
public static void init ( ) { for ( org.ovirt.engine.core.common.businessentities.StoragePool sp : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . getAll ( ) ) { if ( ! ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.containsKey ( sp.getId ( ) ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.put ( sp.getId ( ) , new org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData ( sp.getId ( ) ) ) ; } } }
Source:
public void setUp ( ) { org.ovirt.engine.core.vdsbroker.VirtMonitoringStrategyTest.mcr.mockConfigValue ( ConfigValues.CheckMixedRhelVersions , Version.v3_5 , true ) ; }

Target:
public void testAllowRhel7InRhel6 ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createBaseVds ( ) ; vdsFromDb.setHostOs ( "RHEL - 6Server - 6.5.0.1.el6" ) ; vds.setHostOs ( "RHEL - 7Server - 1.el7" ) ; vdsGroup.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; virtStrategy.processSoftwareCapabilities ( vds ) ; org.junit.Assert.assertFalse ( vds.getStatus ( ) . equals ( VDSStatus.NonOperational ) ) ; }
Source:
public void qosBondSpeedReported ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosBondSpeedSetup ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED , null ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
protected < T > Q resolveCreated ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver ) { try { return entityResolver.resolve ( ( ( T ) ( result.getActionReturnValue ( ) ) ) ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; return null ; } }

Target:
protected < T > Q resolveCreated ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver ) { try { return entityResolver.resolve ( ( ( T ) ( result.getActionReturnValue ( ) ) ) ) ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.handleError ( e , false ) ; } }
Source:
public boolean isSearchUsingTags ( ) { return ( ( mOrigText.contains ( "tag" ) ) || ( ( ( getSearchObjectStr ( ) ) != null ) && ( getSearchObjectStr ( ) . equals ( SearchObjects.VDC_USER_OBJ_NAME ) ) ) ) || ( getCrossRefObjList ( ) . contains ( SearchObjects.VDC_STORAGE_DOMAIN_OBJ_NAME ) ) ; }

Target:
public boolean isSearchUsingTags ( ) { return ( ( ( mOrigText.contains ( "tag" ) ) || ( ( ( getSearchObjectStr ( ) ) != null ) && ( getSearchObjectStr ( ) . equals ( SearchObjects.VDC_USER_OBJ_NAME ) ) ) ) || ( getCrossRefObjList ( ) . contains ( SearchObjects.VDC_STORAGE_POOL_OBJ_NAME ) ) ) || ( getCrossRefObjList ( ) . contains ( SearchObjects.VDC_STORAGE_DOMAIN_OBJ_NAME ) ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVdsGroup , org.ovirt.engine.core.common.action.VdsGroupParametersBase.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVdsGroup , org.ovirt.engine.core.common.action.VdsGroupParametersBase.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.ActionGroup > > aQuery , org.ovirt.engine.core.compat.Guid roleId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.ImageTransfer imageTransfer ) { org.ovirt.engine.core.common.action.UploadDiskImageParameters params = new org.ovirt.engine.core.common.action.UploadDiskImageParameters ( ) ; params.setImageId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( imageTransfer.getImage ( ) . getId ( ) ) ) ; params.setKeepaliveInterval ( ConfigurationValues.UploadImageUiInactivityTimeoutInSeconds.getValue ( ) ) ; return performCreate ( VdcActionType.UploadDiskImage , 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 ( ) ; params.setImageId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( imageTransfer.getImage ( ) . getId ( ) ) ) ; params.setKeepaliveInterval ( ConfigurationValues.UploadImageUiInactivityTimeoutInSeconds.getValue ( ) ) ; 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 ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > getStorageQuotaListParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : diskInfoDestinationMap.values ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( disk.getQuotaId ( ) , disk.getstorage_ids ( ) . get ( 0 ) , disk.getSizeInGigabytes ( ) ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : diskInfoDestinationMap.values ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaStorageConsumptionParameter.QuotaAction.CONSUME , disk.getstorage_ids ( ) . get ( 0 ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } return list ; }
Source:
protected static org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain currDomain : domainsInPool ) { org.ovirt.engine.core.bll.VmHandler.updateDisksStorage ( currDomain , disksList ) ; if ( ( ( currDomain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( ( currDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) && ( org.ovirt.engine.core.bll.VmHandler.validateSpaceRequirements ( currDomain , disksList ) ) ) { return currDomain ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.Snapshot getActiveSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : vm.getSnapshots ( ) ) { if ( ( snapshot.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.ACTIVE ) ) { return snapshot ; } } return null ; }
Source:
public static org.ovirt.engine.api.model.BootProtocol map ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol networkBootProtocol , org.ovirt.engine.api.model.BootProtocol template ) { if ( networkBootProtocol != null ) { switch ( networkBootProtocol ) { case DHCP : return org.ovirt.engine.api.model.BootProtocol.DHCP ; case STATIC_IP : return org.ovirt.engine.api.model.BootProtocol.STATIC ; case NONE : return org.ovirt.engine.api.model.BootProtocol.NONE ; default : return null ; } } return null ; }

Target:
public static org.ovirt.engine.api.model.BootProtocol map ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol ipv4BootProtocol , org.ovirt.engine.api.model.BootProtocol template ) { if ( ipv4BootProtocol != null ) { switch ( ipv4BootProtocol ) { case DHCP : return org.ovirt.engine.api.model.BootProtocol.DHCP ; case STATIC_IP : return org.ovirt.engine.api.model.BootProtocol.STATIC ; case NONE : return org.ovirt.engine.api.model.BootProtocol.NONE ; default : return null ; } } return null ; }
Source:
protected boolean validateStpProperty ( ) { boolean stpIsAllowed = true ; if ( ( ! ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) ) && ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getParameters ( ) . getNetwork ( ) . getstp ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_CANNOT_SUPPORT_STP ) ; stpIsAllowed = false ; } return stpIsAllowed ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult stpForVmNetworkOnly ( ) { return ( getNetwork ( ) . isVmNetwork ( ) ) || ( ! ( getNetwork ( ) . getstp ( ) ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NON_VM_NETWORK_CANNOT_SUPPORT_STP ) ; }
Source:
protected static org.ovirt.engine.core.common.businessentities.VM buildVmOnNewTemplate ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VM tempVar = new org.ovirt.engine.core.common.businessentities.VM ( ) ; tempVar.setId ( vm.getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonUnitToVmBaseBuilder ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( vm.getStaticData ( ) , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.DedicatedVmForVdsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.MigrationOptionsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.UsbPolicyVmBaseToVmBaseBuilder ( ) ) ; return tempVar ; }

Target:
protected static org.ovirt.engine.core.common.businessentities.VM buildVmOnNewTemplate ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VM resultVm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; resultVm.setId ( vm.getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , resultVm.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonUnitToVmBaseBuilder ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( vm.getStaticData ( ) , resultVm.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.DedicatedVmForVdsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.MigrationOptionsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.UsbPolicyVmBaseToVmBaseBuilder ( ) ) ; return resultVm ; }
Source:
private static boolean isBelowSpaceThreshold ( final org.ovirt.engine.core.common.businessentities.storage_domains domain ) { java.lang.Integer availableDiskSize = ( ( domain.getavailable_disk_size ( ) ) == null ) ? 0 : domain.getavailable_disk_size ( ) ; java.lang.Integer usedDiskSize = ( ( domain.getused_disk_size ( ) ) == null ) ? 0 : domain.getused_disk_size ( ) ; double totalSize = availableDiskSize + usedDiskSize ; return ( totalSize != 0 ) && ( ( ( availableDiskSize / totalSize ) * ( ( double ) ( 100 ) ) ) > ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.getLowDiskPercentThreshold ( ) ) ) ; }

Target:
private static boolean isBelowPctThreshold ( final org.ovirt.engine.core.common.businessentities.storage_domains domain ) { return ( domain.getStorageDynamicData ( ) . getfreeDiskPercent ( ) ) > ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.getLowDiskPercentThreshold ( ) ) ; }
Source:
public void testAllocateVm ( ) throws java.lang.Exception { setUpGetVmExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AttachUserToVmFromPoolAndRun , org.ovirt.engine.core.common.action.VmPoolUserParameters.class , new java.lang.String [ ] { "VmPoolId" , "IsInternal" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , GUIDS [ 0 ] ) ) ; verifyTestAllocateVmActionResponse ( resource.allocateVm ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testAllocateVm ( ) throws java.lang.Exception { setUpGetVmExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AttachUserToVmFromPoolAndRun , org.ovirt.engine.core.common.action.AttachUserToVmFromPoolAndRunParameters.class , new java.lang.String [ ] { "VmPoolId" , "Internal" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , GUIDS [ 0 ] ) ) ; verifyTestAllocateVmActionResponse ( resource.allocateVm ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
public void testSetDetectEmulatedMachine ( ) { boolean preUpdate = existingCluster.isDetectEmulatedMachine ( ) ; boolean updateValue = false ; org.junit.Assert.assertNotSame ( updateValue , preUpdate ) ; dao.setEmulatedMachine ( existingCluster.getId ( ) , existingCluster.getEmulatedMachine ( ) , updateValue ) ; org.junit.Assert.assertEquals ( updateValue , dao.get ( existingCluster.getId ( ) ) . isDetectEmulatedMachine ( ) ) ; }

Target:
public void testSetDetectEmulatedMachine ( ) { boolean preUpdate = existingCluster.isDetectEmulatedMachine ( ) ; boolean updateValue = false ; org.junit.Assert.assertNotEquals ( updateValue , preUpdate ) ; dao.setEmulatedMachine ( existingCluster.getId ( ) , existingCluster.getEmulatedMachine ( ) , updateValue ) ; org.junit.Assert.assertEquals ( updateValue , dao.get ( existingCluster.getId ( ) ) . isDetectEmulatedMachine ( ) ) ; }
Source:
public java.lang.String getPrefix ( java.lang.String namespaceURI ) { for ( java.lang.String prefix : prefixToUri.keySet ( ) ) { if ( prefixToUri.get ( prefix ) . equals ( namespaceURI ) ) return prefix ; } return null ; }

Target:
public java.lang.String getPrefix ( java.lang.String namespaceURI ) { for ( java.util.Map.Entry < java.lang.String , java.lang.String > prexiToUriEntry : prefixToUri.entrySet ( ) ) { if ( prexiToUriEntry.getValue ( ) . equals ( namespaceURI ) ) { return prexiToUriEntry.getKey ( ) ; } } return null ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlan ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.network.Network net ) { return createVdsInterface ( ( ( ( iface.getName ( ) ) + "." ) + ( net.getVlanId ( ) ) ) , false , null , null , NetworkBootProtocol.NONE , net.getName ( ) , iface.getName ( ) , net.getVlanId ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlan ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseNic , org.ovirt.engine.core.common.businessentities.network.Network net ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanNic = createVdsInterface ( ( ( ( baseNic.getName ( ) ) + "." ) + ( net.getVlanId ( ) ) ) , false , null , null , NetworkBootProtocol.NONE , net.getName ( ) , baseNic.getName ( ) , net.getVlanId ( ) ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( vlanNic ) ) . thenReturn ( baseNic ) ; return vlanNic ; }
Source:
public void validateIsoPrefixForKernelAndNoPrefixForInitrd ( ) throws java.lang.Exception { java.lang.String initrd = "initrd" ; java.lang.String kernel = "kernel" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( initrd , ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ) + kernel ) ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , initrd ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ACTIVE_ISO_PREFIX ) + "/" ) + kernel ) ) ; }

Target:
public void validateIsoPrefixForKernelAndNoPrefixForInitrd ( ) throws java.lang.Exception { java.lang.String initrd = "initrd" ; java.lang.String kernel = "kernel" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( initrd , ( ( RunVmCommand.ISO_PREFIX ) + kernel ) ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , initrd ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ACTIVE_ISO_PREFIX ) + "/" ) + kernel ) ) ; }
Source:
protected void executeCommand ( ) { asyncTaskStep = org.ovirt.engine.core.bll.job.ExecutionHandler.addSubStep ( this . getExecutionContext ( ) , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getExecutionContext ( ) . getJob ( ) . getStep ( StepEnum.EXECUTING ) , getStepType ( ) , org.ovirt.engine.core.dal.job.ExecutionMessageDirector.resolveStepMessage ( getStepType ( ) , getStepMessageMap ( ) ) ) ; handleTaskReturn ( executeAndReturnTask ( ) ) ; }

Target:
protected void startSubStep ( ) { asyncTaskStep = org.ovirt.engine.core.bll.job.ExecutionHandler.addSubStep ( this . getExecutionContext ( ) , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getExecutionContext ( ) . getJob ( ) . getStep ( StepEnum.EXECUTING ) , getStepType ( ) , org.ovirt.engine.core.dal.job.ExecutionMessageDirector.resolveStepMessage ( getStepType ( ) , getStepMessageMap ( JobExecutionStatus.STARTED ) ) ) ; }
Source:
public void readKeysData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.configurationsync_3_2.ConfigurationSync.row11Struct.commonByteArrayLock ) { try { int length = 0 ; this . entity_join_id = readString ( dis ) ; this . parent_join_id = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }

Target:
public void readKeysData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.configurationsync_3_2.ConfigurationSync.row11Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_ConfigurationSync ) { try { int length = 0 ; this . entity_join_id = readString ( dis ) ; this . parent_join_id = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }
Source:
public void nameNotAvailable ( ) { org.ovirt.engine.core.common.businessentities.Provider < org.ovirt.engine.core.common.businessentities.Provider.AdditionalProperties > otherProvider = createProvider ( provider.getName ( ) ) ; org.mockito.Mockito.when ( ( ( org.ovirt.engine.core.common.businessentities.Provider < org.ovirt.engine.core.common.businessentities.Provider.AdditionalProperties > ) ( providerDao.getByName ( provider.getName ( ) ) ) ) ) . thenReturn ( otherProvider ) ; org.junit.Assert.assertThat ( validator.nameAvailable ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }

Target:
public void nameNotAvailable ( ) { org.ovirt.engine.core.common.businessentities.Provider < org.ovirt.engine.core.common.businessentities.Provider.AdditionalProperties > otherProvider = createProvider ( provider.getName ( ) ) ; org.mockito.Mockito.when ( ( ( org.ovirt.engine.core.common.businessentities.Provider < org.ovirt.engine.core.common.businessentities.Provider.AdditionalProperties > ) ( providerDao.getByName ( provider.getName ( ) ) ) ) ) . thenReturn ( otherProvider ) ; org.hamcrest.MatcherAssert.assertThat ( validator.nameAvailable ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }
Source:
private static double computeInterfaceUsage ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { return java.lang.Math.max ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.truncatePercentage ( iface.getStatistics ( ) . getReceiveRate ( ) ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.truncatePercentage ( iface.getStatistics ( ) . getTransmitRate ( ) ) ) ; }

Target:
private static java.lang.Double AssignDoubleValue ( java.util.Map < java.lang.String , java.lang.Object > input , java.lang.String name ) { java.lang.Object value = input.get ( name ) ; if ( value instanceof java.lang.Double ) { return ( ( java.lang.Double ) ( value ) ) ; } else if ( value instanceof java.lang.String ) { return java.lang.Double.parseDouble ( ( ( java.lang.String ) ( value ) ) ) ; } return null ; }
Source:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
protected void initSelectedType ( ) { getNicType ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetDefaultNicType ( getVm ( ) . getOs ( ) ) ) ; }

Target:
protected void init ( ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getNicType ( ) . setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ) ( returnValue ) ) ) ; postNicInit ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getNicTypeList ( getVm ( ) . getOsId ( ) , getClusterCompatibilityVersion ( ) , asyncQuery ) ; }
Source:
public void init ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostNicModel model ) { if ( ( model.getVfsConfigModel ( ) ) != ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostNicModel.EMPTY_VFS_CONFIG_MODEL ) ) { if ( ( model.getLabelsModel ( ) ) != ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostNicModel.EMPTY_LABELS_MODEL ) ) { getView ( ) . showTabs ( ) ; } else { getView ( ) . showOnlyVfsConfig ( ) ; } } else { getView ( ) . showOnlyPf ( ) ; } super . init ( model ) ; }

Target:
public void init ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostNicModel model ) { if ( model.hasVfsConfig ( ) ) { if ( model.hasLabels ( ) ) { getView ( ) . showTabs ( ) ; } else { getView ( ) . showOnlyVfsConfig ( ) ; } } else { getView ( ) . showOnlyPf ( ) ; } super . init ( model ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String suggestedDiskName = ( ( java.lang.String ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel vmDiskListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel ) ( model ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( vmDiskListModel.getWindow ( ) ) ) ; diskModel.getAlias ( ) . setEntity ( suggestedDiskName ) ; vmDiskListModel.nextAlias = suggestedDiskName ; vmDiskListModel.AddDiskPostData ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel ) ( target ) ) ; model.getScanAlignmentCommand ( ) . setIsExecutionAllowed ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; }
Source:
public void vdsNonOperational ( org.ovirt.engine.core.compat.Guid vdsId , org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , boolean logCommand , org.ovirt.engine.core.compat.Guid domainId ) { vdsNonOperational ( vdsId , reason , logCommand , domainId , null ) ; }

Target:
public void syncLunsInfoForBlockStorageDomain ( final org.ovirt.engine.core.compat.Guid storageDomainId , final org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { org.ovirt.engine.core.common.action.StorageDomainParametersBase parameters = new org.ovirt.engine.core.common.action.StorageDomainParametersBase ( storageDomainId ) ; parameters.setVdsId ( vdsId ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SyncLunsInfoForBlockStorageDomain , parameters ) ; } } ) ; }
Source:
private void buildFaultResult ( ) { org.ovirt.engine.core.common.errors.VdcFault fault = new org.ovirt.engine.core.common.errors.VdcFault ( ) ; fault.setError ( EngineError.ReachedMaxNumberOfHostsInDC ) ; fault.setMessage ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getVdsErrorsTranslator ( ) . TranslateErrorTextSingle ( fault.getError ( ) . toString ( ) ) ) ; org.ovirt.engine.core.bll.AddVdsSpmIdCommand.getReturnValue ( ) . setFault ( fault ) ; }

Target:
private void buildFaultResult ( ) { org.ovirt.engine.core.common.errors.EngineFault fault = new org.ovirt.engine.core.common.errors.EngineFault ( ) ; fault.setError ( EngineError.ReachedMaxNumberOfHostsInDC ) ; fault.setMessage ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getVdsErrorsTranslator ( ) . TranslateErrorTextSingle ( fault.getError ( ) . toString ( ) ) ) ; org.ovirt.engine.core.bll.AddVdsSpmIdCommand.getReturnValue ( ) . setFault ( fault ) ; }
Source:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( connectAutomatically.readConnectAutomatically ( ) ) && ( model.getCanConnectAutomatically ( ) ) ) && ( ! ( alreadyOpened ) ) ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel userPortalItemModel = model.GetUpVms ( model.getItems ( ) ) . get ( 0 ) ; if ( userPortalItemModel != null ) { consoleManager.connectToConsole ( userPortalItemModel ) ; alreadyOpened = true ; } } unregisterModels ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( connectAutomatically.readConnectAutomatically ( ) ) && ( model.getCanConnectAutomatically ( ) ) ) && ( ! ( alreadyOpened ) ) ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel userPortalItemModel = model.getUpVms ( model.getItems ( ) ) . get ( 0 ) ; if ( userPortalItemModel != null ) { consoleManager.connectToConsole ( userPortalItemModel ) ; alreadyOpened = true ; } } unregisterModels ( ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.String > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroupId ( ) . toString ( ) , LockingGroup.GLUSTER.name ( ) ) ; }

Target:
protected java.util.Map < java.lang.String , java.lang.String > getExclusiveLocks ( ) { if ( ! ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.isInternalExecution ( ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroupId ( ) . toString ( ) , LockingGroup.GLUSTER.name ( ) ) ; } return super . getExclusiveLocks ( ) ; }
Source:
public static org.ovirt.engine.core.bll.adbroker.RootDSE get ( org.ovirt.engine.core.ldap.LdapProviderType ldapProviderType , javax.naming.directory.Attributes rootDseRecords ) throws java.lang.NumberFormatException , javax.naming.NamingException { switch ( ldapProviderType ) { case activeDirectory : return new org.ovirt.engine.core.bll.adbroker.ADRootDSE ( rootDseRecords ) ; case ipa : return new org.ovirt.engine.core.bll.adbroker.IPARootDSE ( rootDseRecords ) ; case rhds : return new org.ovirt.engine.core.bll.adbroker.RHDSRootDSE ( rootDseRecords ) ; case itds : return new org.ovirt.engine.core.bll.adbroker.ITDSRootDSE ( rootDseRecords ) ; case general : default : return new org.ovirt.engine.core.bll.adbroker.GeneralRootDSE ( rootDseRecords ) ; } }

Target:
public static org.ovirt.engine.core.bll.adbroker.RootDSE get ( org.ovirt.engine.core.ldap.LdapProviderType ldapProviderType , javax.naming.directory.Attributes rootDseRecords ) throws java.lang.NumberFormatException , javax.naming.NamingException { switch ( ldapProviderType ) { case activeDirectory : return new org.ovirt.engine.core.bll.adbroker.ADRootDSE ( rootDseRecords ) ; case ipa : return new org.ovirt.engine.core.bll.adbroker.IPARootDSE ( rootDseRecords ) ; case rhds : return new org.ovirt.engine.core.bll.adbroker.RHDSRootDSE ( rootDseRecords ) ; case itds : return new org.ovirt.engine.core.bll.adbroker.ITDSRootDSE ( rootDseRecords ) ; case openLdap : return new org.ovirt.engine.core.bll.adbroker.DefaultRootDSE ( rootDseRecords ) ; case general : default : return new org.ovirt.engine.core.bll.adbroker.GeneralRootDSE ( rootDseRecords ) ; } }
Source:
protected int getNeededDiskSize ( org.ovirt.engine.core.compat.Guid storageDomainId ) { int result = 0 ; for ( org.ovirt.engine.core.common.businessentities.DiskImage img : getDiskImagesFromConfiguration ( ) ) { if ( ( img.getImageStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.ImageStatus.ILLEGAL ) ) { if ( img.getstorage_ids ( ) . get ( 0 ) . getValue ( ) . equals ( storageDomainId ) ) { result = result + ( ( int ) ( java.lang.Math.ceil ( img.getActualSize ( ) ) ) ) ; } } } return result ; }

Target:
protected int getNeededDiskSize ( org.ovirt.engine.core.compat.Guid storageDomainId ) { int result = 0 ; for ( org.ovirt.engine.core.common.businessentities.DiskImage img : getDiskImagesFromConfiguration ( ) ) { if ( ( img.getImageStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.ImageStatus.ILLEGAL ) ) { if ( img.getStorageIds ( ) . get ( 0 ) . getValue ( ) . equals ( storageDomainId ) ) { result = result + ( ( int ) ( java.lang.Math.ceil ( img.getActualSize ( ) ) ) ) ; } } } return result ; }