auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void executeFenceVdsManuallyAction ( ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVdsId ( ) ) ; fenceVdsManuallyParams.setSessionId ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getParameters ( ) . getSessionId ( ) ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getContext ( ) ) ; }

Target:
private void executeFenceVdsManuallyAction ( ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVdsId ( ) ) ; fenceVdsManuallyParams.setSessionId ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getParameters ( ) . getSessionId ( ) ) ; fenceVdsManuallyParams.setParentCommand ( ActionType.RestartVds ) ; runInternalAction ( ActionType.FenceVdsManualy , fenceVdsManuallyParams , org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getContext ( ) ) ; }
Source:
public void testGetEntityNameByIdAndTypeForVmPool ( ) { org.ovirt.engine.core.common.businessentities.vm_pools vmPool = dbFacade.getVmPoolDAO ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_POOL_ID ) ; org.junit.Assert.assertNotNull ( vmPool ) ; java.lang.String name = vmPool.getvm_pool_name ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_POOL_ID , VdcObjectType.VmPool ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForVmPool ( ) { org.ovirt.engine.core.common.businessentities.vm_pools vmPool = dbFacade.getVmPoolDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_POOL_ID ) ; org.junit.Assert.assertNotNull ( vmPool ) ; java.lang.String name = vmPool.getvm_pool_name ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_POOL_ID , VdcObjectType.VmPool ) ) ) ; }
Source:
public void testGetFilteredWithPermissions ( ) { org.ovirt.engine.core.common.businessentities.Disk result = dao.get ( getExistingEntityId ( ) , org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( getExistingEntityId ( ) . toString ( ) , result.getId ( ) . toString ( ) ) ; }

Target:
public void testGetFilteredWithPermissions ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk result = dao.get ( getExistingEntityId ( ) , org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( getExistingEntityId ( ) . toString ( ) , result.getId ( ) . toString ( ) ) ; }
Source:
private void updateShareable ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { getIsShareable ( ) . setEntity ( false ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . shareableDiskNotSupportedByConfiguration ( ) ) ; getIsShareable ( ) . setIsChangable ( ( ! ( ( storageType.isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) ) ) ; }

Target:
private void updateShareable ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( ( storageType.isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel.CONSTANTS.shareableDiskNotSupportedByConfiguration ( ) ) ; getIsShareable ( ) . setIsChangable ( false ) ; getIsShareable ( ) . setEntity ( false ) ; } else { getIsShareable ( ) . setIsChangable ( true ) ; } }
Source:
public static void getDbGroupsByUserId ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDbGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public static void getAuthzGroupsByUserId ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAuthzGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public void testSave ( ) { dao.remove ( existingVm.getId ( ) ) ; dao.save ( existingVm ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmdynamic = dao.get ( existingVm.getId ( ) ) ; org.junit.Assert.assertNotNull ( vmdynamic ) ; org.junit.Assert.assertEquals ( vmdynamic , existingVm ) ; }

Target:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic newEntity = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; newEntity.setId ( FixturesTool.VM_TEMPLATE_RHEL5 ) ; newEntity.setStatus ( VMStatus.NotResponding ) ; dao.save ( newEntity ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmdynamic = dao.get ( newEntity.getId ( ) ) ; org.junit.Assert.assertNotNull ( vmdynamic ) ; org.junit.Assert.assertEquals ( vmdynamic , newEntity ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc validateStorageServerConnection ( int serverType , java.lang.String spUUID , java.util.Map < java.lang.String , java.lang.String > [ ] args ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.validateStorageServerConnection ( serverType , spUUID , args ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotplugDisk ( java.util.Map info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotplugDisk ( info ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( bricks.getItems ( ) ) != null ) && ( bricks.getItems ( ) . iterator ( ) . hasNext ( ) ) ) { getRemoveAllBricksCommand ( ) . setIsExecutionAllowed ( true ) ; } else { getRemoveAllBricksCommand ( ) . setIsExecutionAllowed ( false ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateSelectedBricksActions ( ) ; }
Source:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password , org.ovirt.engine.core.common.businessentities.OriginType originType ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , originType , vdsId , dataCenterId ) , aQuery ) ; }
Source:
public static boolean vmDeviceChanged ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType deviceType , boolean deviceEnabled ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.vmDeviceChanged ( vmId , deviceType , null , deviceEnabled ) ; }

Target:
public static boolean shouldOverrideSoundDevice ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic , org.ovirt.engine.core.compat.Version compatibilityVersion , java.lang.Boolean soundDeviceEnabled ) { return ( ( soundDeviceEnabled == null ) && ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.osRepository.isSoundDeviceEnabled ( vmStatic.getOsId ( ) , compatibilityVersion ) ) ) && ( ( vmStatic.getVmType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getNetwork ( ) ) ) ) { network_SelectedItemChanged ( null ) ; } else if ( sender == ( getQosOverridden ( ) ) ) { getQosModel ( ) . setIsChangable ( getQosOverridden ( ) . getEntity ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getNetwork ( ) ) ) ) { network_SelectedItemChanged ( null ) ; } else if ( sender == ( getQosOverridden ( ) ) ) { updateQosChangeability ( ) ; } }
Source:
public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData selectedObject = ( ( com.google.gwt.view.client.SingleSelectionModel < org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData > ) ( event.getSource ( ) ) ) . getSelectedObject ( ) ; customSelectionCellFormatType.setEnabledWithToolTip ( ( ( java.lang.Boolean ) ( selectedObject.getCollapseSnapshots ( ) . getEntity ( ) ) ) , constants.importAllocationModifiedCollapse ( ) ) ; }

Target:
public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData selectedObject = ( ( com.google.gwt.view.client.SingleSelectionModel < org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData > ) ( event.getSource ( ) ) ) . getSelectedObject ( ) ; customSelectionCellFormatType.setEnabled ( ( ( java.lang.Boolean ) ( selectedObject.getCollapseSnapshots ( ) . getEntity ( ) ) ) ) ; }
Source:
protected boolean performImagesChecks ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , true , true , false , false , true , true , getImagesList ( ) ) ; }

Target:
protected org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator createStorageDomainValidator ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > storageIds = org.ovirt.engine.core.bll.ImagesHandler.getAllStorageIdsForImageIds ( getImagesList ( ) ) ; return new org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getStoragePoolId ( ) , storageIds ) ; }
Source:
public void testUpdate ( ) { dao.save ( vnicProfile ) ; vnicProfile.setPortMirroring ( true ) ; dao.update ( vnicProfile ) ; org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( vnicProfile.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( vnicProfile.getId ( ) , result.getId ( ) ) ; org.junit.Assert.assertEquals ( true , result.isPortMirroring ( ) ) ; }

Target:
public void testUpdate ( ) { dao.save ( vnicProfile ) ; vnicProfile.setPortMirroring ( true ) ; vnicProfile.setPassthrough ( true ) ; dao.update ( vnicProfile ) ; org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( vnicProfile.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( vnicProfile.getId ( ) , result.getId ( ) ) ; org.junit.Assert.assertEquals ( true , result.isPortMirroring ( ) ) ; org.junit.Assert.assertTrue ( result.isPassthrough ( ) ) ; }
Source:
public void validateEnums ( org.ovirt.engine.api.model.DataCenter dataCenter ) { if ( dataCenter != null ) { if ( dataCenter.isSetStorageType ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.StorageType.class , dataCenter.getStorageType ( ) , true ) ; } if ( dataCenter.isSetStorageFormat ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.StorageFormat.class , dataCenter.getStorageFormat ( ) , true ) ; } } }

Target:
public void validateEnums ( org.ovirt.engine.api.model.DataCenter dataCenter ) { if ( dataCenter != null ) { if ( dataCenter.isSetStorageType ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.StorageType.class , dataCenter.getStorageType ( ) , true ) ; } if ( dataCenter.isSetStorageFormat ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.StorageFormat.class , dataCenter.getStorageFormat ( ) , true ) ; } if ( dataCenter.isSetQuotaMode ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.QuotaModeType.class , dataCenter.getQuotaMode ( ) , true ) ; } } }
Source:
public synchronized boolean HasTasksByStoragePoolId ( org.ovirt.engine.core.compat.Guid storagePoolID ) { boolean retVal = false ; if ( ( _tasks ) != null ) { for ( org.ovirt.engine.core.bll.SPMAsyncTask task : _tasks.values ( ) ) { if ( task.getStoragePoolID ( ) . equals ( storagePoolID ) ) { retVal = true ; break ; } } } return retVal ; }

Target:
public synchronized void _timer_Elapsed ( ) { if ( ThereAreTasksToPoll ( ) ) { PollAndUpdateAsyncTasks ( ) ; if ( ( ThereAreTasksToPoll ( ) ) && ( logChangedMap ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Finished polling Tasks, will poll again in {0} seconds." , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.AsyncTaskPollingRate ) ) ; logChangedMap = false ; } if ( ( _tasks.size ( ) ) > 0 ) { cleanZombieTasks ( ) ; } } }
Source:
protected void AsyncSearch ( ) { super . AsyncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetAllDisksByVmId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vm.getId ( ) ) ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }

Target:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { getSearchCommand ( ) . execute ( ) ; updateIsDiskHotPlugAvailable ( ) ; updateLiveStorageMigrationEnabled ( ) ; } updateActionAvailability ( ) ; }
Source:
public void testMissingParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "name" , "host" , "status" ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "name" , "host" , "status" ) ; } }

Target:
public void testMissingParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "name" , "host" , "status" ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "name" , "host" , "status" ) ; } }
Source:
public static void getDataCentersByStorageDomain ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public void deleteJobOlderThanDateWithStatus ( java.util.Date sinceDate , java.util.List < org.ovirt.engine.core.common.job.JobExecutionStatus > statusesList ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "end_time" , sinceDate ) . addValue ( "status" , org.apache.commons.lang.StringUtils.join ( statusesList , "," ) ) ; getCallsHandler ( ) . executeModification ( "DeleteJobOlderThanDateWithStatus" , parameterSource ) ; }

Target:
public boolean checkIfJobHasTasks ( org.ovirt.engine.core.compat.Guid jobId ) { java.util.List < org.ovirt.engine.core.common.job.Step > steps = step.getStepsByJobIdForVdsmAndGluster ( jobId ) ; return ! ( steps.isEmpty ( ) ) ; }
Source:
public void testPositiveCanDoActionWithDisks ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }

Target:
public void testPositiveCanDoActionWithDisks ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getProviderHosts ( org.ovirt.engine.core.common.businessentities.Provider hostProvider , java.lang.String searchFilter ) { org.ovirt.engine.core.bll.host.provider.HostProviderProxy proxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( hostProvider ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( searchFilter ) ) { return proxy.getAll ( ) ; } else { return proxy.getFiltered ( searchFilter ) ; } }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getProviderHosts ( org.ovirt.engine.core.common.businessentities.Provider hostProvider , java.lang.String searchFilter ) { org.ovirt.engine.core.bll.host.provider.HostProviderProxy proxy = providerProxyFactory.create ( hostProvider ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( searchFilter ) ) { return proxy.getAll ( ) ; } else { return proxy.getFiltered ( searchFilter ) ; } }
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.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }
Source:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getBroker ( ) . discoverSendTargets ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.CreateStructFromConnection ( org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getConnection ( ) , null ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.ProceedProxyReturnValue ( ) ; setReturnValue ( ( _result.isFullTargets ( ) ? parseFullTargets ( _result.getIqnList ( ) ) : parseTargets ( _result.getIqnList ( ) ) ) ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getBroker ( ) . discoverSendTargets ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.CreateStructFromConnection ( org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getConnection ( ) , null ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( ( _result.isFullTargets ( ) ? parseFullTargets ( _result.getIqnList ( ) ) : parseTargets ( _result.getIqnList ( ) ) ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , java.util.Map < java.lang.String , java.lang.Object > parameters ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > scores = new java.util.ArrayList < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hosts ) { scores.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > ( vds.getId ( ) , vds.getUsageCpuPercent ( ) ) ) ; } return scores ; }

Target:
private double calcDistributeMetric ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VM vm , int hostCores ) { int vcpu = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VcpuConsumptionPercentage ) ; int spmCpu = ( ( vds.getSpmStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) ? 0 : org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.SpmVCpuConsumption ) ; double hostCpu = vds.getUsageCpuPercent ( ) ; double pendingVcpus = vds.getPendingVcpusCount ( ) ; return ( hostCpu / vcpu ) + ( ( ( pendingVcpus + ( vm.getNumOfCpus ( ) ) ) + spmCpu ) / hostCores ) ; }
Source:
private void addCommands ( org.ovirt.engine.ui.uicommonweb.models.Model model , java.lang.String okCommandName ) { model.getCommands ( ) . add ( new org.ovirt.engine.ui.uicommonweb.UICommand ( okCommandName , this ) . setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . ok ( ) ) . setIsDefault ( true ) ) ; model.getCommands ( ) . add ( new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , this ) . setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) . setIsCancel ( true ) ) ; }

Target:
private void addCommands ( org.ovirt.engine.ui.uicommonweb.models.Model model , java.lang.String okCommandName ) { model.getCommands ( ) . add ( org.ovirt.engine.ui.uicommonweb.UICommand.createDefaultOkUiCommand ( okCommandName , this ) ) ; model.getCommands ( ) . add ( org.ovirt.engine.ui.uicommonweb.UICommand.createCancelUiCommand ( "Cancel" , this ) ) ; }
Source:
private void resizeGridToContentHeight ( int height ) { int top = org.ovirt.engine.ui.common.widget.table.ActionCellTable.getAbsoluteTop ( ) ; int maxGridHeight = ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - top ) - ( org.ovirt.engine.ui.common.widget.table.ActionCellTable.GRID_SUBTRACT ) ; int contentHeight = determineBrowserHeightAdjustment ( height ) ; if ( contentHeight > maxGridHeight ) { contentHeight = maxGridHeight ; } if ( contentHeight > 0 ) { super . setHeight ( ( contentHeight + ( Unit.PX.getType ( ) ) ) ) ; } org.ovirt.engine.ui.common.widget.table.ActionCellTable.redraw ( ) ; }

Target:
public void updateGridSize ( int height ) { if ( ! ( heightSet ) ) { resizeGridToContentHeight ( ( height + ( org.ovirt.engine.ui.common.widget.table.ActionCellTable.getGridHeaderHeight ( ) ) ) ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; param.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; param.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }
Source:
private void calculateNetworkImplementationDetailsAndAssertSync ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , boolean expectSync , java.lang.String networkName , boolean vmNet , int mtu , int vlanId , org.ovirt.engine.core.common.businessentities.network.NetworkQoS qos ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( networkName , vmNet , mtu , vlanId ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails = org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( network , qos , iface ) ; org.junit.Assert.assertNotNull ( "Network implementation details should be filled." , networkImplementationDetails ) ; org.junit.Assert.assertEquals ( ( ( "Network implementation details should be " + ( expectSync ? "in" : "out of" ) ) + " sync." ) , expectSync , networkImplementationDetails.isInSync ( ) ) ; }

Target:
private void calculateNetworkImplementationDetailsAndAssertSync ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , boolean expectSync , boolean vmNet , int mtu , int vlanId , org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( vmNet , mtu , vlanId ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails = org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( network , qos , iface ) ; org.junit.Assert.assertNotNull ( "Network implementation details should be filled." , networkImplementationDetails ) ; org.junit.Assert.assertEquals ( ( ( "Network implementation details should be " + ( expectSync ? "in" : "out of" ) ) + " sync." ) , expectSync , networkImplementationDetails.isInSync ( ) ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getPrestartedVmToAttach ( org.ovirt.engine.core.compat.Guid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Up ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( canAttachPrestartedVmToUser ( map.getVmId ( ) , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getReturnValue ( ) . getValidationMessages ( ) ) ) { return map.getVmId ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
private org.ovirt.engine.core.compat.Guid getPrestartedVmToAttach ( org.ovirt.engine.core.compat.Guid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Up ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( canAttachPrestartedVmToUser ( map.getVmId ( ) , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getVmPool ( ) . isStateful ( ) , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getReturnValue ( ) . getValidationMessages ( ) ) ) { return map.getVmId ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }
Source:
public void shouldDetectPassThroughDeviceOnVM ( ) { org.mockito.Mockito.when ( hostDeviceManager.checkVmNeedsDirectPassthrough ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) . thenReturn ( true ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( EngineMessage.CLUSTER_UPGRADE_DETAIL_VM_NEEDS_PASSTHROUGH.name ( ) ) ; }

Target:
public void shouldDetectPassThroughDeviceOnVM ( ) { org.mockito.Mockito.when ( hostDeviceManager.checkVmNeedsDirectPassthrough ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) . thenReturn ( true ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( EngineMessage.CLUSTER_UPGRADE_DETAIL_VM_NEEDS_PASSTHROUGH.name ( ) ) ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { if ( ( ! ( vds.getvds_group_id ( ) . equals ( getVm ( ) . getvds_group_id ( ) ) ) ) || ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { sb.append ( "is not in up status or belongs to the VM's cluster" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ! ( vds.getVdsGroupId ( ) . equals ( getVm ( ) . getVdsGroupId ( ) ) ) ) || ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { sb.append ( "is not in up status or belongs to the VM's cluster" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER ; } return null ; }
Source:
public void onAddTabActionButton ( org.ovirt.engine.ui.common.presenter.AddTabActionButtonEvent event ) { if ( org.ovirt.engine.ui.common.presenter.AbstractTabPresenter.getProxy ( ) . getTargetHistoryToken ( ) . equals ( event.getHistoryToken ( ) ) ) { if ( ( getTable ( ) ) != null ) { getTable ( ) . addActionButton ( ( ( org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition ) ( event.getButtonDefinition ( ) ) ) ) ; } } }

Target:
public void onAddTabActionButton ( org.ovirt.engine.ui.common.presenter.AddTabActionButtonEvent event ) { if ( getProxy ( ) . getTargetHistoryToken ( ) . equals ( event.getHistoryToken ( ) ) ) { java.util.List < org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < ? > > pluginActionButtonList = new java.util.ArrayList < org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < ? > > ( ) ; pluginActionButtonList.add ( event.getButtonDefinition ( ) ) ; addPluginActionButtons ( pluginActionButtonList ) ; } }
Source:
public void setWidth ( java.lang.String width , boolean isFixedLayout ) { table.setWidth ( "100%" , isFixedLayout ) ; tableHeader.setWidth ( "100%" , isFixedLayout ) ; }

Target:
private T getValueFromElement ( com.google.gwt.dom.client.Element target ) { com.google.gwt.dom.client.TableCellElement tableCell = findNearestParentCell ( target ) ; if ( tableCell != null ) { com.google.gwt.dom.client.Element trElem = tableCell.getParentElement ( ) ; com.google.gwt.dom.client.TableRowElement tr = com.google.gwt.dom.client.TableRowElement.as ( trElem ) ; int row = tr.getSectionRowIndex ( ) ; return ( table.getVisibleItemCount ( ) ) > 0 ? table.getVisibleItem ( row ) : null ; } else { return null ; } }
Source:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworksResourceTest.DATA_CENTER_ID } , getEntityList ( ) , failure ) ; } }

Target:
protected org.ovirt.engine.api.model.Network getEntity ( int index ) { org.ovirt.engine.api.model.Network entity = org.mockito.Mockito.mock ( org.ovirt.engine.api.model.Network.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; org.mockito.Mockito.when ( entity.getDataCenterId ( ) ) . thenReturn ( GUIDS [ 1 ] ) ; return entity ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VnicProfile findVnicProfileForUser ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > networkProfiles = org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.getVnicProfileDao ( ) . getAllForNetwork ( network.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile : networkProfiles ) { if ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.isVnicProfilePermitted ( userId , profile , false ) ) { return profile ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VnicProfile findVnicProfileForUser ( org.ovirt.engine.core.common.users.VdcUser user , org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > networkProfiles = org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.getVnicProfileDao ( ) . getAllForNetwork ( network.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile : networkProfiles ) { if ( ( ( user == null ) && ( ! ( profile.isPortMirroring ( ) ) ) ) || ( ( user != null ) && ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.isVnicProfilePermitted ( user , profile , false ) ) ) ) { return profile ; } } return null ; }
Source:
protected org.ovirt.engine.api.model.Permission map ( org.ovirt.engine.core.common.businessentities.permissions entity , org.ovirt.engine.api.model.Permission template ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DbUser > users = parent.getUsers ( ) ; return parent.map ( entity , ( users.containsKey ( entity.getad_element_id ( ) ) ? users.get ( entity.getad_element_id ( ) ) : null ) ) ; }

Target:
protected org.ovirt.engine.api.model.Permission map ( org.ovirt.engine.core.common.businessentities.Permissions entity , org.ovirt.engine.api.model.Permission template ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DbUser > users = parent.getUsers ( ) ; return parent.map ( entity , ( users.containsKey ( entity.getad_element_id ( ) ) ? users.get ( entity.getad_element_id ( ) ) : null ) ) ; }
Source:
public void testBuildFreeTextConditionSql ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AdGroupConditionFieldAutoCompleter ( ) ; java.lang.String sql = comp.buildFreeTextConditionSql ( "ATable" , "=" , "JarJar" , false ) ; org.junit.Assert.assertEquals ( " ( ATable.$CN LIKE '%JarJar%' ) " , " ( ATable.$CN LIKE '%JarJar%' ) " , sql ) ; sql = comp.buildFreeTextConditionSql ( "ATable" , "!=" , "JarJar" , false ) ; org.junit.Assert.assertEquals ( " ( ATable.$CN NOT LIKE '%JarJar%' ) " , " ( ATable.$CN NOT LIKE '%JarJar%' ) " , sql ) ; }

Target:
public void testBuildFreeTextConditionSql ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AdGroupConditionFieldAutoCompleter ( ) ; java.lang.String sql = comp.buildFreeTextConditionSql ( "ATable" , "=" , "JarJar" , false ) ; org.junit.Assert.assertEquals ( " ( ATable.cn LIKE '%JarJar%' ) " , " ( ATable.cn LIKE '%JarJar%' ) " , sql ) ; sql = comp.buildFreeTextConditionSql ( "ATable" , "!=" , "JarJar" , false ) ; org.junit.Assert.assertEquals ( " ( ATable.cn NOT LIKE '%JarJar%' ) " , " ( ATable.cn NOT LIKE '%JarJar%' ) " , sql ) ; }
Source:
public void GetUserNameFromUser ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.users.VdcUser u = new org.ovirt.engine.core.common.users.VdcUser ( ) ; u.setUserName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setCurrentUser ( u ) ; final java.lang.String un = b.getUserName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , un ) ; }

Target:
public void GetUserNameFromUser ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.DbUser u = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; u.setLoginName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setCurrentUser ( u ) ; final java.lang.String un = b.getUserName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , un ) ; }
Source:
public static < T > org.ovirt.engine.ui.uicompat.Translator create ( T type ) { org.ovirt.engine.ui.uicompat.EnumTranslator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.translatorsMap.get ( type ) ; if ( translator == null ) { translator = new org.ovirt.engine.ui.uicompat.EnumTranslator ( type ) ; org.ovirt.engine.ui.uicompat.EnumTranslator.translatorsMap.put ( ( ( java.lang.Class < ? > ) ( type ) ) , translator ) ; } return translator ; }

Target:
public static < T extends java.lang.Enum < ? > > org.ovirt.engine.ui.uicompat.Translator create ( java.lang.Class < T > type ) { org.ovirt.engine.ui.uicompat.EnumTranslator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.translatorsMap.get ( type ) ; if ( translator == null ) { translator = new org.ovirt.engine.ui.uicompat.EnumTranslator < T > ( type ) ; org.ovirt.engine.ui.uicompat.EnumTranslator.translatorsMap.put ( type , translator ) ; } return translator ; }
Source:
protected void AsyncSearch ( ) { super . AsyncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( vm.getId ( ) ) ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }

Target:
private void New ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ) ( getItems ( ) ) ) , this ) ; setWindow ( model ) ; }
Source:
protected boolean canDoAction ( ) { return ( ( ( ( ( ( ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmInUpPausedDownStatus ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.canRunActionOnNonManagedVm ( ) ) ) && ( isDiskExist ( getDisk ( ) ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmNotInPreviewSnapshot ( ) ) ) && ( imageStorageValidation ( ) ) ) && ( virtIoScsiDiskValidation ( ) ) ; }

Target:
protected boolean canDoAction ( ) { performDbLoads ( ) ; return ( ( ( ( ( ( ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmInUpPausedDownStatus ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.canRunActionOnNonManagedVm ( ) ) ) && ( isDiskExist ( getDisk ( ) ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmNotInPreviewSnapshot ( ) ) ) && ( imageStorageValidation ( ) ) ) && ( virtIoScsiDiskValidation ( ) ) ; }