auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getMaximalVmMemSize64OS ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : - 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
private static void initMemorySnapshotSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.memorySnapshotSupport = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetMemorySnapshotSupport ) , callback ) ; }
Source:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public 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:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForDisplayNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( getNetworkCluster ( ) . isDisplay ( ) ) && ( ( ipConfiguration == null ) || ( ( ipConfiguration.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL ) . when ( failWhen ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForDisplayNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( getNetworkCluster ( ) . isDisplay ( ) ) && ( ( ( ipConfiguration == null ) || ( ! ( ipConfiguration.hasPrimaryAddressSet ( ) ) ) ) || ( ( ipConfiguration.getPrimaryAddress ( ) . getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , getNetwork ( ) . getName ( ) ) ) . when ( failWhen ) ; }
Source:
public void mixedClusterServicesSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , true ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.mixedClusterServicesSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void mixedClusterServicesSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , true ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.mixedClusterServicesSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected boolean validateVmNetwork ( ) { boolean retVal = true ; if ( ! ( org.ovirt.engine.core.bll.storage.NetworkCommon.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) ) { org.ovirt.engine.core.compat.Version version = org.ovirt.engine.core.bll.storage.NetworkCommon.getStoragePoolDAO ( ) . get ( org.ovirt.engine.core.bll.storage.NetworkCommon.getParameters ( ) . getStoragePoolId ( ) ) . getcompatibility_version ( ) ; retVal = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.NonVmNetworkSupported , version.getValue ( ) ) ; if ( ! retVal ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; } } return retVal ; }

Target:
protected boolean validateVmNetwork ( ) { boolean retVal = true ; if ( ! ( org.ovirt.engine.core.bll.storage.NetworkCommon.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) ) { org.ovirt.engine.core.compat.Version version = org.ovirt.engine.core.bll.storage.NetworkCommon.getStoragePool ( ) . getcompatibility_version ( ) ; retVal = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.NonVmNetworkSupported , version.getValue ( ) ) ; if ( ! retVal ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; } } return retVal ; }
Source:
public org.ovirt.engine.core.common.businessentities.AuditLog createAuditLog ( org.ovirt.engine.core.common.AuditLogType logType , org.ovirt.engine.core.common.AuditLogSeverity severity , java.lang.String message ) { return new org.ovirt.engine.core.common.businessentities.AuditLog ( logType , severity , message , getUserId ( ) , getUserName ( ) , getVmId ( ) , getVmName ( ) , getVdsId ( ) , getVdsName ( ) , getVmTemplateId ( ) , getVmTemplateName ( ) , getOrigin ( ) , getCustomEventId ( ) , getEventFloodInSec ( ) , getCustomData ( ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.AuditLog createAuditLog ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String message ) { return new org.ovirt.engine.core.common.businessentities.AuditLog ( logType , logType.getSeverity ( ) , message , getUserId ( ) , getUserName ( ) , getVmId ( ) , getVmName ( ) , getVdsId ( ) , getVdsName ( ) , getVmTemplateId ( ) , getVmTemplateName ( ) , getOrigin ( ) , getCustomEventId ( ) , getEventFloodInSec ( ) , getCustomData ( ) ) ; }
Source:
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 ( ) ; } } }

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:
private java.util.List < java.lang.String > translateViolations ( ) { java.util.List < java.lang.String > violationMessages = new java.util.ArrayList < java.lang.String > ( violations.size ( ) ) ; for ( org.ovirt.engine.core.dal.VdcBllMessages v : violations ) { violationMessages.add ( v.name ( ) ) ; } return violationMessages ; }

Target:
private void addViolation ( org.ovirt.engine.core.dal.VdcBllMessages violation , java.lang.String violatingEntity ) { java.util.List < java.lang.String > violatingEntities = violations.get ( violation ) ; if ( violatingEntities == null ) { violatingEntities = new java.util.ArrayList < java.lang.String > ( ) ; violations.put ( violation , violatingEntities ) ; } violatingEntities.add ( violatingEntity ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > pmOptions = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; getPmSecondaryPort ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmPortKey ) ) ; getPmSecondarySlot ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSlotKey ) ) ; getPmSecondarySecure ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSecureKey ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > pmOptions = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; getPmPort ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmPortKey ) ) ; getPmSlot ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSlotKey ) ) ; getPmSecure ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSecureKey ) ) ; }
Source:
public void getUsbPolicyUsbTypeNull30 ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setCompatibilityVersion ( Version.v3_0 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getCompatibilityVersion ( ) ) , UsbPolicy.ENABLED_LEGACY ) ; }

Target:
public void getUsbPolicyOnUpdateCurrentlyNativeGotEnabledLegacyPolicyUsb ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "legacy" ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( usb , UsbPolicy.ENABLED_NATIVE ) , UsbPolicy.ENABLED_LEGACY ) ; }
Source:
public org.ovirt.engine.api.model.Cdrom get ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; if ( org.ovirt.engine.api.common.util.QueryHelper.hasCurrentConstraint ( getUriInfo ( ) ) ) { vm.setIsoPath ( vm.getCurrentCd ( ) ) ; } return addLinks ( populate ( map ( vm ) , vm ) ) ; }

Target:
public org.ovirt.engine.api.model.Cdrom get ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; boolean current = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendVmCdromResource.CURRENT , true , false ) ; if ( current ) { vm.setIsoPath ( vm.getCurrentCd ( ) ) ; } return addLinks ( populate ( map ( vm ) , vm ) ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( taskButton.getValue ( ) ) { alertButton.setValue ( false ) ; eventButton.setValue ( false ) ; tablePanel.clear ( ) ; tablePanel.add ( tasksTree ) ; firstRowTablePanel.clear ( ) ; firstRowTablePanel.add ( _tasksTable ) ; message.setText ( constants.lastTaskEventFooter ( ) ) ; collapseButton.setVisible ( true ) ; } else { taskButton.setValue ( true ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( eventButton.getValue ( ) ) { alertButton.setValue ( false ) ; taskButton.setValue ( false ) ; tablePanel.clear ( ) ; tablePanel.add ( eventsTable ) ; firstRowTablePanel.clear ( ) ; firstRowTablePanel.add ( _eventsTable ) ; message.setText ( org.ovirt.engine.ui.webadmin.widget.footer.AlertsEventsFooterView.constants.lastMsgEventFooter ( ) ) ; collapseButton.setVisible ( false ) ; } else { eventButton.setValue ( true ) ; } }
Source:
protected void updateUserCdImage ( org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getIrsImageList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < java.lang.String > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < java.lang.String > images ) { setImagesToModel ( getModel ( ) , images ) ; } } ) , storagePoolId ) ; }

Target:
protected void updateCdImage ( boolean forceRefresh ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getModel ( ) . getSelectedDataCenter ( ) ; if ( dataCenter == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getIrsImageList ( asyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < java.lang.String > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < java.lang.String > images ) { setImagesToModel ( getModel ( ) , images ) ; } } ) , dataCenter.getId ( ) , forceRefresh ) ; }
Source:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
private boolean isStorageFormatCompatibleWithDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageFormatType storageFormat = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageFormat ( ) ; org.ovirt.engine.core.common.businessentities.StorageType storageType = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageType ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainFunction = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageDomainType ( ) ; if ( storageFormat == ( org.ovirt.engine.core.common.businessentities.StorageFormatType.V2 ) ) { return ( storageDomainFunction.isDataDomain ( ) ) && ( storageType.isBlockDomain ( ) ) ; } if ( storageFormat == ( org.ovirt.engine.core.common.businessentities.StorageFormatType.V3 ) ) { return storageDomainFunction.isDataDomain ( ) ; } return true ; }

Target:
protected void updateStorageDomainWipeAfterDelete ( ) { if ( ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) . getWipeAfterDelete ( ) ) == null ) { org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) . setWipeAfterDelete ( org.ovirt.engine.core.bll.utils.WipeAfterDeleteUtils.getDefaultWipeAfterDeleteFlag ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) . getStorageType ( ) ) ) ; } }
Source:
public void getVmGuestAgentInterfacesByVmId ( 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void isSupportBridgesReportByVDSM ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.LdapGroup getAdGroup ( ) { if ( ( ( mGroup ) == null ) && ( ! ( getGroupId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.common.businessentities.DbGroup dbGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbGroupDao ( ) . get ( getGroupId ( ) ) ; mGroup = new org.ovirt.engine.core.common.businessentities.LdapGroup ( dbGroup ) ; } return mGroup ; }

Target:
protected org.ovirt.engine.core.authentication.DirectoryGroup getAdGroup ( ) { if ( ( ( mGroup ) == null ) && ( ! ( getGroupId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.common.businessentities.DbGroup dbGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbGroupDao ( ) . get ( getGroupId ( ) ) ; org.ovirt.engine.core.authentication.Directory directory = org.ovirt.engine.core.authentication.DirectoryManager.getInstance ( ) . getDirectory ( dbGroup.getDomain ( ) ) ; mGroup = directory.findGroup ( dbGroup.getExternalId ( ) ) ; } return mGroup ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > getSharedConnections4REST ( ) { java.util.Map < java.lang.String , java.lang.Object > connections = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; return connections ; }

Target:
private java.util.Map < java.lang.String , java.lang.Object > getSharedConnections4REST ( ) { java.util.Map < java.lang.String , java.lang.Object > connections = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; connections.put ( "conn_tJDBCConnection_2" , globalMap.get ( "conn_tJDBCConnection_2" ) ) ; connections.put ( "conn_tJDBCConnection_1" , globalMap.get ( "conn_tJDBCConnection_1" ) ) ; return connections ; }
Source:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void validateEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public void testNotRemovingLabeledNetworksWhenNicNameDoesNotReferenceExistingNicItsOkToRemove ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network labeledNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; labeledNetwork.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; labeledNetwork.setLabel ( "label" ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( labeledNetwork ) ; networkAttachment.setNicName ( "noLongerExistingNicName" ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingNic = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; existingNic.setName ( "existingNicName" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( java.util.Collections.singletonList ( labeledNetwork ) ) ; org.junit.Assert.assertThat ( validator.notRemovingLabeledNetworks ( networkAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; host.setVdsGroupCompatibilityVersion ( Version.v3_5 ) ; final org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; vdsDynamic.setSupportedClusterLevels ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.TEST_VERSION ) ; host.setDynamicData ( vdsDynamic ) ; bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( mockNetworkExclusivenessValidatorResolver.resolveNetworkExclusivenessValidator ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.TEST_SUPPORTED_VERSIONS ) ) . thenReturn ( mockNetworkExclusivenessValidator ) ; }
Source:
public void testSave ( ) { java.util.Date newAuditLogDateCuttoff = newAuditLog.getlog_time ( ) ; newAuditLogDateCuttoff.setTime ( ( ( newAuditLogDateCuttoff.getTime ( ) ) - 1 ) ) ; int countBefore = dao.getAllAfterDate ( newAuditLogDateCuttoff ) . size ( ) ; dao.save ( newAuditLog ) ; int countAfter = dao.getAllAfterDate ( newAuditLogDateCuttoff ) . size ( ) ; org.junit.Assert.assertEquals ( ( countBefore + 1 ) , countAfter ) ; }

Target:
public void testSave ( ) { java.util.Date newAuditLogDateCuttoff = newAuditLog.getLogTime ( ) ; newAuditLogDateCuttoff.setTime ( ( ( newAuditLogDateCuttoff.getTime ( ) ) - 1 ) ) ; int countBefore = dao.getAllAfterDate ( newAuditLogDateCuttoff ) . size ( ) ; dao.save ( newAuditLog ) ; int countAfter = dao.getAllAfterDate ( newAuditLogDateCuttoff ) . size ( ) ; org.junit.Assert.assertEquals ( ( countBefore + 1 ) , countAfter ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus status = brick.getStatus ( ) ; java.lang.String tooltip = null ; switch ( status ) { case DOWN : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.BrickStatusColumn.constants.down ( ) ; break ; case UP : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.BrickStatusColumn.constants.up ( ) ; break ; case UNKNOWN : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.BrickStatusColumn.constants.unknown ( ) ; break ; default : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.BrickStatusColumn.constants.down ( ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( tooltip ) ; }

Target:
public java.lang.String getTooltip ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus status = brick.getStatus ( ) ; java.lang.String tooltip = "" ; switch ( status ) { case DOWN : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.BrickStatusColumn.constants.down ( ) ; break ; case UP : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.BrickStatusColumn.constants.up ( ) ; break ; case UNKNOWN : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.BrickStatusColumn.constants.unknown ( ) ; break ; default : tooltip = org.ovirt.engine.ui.webadmin.widget.table.column.BrickStatusColumn.constants.down ( ) ; } return tooltip ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain2 ) { java.lang.Integer numOfVmDisksInStorageDomain = numOfVmDisksInStorageDomains.get ( storageDomain.getId ( ) ) ; java.lang.Integer numOfVmDisksInStorageDomain2 = numOfVmDisksInStorageDomains.get ( storageDomain2.getId ( ) ) ; return numOfVmDisksInStorageDomain.compareTo ( numOfVmDisksInStorageDomain2 ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain2 ) { java.lang.Integer numOfVmDisksInStorageDomain = numOfVmDisksInStorageDomains.getOrDefault ( storageDomain.getId ( ) , 0 ) ; java.lang.Integer numOfVmDisksInStorageDomain2 = numOfVmDisksInStorageDomains.getOrDefault ( storageDomain2.getId ( ) , 0 ) ; return numOfVmDisksInStorageDomain.compareTo ( numOfVmDisksInStorageDomain2 ) ; }
Source:
public void testHotsetNotUpdateableWhenHotsetNotRequested ( ) { org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; org.junit.Assert.assertFalse ( "Should be false by default" , oic.IsFieldUpdatable ( "name" ) ) ; oic.AddHotsetFields ( "name" ) ; org.junit.Assert.assertFalse ( "hot set not requested should return false even if field is hot set" , oic.IsFieldUpdatable ( null , "name" , null , false ) ) ; }

Target:
public void testHotsetNotUpdateableWhenHotsetNotRequested ( ) { org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; org.junit.Assert.assertFalse ( "Should be false by default" , oic.isFieldUpdatable ( "name" ) ) ; oic.addHotsetFields ( "name" ) ; org.junit.Assert.assertFalse ( "hot set not requested should return false even if field is hot set" , oic.isFieldUpdatable ( null , "name" , null , false ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpVersionExpectations ( ) ; setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateStoragePool , org.ovirt.engine.core.common.action.StoragePoolManagementParameter.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendDataCentersResourceTest.getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpVersionExpectations ( ) ; setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateStoragePool , org.ovirt.engine.core.common.action.StoragePoolManagementParameter.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendDataCentersResourceTest.getModel ( 0 ) ) , 0 ) ; }
Source:
public boolean isLiveMergeSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { return ( vm != null ) && ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.LiveMergeSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) ; }

Target:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) { return true ; } if ( ! ( o instanceof org.ovirt.engine.core.common.businessentities.network.ExternalVnicProfileMapping ) ) { return false ; } final org.ovirt.engine.core.common.businessentities.network.ExternalVnicProfileMapping that = ( ( org.ovirt.engine.core.common.businessentities.network.ExternalVnicProfileMapping ) ( o ) ) ; return ( java.util.Objects.equals ( externalNetworkName , that.externalNetworkName ) ) && ( java.util.Objects.equals ( externalNetworkProfileName , that.externalNetworkProfileName ) ) ; }

Target:
public boolean isSameSourceProfile ( org.ovirt.engine.core.common.businessentities.network.ExternalVnicProfileMapping other ) { return ( java.util.Objects.equals ( externalNetworkName , other.externalNetworkName ) ) && ( java.util.Objects.equals ( externalNetworkProfileName , other.externalNetworkProfileName ) ) ; }
Source:
public static void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance , "PerformLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }

Target:
public static void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance , "performLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > getModifiedNetworks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > modifiedNetworks = new java.util.ArrayList ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getNetworkAttachments ( ) . size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getNetworkAttachments ( ) ) { modifiedNetworks.add ( getNetworkBusinessEntityMap ( ) . get ( attachment.getNetworkId ( ) ) ) ; } return modifiedNetworks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > getModifiedNetworks ( ) { if ( ( modifiedNetworks ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getNetworkAttachments ( ) ; modifiedNetworks = new java.util.ArrayList ( networkAttachments.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : networkAttachments ) { modifiedNetworks.add ( existingNetworkRelatedToAttachment ( attachment ) ) ; } } return modifiedNetworks ; }
Source:
public org.springframework.jdbc.core.simple.SimpleJdbcCall createCall ( ) { org.springframework.jdbc.core.simple.SimpleJdbcCall call = ( ( org.springframework.jdbc.core.simple.SimpleJdbcCall ) ( dialect.createJdbcCallForQuery ( jdbcTemplate ) . withProcedureName ( procedureName ) ) ) ; call.returningResultSet ( org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.RETURN_VALUE_PARAMETER , mapper ) ; call.getInParameterNames ( ) . addAll ( org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils.extractCaseInsensitiveParameterNames ( parameterSource ) . keySet ( ) ) ; return call ; }

Target:
private org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.CallCreator createCallForRead ( final java.lang.String procedureName , final org.springframework.jdbc.core.RowMapper < ? > mapper , final org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource ) { return ( ) -> { org.springframework.jdbc.core.simple.SimpleJdbcCall call = ( ( org.springframework.jdbc.core.simple.SimpleJdbcCall ) ( dialect.createJdbcCallForQuery ( jdbcTemplate ) . withProcedureName ( procedureName ) ) ) ; call.returningResultSet ( org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.RETURN_VALUE_PARAMETER , mapper ) ; call.getInParameterNames ( ) . addAll ( org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils.extractCaseInsensitiveParameterNames ( parameterSource ) . keySet ( ) ) ; return call ; } ; }
Source:
protected boolean validateSpaceRequirements ( ) { fetchVmDisksFromDb ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDiskList ( ) ; org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator msdValidator = createMultipleStorageDomainsValidator ( disksList ) ; return ( validate ( msdValidator.allDomainsHaveSpaceForNewDisks ( disksList ) ) ) && ( validate ( msdValidator.allDomainsWithinThresholds ( ) ) ) ; }

Target:
public void onPowerringUp ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = org.ovirt.engine.core.bll.RunVmCommand.getVmStaticDAO ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVms ( org.ovirt.engine.core.bll.RunVmCommand.getCurrentVdsId ( ) , vmStatic.getNumOfCpus ( ) , vmStatic.getMinAllocatedMem ( ) , vmStatic.getName ( ) ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( getName ( ) ) == null ? 0 : getName ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getProfileStats ( ) ) == null ? 0 : getProfileStats ( ) . hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( name , profileStats ) ; }
Source:
public void getUsbPolicyUsbTypeNull31 ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setCompatibilityVersion ( Version.v3_1 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getCompatibilityVersion ( ) ) , UsbPolicy.ENABLED_NATIVE ) ; }

Target:
public void getUsbPolicyOnUpdateCurrentlyLegacyGotEnabledNotSetPolicyNotSetUsb ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; org.ovirt.engine.core.common.businessentities.UsbPolicy currentPolicy = org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_LEGACY ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( usb , currentPolicy ) , currentPolicy ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.DbUser persistAuthenticatedUser ( org.ovirt.engine.core.aaa.DirectoryUser directoryUser ) { org.ovirt.engine.core.dao.DbUserDAO dao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) ; org.ovirt.engine.core.common.businessentities.DbUser dbUser = dao.getByExternalId ( directoryUser.getDirectoryName ( ) , directoryUser.getId ( ) ) ; if ( dbUser != null ) { dao.update ( dbUser ) ; } else { dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( directoryUser ) ; dao.save ( dbUser ) ; } return dbUser ; }

Target:
public static org.ovirt.engine.core.common.businessentities.DbUser persistAuthenticatedUser ( org.ovirt.engine.core.aaa.DirectoryUser directoryUser ) { org.ovirt.engine.core.dao.DbUserDAO dao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) ; org.ovirt.engine.core.common.businessentities.DbUser dbUser = dao.getByExternalId ( directoryUser.getDirectoryName ( ) , directoryUser.getId ( ) ) ; if ( dbUser != null ) { dao.update ( dbUser ) ; } else { dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( directoryUser ) ; dbUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dao.save ( dbUser ) ; } return dbUser ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Network nwk ) { switch ( nwk.getCluster ( ) . getstatus ( ) ) { case Operational : return getApplicationResources ( ) . upImage ( ) ; case NonOperational : return getApplicationResources ( ) . downImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Network nwk ) { setEnumTitle ( nwk.getCluster ( ) . getstatus ( ) ) ; switch ( nwk.getCluster ( ) . getstatus ( ) ) { case Operational : return getApplicationResources ( ) . upImage ( ) ; case NonOperational : return getApplicationResources ( ) . downImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }
Source:
protected void setJobLink ( final org.ovirt.engine.api.model.Action action , org.ovirt.engine.core.common.action.VdcReturnValueBase actionResult ) { org.ovirt.engine.api.model.Job job = new org.ovirt.engine.api.model.Job ( ) ; job.setId ( actionResult.getJobId ( ) . toString ( ) ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( job , null , false ) ; action.setJob ( job ) ; }

Target:
protected void setJobLink ( final org.ovirt.engine.api.model.Action action , org.ovirt.engine.core.common.action.ActionReturnValue actionResult ) { org.ovirt.engine.api.model.Job job = new org.ovirt.engine.api.model.Job ( ) ; job.setId ( actionResult.getJobId ( ) . toString ( ) ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( job , null , false ) ; action.setJob ( job ) ; }
Source:
public void virtIoRngSupported ( ) { org.mockito.Mockito.when ( cluster.getRequiredRngSources ( ) ) . thenReturn ( java.util.Collections.singleton ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source.class ) ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . virtIoRngSupportedInCluster ( ) ; org.junit.Assert.assertThat ( validator.virtIoRngSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void migrationNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . migrationSupportedForArch ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.MIGRATION_ON_ERROR_IS_NOT_SUPPORTED ) ) ; }
Source:
public void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getExternalProviderHostGroupList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.ExternalHostGroup > > aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostGroupsFromExternalProvider , params , aQuery ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( target ) ) ; java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; diskModel.getHost ( ) . setItems ( hosts ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( target ) ) ; java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > filteredHosts = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { if ( isHostAvailable ( host ) ) { filteredHosts.add ( host ) ; } } diskModel.getHost ( ) . setItems ( filteredHosts ) ; StopProgress ( ) ; }
Source:
public boolean hasSpaceForSnapthosts ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.Integer minSnapshotSize = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.InitStorageSparseSizeInGB ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.storage_domains , java.lang.Integer > e : mapStorageDomainsToNumOfDisks ( vm ) . entrySet ( ) ) { if ( ! ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.hasSpaceForRequest ( e.getKey ( ) , ( minSnapshotSize * ( e.getValue ( ) ) ) ) ) ) { org.ovirt.engine.core.bll.VmRunHandler.log.error ( ( "not enough space to create snapshot on domain " + ( e.getKey ( ) . getId ( ) ) ) ) ; return false ; } } return true ; }

Target:
public boolean hasSpaceForSnapthosts ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.ArrayList < java.lang.String > message ) { java.lang.Integer minSnapshotSize = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.InitStorageSparseSizeInGB ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.storage_domains , java.lang.Integer > e : mapStorageDomainsToNumOfDisks ( vm ) . entrySet ( ) ) { if ( ! ( destinationHasSpace ( e.getKey ( ) , ( minSnapshotSize * ( e.getValue ( ) ) ) , message ) ) ) { return false ; } } return true ; }
Source:
protected void initDisksStorageDomainsList ( ) { for ( java.lang.Object item : getItems ( ) ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( item ) ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : template.getDiskList ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; setDiskImportData ( diskImage.getId ( ) , filteredStorageDomains , diskImage.getvolume_type ( ) ) ; } } postInitDisks ( ) ; }

Target:
protected void initDisksStorageDomainsList ( ) { for ( java.lang.Object item : getItems ( ) ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( item ) ) . getTemplate ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : template.getDiskList ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; addDiskImportData ( diskImage.getId ( ) , filteredStorageDomains , diskImage.getvolume_type ( ) , new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( true ) ) ; } } postInitDisks ( ) ; }