auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
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 ) ; }

Target:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( returnValue2 ) ) ; this . allNics = allNics ; queryFreeBonds ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { allBonds = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; initNicModels ( ) ; hostSetupNetworksParametersData.allNics = allNics ; hostSetupNetworksParametersData.existingNetworkAttachments = existingNetworkAttachments ; stopProgress ( ) ; }
Source:
public void glusterServiceNotRequired ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( false ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.glusterServiceSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void glusterServiceNotRequired ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( false ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.glusterServiceSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void isCpuPinningValidWithoutPinnedHost ( ) { org.ovirt.engine.core.bll.VmManagementCommandBase < org.ovirt.engine.core.common.action.VmManagementParametersBase > test = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.VmManagementCommandBase < org.ovirt.engine.core.common.action.VmManagementParametersBase > ( org.ovirt.engine.core.compat.Guid.Empty ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setNumOfSockets ( 6 ) ; vmStatic.setCpuPerSocket ( 2 ) ; vmStatic.setDedicatedVmForVds ( null ) ; org.junit.Assert.assertFalse ( test.isCpuPinningValid ( "0#0" , vmStatic ) ) ; org.junit.Assert.assertFalse ( test.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_WITH_UNDEFINED_HOST ) ) ; }

Target:
public void isCpuPinningValidWithoutPinnedHost ( ) { org.ovirt.engine.core.bll.VmManagementCommandBase < org.ovirt.engine.core.common.action.VmManagementParametersBase > test = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.VmManagementCommandBase < org.ovirt.engine.core.common.action.VmManagementParametersBase > ( org.ovirt.engine.core.compat.Guid.Empty ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setNumOfSockets ( 6 ) ; vmStatic.setCpuPerSocket ( 2 ) ; vmStatic.setDedicatedVmForVdsList ( new java.util.LinkedList < org.ovirt.engine.core.compat.Guid > ( ) ) ; org.junit.Assert.assertFalse ( test.isCpuPinningValid ( "0#0" , vmStatic ) ) ; org.junit.Assert.assertFalse ( test.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_WITH_UNDEFINED_HOST ) ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > generateOptions ( ) { java.util.Map < java.lang.String , java.lang.Object > options = new java.util.HashMap < > ( ) ; options.put ( VdsProperties.CONNECTIVITY_CHECK , java.lang.Boolean.toString ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.getParameters ( ) . isRollbackOnFailure ( ) ) ) ; if ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.getParameters ( ) . isRollbackOnFailure ( ) ) { options.put ( VdsProperties.CONNECTIVITY_TIMEOUT , org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.getParameters ( ) . getConectivityTimeout ( ) ) ; } return options ; }

Target:
private java.util.Map < java.lang.String , java.lang.Object > generateOptions ( ) { java.util.Map < java.lang.String , java.lang.Object > options = new java.util.HashMap < > ( ) ; options.put ( VdsProperties.CONNECTIVITY_CHECK , java.lang.Boolean.toString ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.getParameters ( ) . isRollbackOnFailure ( ) ) ) ; if ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.getParameters ( ) . isRollbackOnFailure ( ) ) { options.put ( VdsProperties.CONNECTIVITY_TIMEOUT , org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.getParameters ( ) . getConnectivityTimeout ( ) ) ; } return options ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; networkModel.getDataCenters ( ) . setItems ( dataCenters ) ; if ( networkModel instanceof org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkModel ) { org.ovirt.engine.core.common.businessentities.StoragePool currentDc = findDc ( networkModel.getNetwork ( ) . getDataCenterId ( ) , dataCenters ) ; networkModel.getDataCenters ( ) . setSelectedItem ( currentDc ) ; } else { networkModel.getDataCenters ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCenters ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; networkModel.getDataCenters ( ) . setItems ( dataCenters ) ; if ( networkModel instanceof org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkModel ) { org.ovirt.engine.core.common.businessentities.StoragePool currentDc = findDc ( networkModel.getNetwork ( ) . getDataCenterId ( ) , dataCenters ) ; networkModel.getDataCenters ( ) . setSelectedItem ( currentDc ) ; } else { networkModel.getDataCenters ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters ) ) ; } }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "\n" ) ; builder.append ( super . toString ( ) ) ; builder.append ( "\n" ) ; org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcObjectDescriptor.toStringBuilder ( getInfo ( ) , builder ) ; return builder.toString ( ) ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "\n" ) ; builder.append ( super . toString ( ) ) ; builder.append ( "\n" ) ; org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcObjectDescriptor.toStringBuilder ( mInfo , builder ) ; return builder.toString ( ) ; }
Source:
protected void selectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . selectedItemPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "status" ) ) { UpdateActionAvailability ( ) ; } else if ( e.PropertyName.equals ( "display_type" ) ) { updateConsoleModels ( ) ; } }

Target:
public void cancel ( ) { org.ovirt.engine.ui.frontend.Frontend.Unsubscribe ( ) ; cancelConfirmation ( ) ; setGuideContext ( null ) ; setWindow ( null ) ; updateActionAvailability ( ) ; }
Source:
public void compensate ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RemoveDisk , new org.ovirt.engine.core.common.action.RemoveDiskParameters ( enclosingCommand.getParameters ( ) . getImageGroupID ( ) ) ) ; enclosingCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; }

Target:
public void endWithFailure ( ) { enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
protected boolean UpdateVmImSpm ( ) { return org.ovirt.engine.core.bll.VmCommand.UpdateVmInSpm ( getVm ( ) . getstorage_pool_id ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VM [ ] { getVm ( ) } ) ) ) ; }

Target:
protected void EndImportCommand ( ) { setVm ( null ) ; EndActionOnAllImageGroups ( ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) . getId ( ) ) ; UpdateVmImSpm ( ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } setSucceeded ( true ) ; }
Source:
protected void executeCommand ( ) { try { _returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; getVDSReturnValue ( ) . setSucceeded ( true ) ; executeVDSCommand ( ) ; } catch ( java.lang.RuntimeException ex ) { setVdsRuntimeError ( ex ) ; } }

Target:
protected void executeCommand ( ) { try { if ( isAsync ( ) ) { executeCommandAsynchronously ( ) ; return ; } _returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; getVDSReturnValue ( ) . setSucceeded ( true ) ; executeVDSCommand ( ) ; } catch ( java.lang.RuntimeException ex ) { setVdsRuntimeError ( ex ) ; } }
Source:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesIntersection ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images1 , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images2 ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > intersection = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images1 ) { if ( ( org.ovirt.engine.core.bll.ImagesHandler.getDiskImageById ( image.getId ( ) , images2 ) ) != null ) { intersection.add ( image ) ; } } return intersection ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesIntersection ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images1 , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images2 ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > intersection = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images1 ) { if ( ( org.ovirt.engine.core.bll.ImagesHandler.getDiskImageById ( image.getId ( ) , images2 ) ) != null ) { intersection.add ( image ) ; } } return intersection ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService > serviceList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService > ) ( source ) ) ; if ( ! ( serviceList.isEmpty ( ) ) ) { return serviceList.get ( 0 ) ; } return null ; } else { return source ; } }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService > serviceList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService > ) ( source ) ) ; if ( ! ( serviceList.isEmpty ( ) ) ) { return serviceList.get ( 0 ) ; } return null ; } else { return source ; } }
Source:
public void attestationServerNotConfiguredProperly ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AttestationServer , StringUtils.EMPTY ) ; org.mockito.Mockito.when ( cluster.supportsTrustedService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.attestationServerConfigured ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.VDS_GROUP_CANNOT_SET_TRUSTED_ATTESTATION_SERVER_NOT_CONFIGURED ) ) ; }

Target:
public void attestationServerNotConfiguredProperly ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AttestationServer , StringUtils.EMPTY ) ; org.mockito.Mockito.when ( cluster.supportsTrustedService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.attestationServerConfigured ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_GROUP_CANNOT_SET_TRUSTED_ATTESTATION_SERVER_NOT_CONFIGURED ) ) ; }
Source:
public static void GetNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.GetAllNetworkQueryParamenters ( dataCenterId ) , aQuery ) ; }

Target:
public static void GetStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void testGetDataAndSetDataWithSessionParam ( ) { org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( "" ) ; container.setData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE ) ; org.junit.Assert.assertNull ( "Get should return null with an empty session" , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; org.junit.Assert.assertEquals ( "Get should return the value with a given session" , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; }

Target:
public void testRemoveWithParam ( ) { container.setData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE ) ; container.removeSessionOnLogout ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; }
Source:
public static void GetGlusterHosts ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress , java.lang.String rootPassword , java.lang.String fingerprint ) { 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.GlusterServersQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterServersQueryParameters ( hostAddress , rootPassword ) ; parameters.setFingerprint ( fingerprint ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServers , parameters , aQuery ) ; }

Target:
public static void GetGlusterVolumeBrickDetails ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volume , java.lang.String brick ) { 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 , volume , brick , true ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { if ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getTemplateType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { return true ; } return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getMasterVm ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { if ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getTemplateType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { return true ; } return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getMasterVm ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getUserId ( ) ) ) ; }
Source:
public void testNullDisksUsages ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics vmStatistics = getVmStatistics ( ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksUsageInXmlRpc ( null ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMStatisticsData ( vmStatistics , xml ) ; org.junit.Assert.assertEquals ( null , vmStatistics.getDisksUsage ( ) ) ; }

Target:
public void testNullDisksUsages ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics vmStatistics = getVmStatistics ( ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksUsageInXmlRpc ( null ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMStatisticsData ( vmStatistics , xml ) ; org.junit.Assert.assertNull ( vmStatistics.getDisksUsage ( ) ) ; }
Source:
public void testRemoveVdsFromAffinityGroups ( ) { org.ovirt.engine.core.common.scheduling.AffinityGroup existing = dao.get ( FixturesTool.EXISTING_AFFINITY_GROUP_ID ) ; org.junit.Assert.assertFalse ( existing.getVdsIds ( ) . isEmpty ( ) ) ; dao.removeVdsFromAffinityGroups ( FixturesTool.VDS_RHEL6_NFS_SPM ) ; org.junit.Assert.assertTrue ( dao.get ( FixturesTool.EXISTING_AFFINITY_GROUP_ID ) . getVdsIds ( ) . isEmpty ( ) ) ; }

Target:
public void testRemoveVdsFromAffinityGroups ( ) { org.ovirt.engine.core.common.scheduling.AffinityGroup existing = dao.get ( FixturesTool.EXISTING_AFFINITY_GROUP_ID ) ; org.junit.jupiter.api.Assertions.assertFalse ( existing.getVdsIds ( ) . isEmpty ( ) ) ; dao.removeVdsFromAffinityGroups ( FixturesTool.VDS_RHEL6_NFS_SPM ) ; org.junit.jupiter.api.Assertions.assertTrue ( dao.get ( FixturesTool.EXISTING_AFFINITY_GROUP_ID ) . getVdsIds ( ) . isEmpty ( ) ) ; }
Source:
private void labelInVfsConfigCommonTest ( boolean inVfsConfig ) { simulateNicExists ( ) ; java.util.Set < java.lang.String > labels = new java.util.HashSet < > ( ) ; if ( inVfsConfig ) { labels.add ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.LABEL ) ; } org.mockito.Mockito.when ( oldVfsConfig.getLabels ( ) ) . thenReturn ( labels ) ; }

Target:
private void labelInVfsConfigCommonTest ( boolean inVfsConfig ) { simulateNicExists ( ) ; java.util.Set < java.lang.String > labels = new java.util.HashSet < > ( ) ; if ( inVfsConfig ) { labels.add ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.LABEL ) ; } org.mockito.Mockito.when ( oldVfsConfig.getNetworkLabels ( ) ) . thenReturn ( labels ) ; }
Source:
public void endWithFailure ( ) { updateDestinitationImageId ( ) ; endCreateAllSnapshots ( ) ; enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
public void endWithFailure ( ) { for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : enclosingCommand.getParameters ( ) . getParametersList ( ) ) { updateDestinitationImageId ( parameters ) ; } endCreateAllSnapshots ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( enclosingCommand.getExecutionContext ( ) , false ) ; enclosingCommand.setExecutionContext ( null ) ; enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
public org.ovirt.engine.api.model.KatelloErrata list ( ) { return mapCollection ( getBackendCollection ( VdcQueryType.GetErrataForEngine , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ) ; }

Target:
public org.ovirt.engine.api.model.KatelloErrata list ( ) { org.ovirt.engine.core.common.businessentities.ErrataData errataData = null ; try { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = runQuery ( VdcQueryType.GetErrataForEngine , new org.ovirt.engine.core.common.queries.GetErrataCountsParameters ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { backendFailure ( returnValue.getExceptionString ( ) ) ; } errataData = returnValue.getReturnValue ( ) ; } catch ( java.lang.Exception e ) { handleError ( e , false ) ; } if ( errataData == null ) { return new org.ovirt.engine.api.model.KatelloErrata ( ) ; } return mapCollection ( errataData.getErrata ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > soundDevList = getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.GetSoundDevicesQuery.getParameters ( ) . getId ( ) , VmDeviceGeneralType.SOUND ) ; java.util.List < java.lang.String > result = new java.util.ArrayList ( soundDevList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice v : soundDevList ) { result.add ( v.getDevice ( ) ) ; } org.ovirt.engine.core.bll.GetSoundDevicesQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > soundDevList = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.GetSoundDevicesQuery.getParameters ( ) . getId ( ) , VmDeviceGeneralType.SOUND ) ; java.util.List < java.lang.String > result = new java.util.ArrayList ( soundDevList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice v : soundDevList ) { result.add ( v.getDevice ( ) ) ; } org.ovirt.engine.core.bll.GetSoundDevicesQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
public void setSelectedItems ( java.util.List value ) { if ( ( selectedItems ) != value ) { SelectedItemsChanging ( value , selectedItems ) ; selectedItems = value ; SelectedItemsChanged ( ) ; getSelectedItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SelectedItems" ) ) ; } }

Target:
public void setSelectedItems ( java.util.List value ) { if ( ( selectedItems ) != value ) { selectedItemsChanging ( value , selectedItems ) ; selectedItems = value ; selectedItemsChanged ( ) ; getSelectedItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SelectedItems" ) ) ; } }
Source:
public static 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.RunQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void GetAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
public void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , 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 ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
public void validateVmInPreview ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }

Target:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( 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 ) ; }
Source:
private void InitVdsBroker ( ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.infoFormat ( "vdsBroker({0},{1})" , _vds.gethost_name ( ) , _vds.getport ( ) ) ; int clientTimeOut = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.vdsTimeout ) ) * 1000 ; org.ovirt.engine.core.utils.Pair < org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerConnector , org.apache.commons.httpclient.HttpClient > returnValue = org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcUtils.getConnection ( _vds.gethost_name ( ) , _vds.getport ( ) , clientTimeOut , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerConnector.class , org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.UseSecureConnectionWithServers ) ) ; _vdsProxy = new org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerWrapper ( returnValue.getFirst ( ) , returnValue.getSecond ( ) ) ; }

Target:
private void InitVdsBroker ( ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.infoFormat ( "vdsBroker({0},{1})" , _vds.gethost_name ( ) , _vds.getport ( ) ) ; int clientTimeOut = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.vdsTimeout ) ) * 1000 ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerConnector , org.apache.commons.httpclient.HttpClient > returnValue = org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcUtils.getConnection ( _vds.gethost_name ( ) , _vds.getport ( ) , clientTimeOut , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerConnector.class , org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.UseSecureConnectionWithServers ) ) ; _vdsProxy = new org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerWrapper ( returnValue.getFirst ( ) , returnValue.getSecond ( ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . get ( getVds ( ) . getId ( ) ) ; vdsDynamic.setnet_config_dirty ( getVds ( ) . getnet_config_dirty ( ) ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.UpdateVdsDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVdsDynamicDataVDSCommandParameters ( vdsDynamic ) ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . updateNetConfigDirty ( getVds ( ) . getId ( ) , getVds ( ) . getNetConfigDirty ( ) ) ; return null ; }
Source:
protected java.util.Map < java.lang.String , java.lang.String > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getvm_name ( ) ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getvm_name ( ) , LockingGroup.VM_NAME.name ( ) ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , java.lang.String > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getVmName ( ) ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getVmName ( ) , LockingGroup.VM_NAME.name ( ) ) ; } return null ; }
Source:
public static void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void testGetAllQuotaSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Quota" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.Quota ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( quotaResultList , searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testGetAllGlusterVolumesSearch ( ) throws java.lang.Exception { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "Volumes" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.GlusterVolume ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( glusterVolumeList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
public void mockQuotaDao ( ) { quota = mockStorageQuota ( quotaGuid ) ; org.mockito.Mockito.when ( quotaDao.getById ( quotaGuid ) ) . thenReturn ( quota ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotaList = new java.util.ArrayList < > ( ) ; quotaList.add ( new org.ovirt.engine.core.common.businessentities.Quota ( ) ) ; quotaList.add ( new org.ovirt.engine.core.common.businessentities.Quota ( ) ) ; org.mockito.Mockito.when ( quotaDao.getQuotaByStoragePoolGuid ( storagePoolUUID ) ) . thenReturn ( quotaList ) ; org.mockito.Mockito.when ( quotaDao.isQuotaInUse ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.Quota.class ) ) ) . thenReturn ( false ) ; }

Target:
public void mockQuotaDao ( ) { quota = mockStorageQuota ( quotaGuid ) ; org.mockito.Mockito.when ( quotaDao.getById ( quotaGuid ) ) . thenReturn ( quota ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotaList = new java.util.ArrayList < > ( ) ; quotaList.add ( new org.ovirt.engine.core.common.businessentities.Quota ( ) ) ; quotaList.add ( new org.ovirt.engine.core.common.businessentities.Quota ( ) ) ; org.mockito.Mockito.when ( quotaDao.getQuotaByStoragePoolGuid ( storagePoolUUID ) ) . thenReturn ( quotaList ) ; org.mockito.Mockito.when ( quotaDao.isQuotaInUse ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.Quota.class ) ) ) . thenReturn ( false ) ; }
Source:
private void fillReportedConfigurations ( java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > networkNameToNicMap , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap , org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.ovirt.engine.core.common.businessentities.network.Network network = networkMap.get ( networkAttachment.getNetworkId ( ) ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = getNicToWhichIsNetworkAttached ( networkNameToNicMap , networkMap , networkAttachment ) ; if ( nic != null ) { org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations reportedConfigurations = createNetworkInSyncWithVdsNetworkInterface ( networkAttachment , nic , network ) . reportConfigurationsOnHost ( ) ; networkAttachment.setReportedConfigurations ( reportedConfigurations ) ; } }

Target:
private void fillReportedConfigurations ( java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > networkNameToNicMap , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap , org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment , org.ovirt.engine.core.common.businessentities.Cluster cluster ) { org.ovirt.engine.core.common.businessentities.network.Network network = networkMap.get ( networkAttachment.getNetworkId ( ) ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = getNicToWhichIsNetworkAttached ( networkNameToNicMap , networkMap , networkAttachment ) ; if ( nic != null ) { org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface isInSync = createNetworkInSyncWithVdsNetworkInterface ( networkAttachment , nic , network , cluster ) ; org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations reportedConfigurations = isInSync.reportConfigurationsOnHost ( ) ; networkAttachment.setReportedConfigurations ( reportedConfigurations ) ; } }
Source:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmsRunningOnOrMigratingToVds ( 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 ) { 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.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.VolumeType getTemplateVolumeType ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat volumeFormat , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { switch ( volumeFormat ) { case COW : return org.ovirt.engine.core.common.businessentities.storage.VolumeType.Sparse ; case RAW : default : return storageType.isFileDomain ( ) ? org.ovirt.engine.core.common.businessentities.storage.VolumeType.Sparse : org.ovirt.engine.core.common.businessentities.storage.VolumeType.Preallocated ; } }
Source:
private static void logField ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticFromOvf , java.lang.String fieldName , java.lang.String fieldValue ) { java.lang.String vmName = vmStaticFromOvf.getName ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "FieldName" , fieldName ) ; logable.addCustomValue ( "VmName" , vmName ) ; logable.addCustomValue ( "FieldValue" , fieldValue ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VM_IMPORT_INFO ) ; }

Target:
private static void logField ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticFromOvf , java.lang.String fieldName , java.lang.String fieldValue ) { java.lang.String vmName = vmStaticFromOvf.getName ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "FieldName" , fieldName ) ; logable.addCustomValue ( "VmName" , vmName ) ; logable.addCustomValue ( "FieldValue" , fieldValue ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , AuditLogType.VM_IMPORT_INFO ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command , java.lang.Object ... parameters ) { if ( ( ( command == ( getEditCommand ( ) ) ) && ( ( parameters.length ) > 0 ) ) && ( java.lang.Boolean.TRUE.equals ( parameters [ 0 ] ) ) ) { this . clusterPolicyFirst = true ; super . ExecuteCommand ( command , parameters ) ; this . clusterPolicyFirst = false ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command , java.lang.Object ... parameters ) { if ( ( ( command == ( getEditCommand ( ) ) ) && ( ( parameters.length ) > 0 ) ) && ( java.lang.Boolean.TRUE.equals ( parameters [ 0 ] ) ) ) { this . clusterPolicyFirst = true ; super . executeCommand ( command , parameters ) ; this . clusterPolicyFirst = false ; } }