auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getHugeMemoryFitsIntoOneHugePage ( ) { org.ovirt.engine.core.common.utils.HugePageUtils utils = new org.ovirt.engine.core.common.utils.HugePageUtils ( ) ; org.ovirt.engine.core.common.businessentities.VmBase base = new org.ovirt.engine.core.common.businessentities.VmBase ( ) ; base.setCustomProperties ( "hugepages=1024" ) ; base.setMemSizeMb ( 1024 ) ; org.hamcrest.MatcherAssert.assertThat ( utils.getHugePages ( base ) . size ( ) , org.hamcrest.core.Is.is ( 1 ) ) ; org.hamcrest.MatcherAssert.assertThat ( utils.getHugePages ( base ) . get ( 1024 ) , org.hamcrest.core.Is.is ( 1 ) ) ; }

Target:
public void getHugeMemoryFitsIntoOneHugePage ( ) { org.ovirt.engine.core.common.businessentities.VmBase base = new org.ovirt.engine.core.common.businessentities.VmBase ( ) ; base.setCustomProperties ( "hugepages=1048576" ) ; base.setMemSizeMb ( 1024 ) ; org.hamcrest.MatcherAssert.assertThat ( org.ovirt.engine.core.common.utils.HugePageUtils.getHugePages ( base ) . size ( ) , org.hamcrest.core.Is.is ( 1 ) ) ; org.hamcrest.MatcherAssert.assertThat ( org.ovirt.engine.core.common.utils.HugePageUtils.getHugePages ( base ) . get ( 1048576 ) , org.hamcrest.core.Is.is ( 1 ) ) ; }
Source:
private void initMessages ( ) { if ( isValidateByVmSnapshots ( ) ) { initVmSnapshots ( ) ; } else { initVmDisks ( ) ; } }

Target:
private void initMessages ( ) { if ( ( vm.isRunning ( ) ) && ( ! ( vm.getHasAgent ( ) ) ) ) { setMessage ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . liveSnapshotWithNoGuestAgentMsg ( ) ) ; } if ( isValidateByVmSnapshots ( ) ) { initVmSnapshots ( ) ; } else { initVmDisks ( ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.DiskImage i = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeFromDiskImage ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ) ) ; return i ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.DiskImage i = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeInBytes ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ) ) ; return i ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesList ( ) { if ( ( ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImagesList ( ) ) == null ) && ( ! ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . setImagesList ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) ) ) ; } return org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImagesList ( ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesList ( ) { if ( ( ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImages ( ) ) == null ) && ( ! ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . setImages ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) ) ) ; } return org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImages ( ) ; }
Source:
public java.lang.String render ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan object ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( object.getName ( ) ) ; if ( ( ( object.getAddress ( ) ) != null ) && ( ! ( object.getAddress ( ) . isEmpty ( ) ) ) ) { sb.append ( " (" ) . append ( object.getAddress ( ) ) . append ( ")" ) ; } return sb.toString ( ) ; }

Target:
public java.lang.String render ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan object ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( object.getName ( ) ) ; if ( ( object.getInterface ( ) . getVlanId ( ) ) != null ) { sb.append ( " (" ) . append ( object.getInterface ( ) . getVlanId ( ) ) . append ( ")" ) ; } return sb.toString ( ) ; }
Source:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertTrue ( model.isSparse ( ) ) ; org.junit.Assert.assertTrue ( model.isPropagateErrors ( ) ) ; }

Target:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( model.isSparse ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( model.isPropagateErrors ( ) ) ; }
Source:
public void onTimer ( ) { try { org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.info ( "Start deleteAgedOutCommandEntities" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . addDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.CommandEntityAgingThreshold ) ) * ( - 1 ) ) ) ; org.ovirt.engine.core.bll.tasks.TaskManagerUtil.removeAllCommandsBeforeDate ( latestTimeToKeep ) ; org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.info ( "Finished deleteAgedOutCommandEntities" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.error ( "deleteAgedOutCommandEntities failed with exception" , e ) ; } }

Target:
public void onTimer ( ) { try { org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.info ( "Start deleteAgedOutCommandEntities" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . addDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.CommandEntityAgingThreshold ) ) * ( - 1 ) ) ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsBeforeDate ( latestTimeToKeep ) ; org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.info ( "Finished deleteAgedOutCommandEntities" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.error ( "deleteAgedOutCommandEntities failed with exception" , e ) ; } }
Source:
public void getRpmVersion ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }
Source:
protected int CalcSpmCpuConsumption ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return ( vds.getSpmStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ? 0 : ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.SpmVCpuConsumption ) ) * ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VcpuConsumptionPercentage ) ) ) / ( vds.getCpuCores ( ) ) ; }

Target:
protected int calcSpmCpuConsumption ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return ( vds.getSpmStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ? 0 : ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.SpmVCpuConsumption ) ) * ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VcpuConsumptionPercentage ) ) ) / ( vds.getCpuCores ( ) ) ; }
Source:
public void testNotRemovingLabeledNetworksReferencingUnlabeledNetworkRemovalIsOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network unlabeledNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unlabeledNetwork.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( unlabeledNetwork ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( java.util.Arrays.asList ( unlabeledNetwork ) ) ; org.junit.Assert.assertThat ( validator.notRemovingLabeledNetworks ( networkAttachment , null ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

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 ) ; managementNetworkUtil = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil.class ) ; bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; }
Source:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClustersByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > > aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.SortListByNameConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClustersByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private boolean isSpecifiedDisksExist ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { if ( ( disks == null ) || ( disks.isEmpty ( ) ) ) { return true ; } org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = createDiskImageValidator ( disks ) ; if ( ! ( validate ( diskImagesValidator.diskImagesNotExist ( ) ) ) ) { return false ; } return true ; }

Target:
private boolean isSpecifiedDisksExist ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { if ( ( disks == null ) || ( disks.isEmpty ( ) ) ) { return true ; } org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = createDiskImageValidator ( disks ) ; if ( ! ( validate ( diskImagesValidator.diskImagesNotExist ( ) ) ) ) { return false ; } return true ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml renderTooltip ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , java.lang.String value ) { if ( value != null ) { com.google.gwt.safehtml.shared.SafeHtml safeHtmlValue = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( value ) ; if ( ( maxTextLength ) >= 0 ) { com.google.gwt.safehtml.shared.SafeHtml renderedValue = getRenderedValue ( safeHtmlValue ) ; if ( ! ( safeHtmlValue.equals ( renderedValue ) ) ) { return safeHtmlValue ; } } else if ( contentOverflows ( parent.getFirstChildElement ( ) ) ) { return safeHtmlValue ; } } return null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( java.lang.String value , com.google.gwt.dom.client.Element parent ) { if ( value != null ) { com.google.gwt.safehtml.shared.SafeHtml safeHtmlValue = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( value ) ; if ( ( maxTextLength ) >= 0 ) { com.google.gwt.safehtml.shared.SafeHtml renderedValue = getRenderedValue ( safeHtmlValue ) ; if ( ! ( safeHtmlValue.equals ( renderedValue ) ) ) { return safeHtmlValue ; } } else if ( contentOverflows ( parent.getFirstChildElement ( ) ) ) { return safeHtmlValue ; } } return null ; }
Source:
private boolean isBalloonDeviceExists ( java.util.Collection < org.ovirt.engine.core.common.businessentities.VmDevice > devices ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : getVm ( ) . getManagedVmDeviceMap ( ) . values ( ) ) { if ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isMemoryBalloon ( vmDevice ) ) { return true ; } } return false ; }

Target:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmDisksDummies ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksDummies = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageDomainId : getParameters ( ) . getImageToDestinationDomainMap ( ) . values ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( storageDomainId ) ) ) ; disksDummies.add ( diskImage ) ; } return disksDummies ; }
Source:
public void testNoStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( org.ovirt.engine.core.utils.ErrorTranslatorTest.FILENAME ) ; java.util.List < java.lang.String > error = et.translateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) ) ; org.junit.Assert.assertEquals ( "Size" , 1 , error.size ( ) ) ; org.junit.Assert.assertEquals ( "String should equal" , "VM not found" , error.get ( 0 ) ) ; }

Target:
public void testNoStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( org.ovirt.engine.core.utils.ErrorTranslatorTest.FILENAME ) ; java.util.List < java.lang.String > error = et.translateErrorText ( java.util.Collections.singletonList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) ) ; org.junit.Assert.assertEquals ( "Size" , 1 , error.size ( ) ) ; org.junit.Assert.assertEquals ( "String should equal" , "VM not found" , error.get ( 0 ) ) ; }
Source:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult isLunDiskVisible ( final org.ovirt.engine.core.common.businessentities.storage.LUNs lun , org.ovirt.engine.core.common.businessentities.VDS vds ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = executeGetDeviceList ( vds.getId ( ) , lun.getLunType ( ) ) ; boolean lunExists = org.apache.commons.collections.CollectionUtils.exists ( luns , new org.apache.commons.collections.Predicate ( ) { @ java.lang.Override public boolean evaluate ( java.lang.Object o ) { return ( ( org.ovirt.engine.core.common.businessentities.storage.LUNs ) ( o ) ) . getId ( ) . equals ( lun.getId ( ) ) ; } } ) ; return lunExists ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_LUN_INVALID ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateNotHostedEngineDisk ( ) { return isHostedEngineDirectLunDisk ( ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_HOSTED_ENGINE_DISK ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static 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 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit ) , aQuery ) ; }

Target:
public static void GetStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.storage_server_connections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
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 ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { allBonds = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; initNetworkModels ( ) ; initDcNetworkParams ( ) ; initNicModels ( ) ; hostSetupNetworksParametersData.allNics = allNics ; hostSetupNetworksParametersData.existingNetworkAttachments = existingNetworkAttachments ; stopProgress ( ) ; }
Source:
public static void getDocumentationBaseURL ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getGlusterRebalanceStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRebalanceStatus , parameters , aQuery ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsedByTemplates ( final org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVmTemplateDAO ( ) . getAllForNetwork ( network.getId ( ) ) ; if ( templates.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "ENTITIES_USING_NETWORK" , templates ) ; replacements.add ( VdcBllMessages.VAR__TYPE__VM_TEMPLATES.name ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_IN_USE , replacements ) ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsedByTemplates ( final org.ovirt.engine.core.common.businessentities.network.Network network ) { return networkNotUsed ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVmTemplateDAO ( ) . getAllForNetwork ( network.getId ( ) ) , VdcBllMessages.VAR__ENTITIES__VM_TEMPLATES ) ; }
Source:
public static void getDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { 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 < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getAAAProfilesList ( 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsForDiskId ( ) { if ( ( listVms ) == null ) { listVms = org.ovirt.engine.core.bll.RemoveDiskCommand.getVmDAO ( ) . getVmsListForDisk ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getEntityId ( ) ) ) ) ; } return listVms ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsForDiskId ( ) { if ( ( listVms ) == null ) { listVms = org.ovirt.engine.core.bll.RemoveDiskCommand.getVmDAO ( ) . getVmsListForDisk ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getDiskId ( ) ) ) ) ; } return listVms ; }
Source:
private org.ovirt.engine.core.bll.network.macpool.MacPool createPoolInternal ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { if ( macPools.containsKey ( macPool.getId ( ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST ) ; } org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.log.debug ( "Creating new MacPool {}." , macPool ) ; org.ovirt.engine.core.bll.network.macpool.MacPool poolForScope = macPoolFactory.createMacPool ( macPool ) ; macPools.put ( macPool.getId ( ) , poolForScope ) ; return poolForScope ; }

Target:
private org.ovirt.engine.core.bll.network.macpool.MacPool createPoolInternal ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool , boolean engineStartup ) { if ( macPools.containsKey ( macPool.getId ( ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST ) ; } org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.log.debug ( "Creating new MacPool {}." , macPool ) ; org.ovirt.engine.core.bll.network.macpool.MacPool poolForScope = macPoolFactory.createMacPool ( macPool , engineStartup ) ; macPools.put ( macPool.getId ( ) , poolForScope ) ; return poolForScope ; }
Source:
public void updateHostAddressNotAllowedWhenStatusNotInstallFailed ( ) { org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( oldHost.getStatus ( ) ) . thenReturn ( VDSStatus.Maintenance ) ; org.junit.Assert.assertThat ( validator.updateHostAddressAllowed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_HOSTNAME_CANNOT_CHANGE ) ) ; }

Target:
public void updateHostAddressNotAllowedWhenStatusNotInstallFailed ( ) { org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( oldHost.getStatus ( ) ) . thenReturn ( VDSStatus.Maintenance ) ; org.hamcrest.MatcherAssert.assertThat ( validator.updateHostAddressAllowed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_HOSTNAME_CANNOT_CHANGE ) ) ; }
Source:
private org.ovirt.engine.core.common.users.VdcUser getLoggedInUser ( javax.servlet.http.HttpServletRequest request ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = backend.RunQuery ( VdcQueryType.GetUserBySessionId , createQueryParams ( request.getSession ( ) . getId ( ) , filterQueries ( ) ) ) ; if ( returnValue.getSucceeded ( ) ) { return ( ( org.ovirt.engine.core.common.users.VdcUser ) ( returnValue.getReturnValue ( ) ) ) ; } else { return null ; } }

Target:
private org.ovirt.engine.core.common.users.VdcUser getLoggedInUser ( javax.servlet.http.HttpServletRequest request ) { return ( ( org.ovirt.engine.core.common.users.VdcUser ) ( runQuery ( VdcQueryType.GetUserBySessionId , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , request ) ) ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > getLinuxOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; }

Target:
public static void initOsNames ( ) { 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.osNames = ( ( java.util.HashMap < java.lang.Integer , java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsIds ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsNames ) , callback ) ; }
Source:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = returnValue.getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { domain.setId ( domain.getStoragePoolId ( ) ) ; } java.util.Collections.sort ( domains , new org.ovirt.engine.ui.uicommonweb.Linq.StorageDomainByPoolNameComparator ( ) ) ; setItems ( domains ) ; setIsEmpty ( ( ( getItems ( ) . size ( ) ) == 0 ) ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = returnValue.getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { domain.setId ( domain.getStoragePoolId ( ) ) ; } java.util.Collections.sort ( domains , java.util.Comparator.comparing ( StorageDomain :: getStoragePoolName , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ) ; setItems ( domains ) ; setIsEmpty ( ( ( getItems ( ) . size ( ) ) == 0 ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc desktopLock ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.desktopLock ( vmId ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc snapshot ( java.lang.String vmId , java.util.Map < java.lang.String , java.lang.String > [ ] disks , java.lang.String memory ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.snapshot ( vmId , disks , memory ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void waitForConnect ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { org.ovirt.vdsm.jsonrpc.client.utils.retry.AwaitRetry.retry ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws java.lang.Exception { connected.await ( policy.getRetryTimeOut ( ) , policy.getTimeUnit ( ) ) ; return null ; } } ) ; } catch ( java.lang.Exception e ) { log.error ( e.getMessage ( ) , e ) ; disconnect ( "Waiting for connect failed" ) ; throw new java.lang.IllegalStateException ( "Communication failed" ) ; } }

Target:
private void waitForConnect ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { org.ovirt.vdsm.jsonrpc.client.utils.retry.AwaitRetry.retry ( ( ) -> { org.ovirt.vdsm.jsonrpc.client.reactors.stomp.connected.await ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.policy.getRetryTimeOut ( ) , org.ovirt.vdsm.jsonrpc.client.reactors.stomp.policy.getTimeUnit ( ) ) ; return null ; } ) ; } catch ( java.lang.Exception e ) { log.error ( e.getMessage ( ) , e ) ; disconnect ( "Waiting for connect failed" ) ; throw new java.lang.IllegalStateException ( "Communication failed" ) ; } }
Source:
public void addISCSINonEmptyIqn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( newISCSIConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void addISCSINonEmptyIqn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( newISCSIConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
private org.ovirt.engine.core.common.action.ActionReturnValue attachToAllClusters ( org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid networkId ) { org.ovirt.engine.core.common.queries.QueryReturnValue queryReturnValue = runInternalQuery ( QueryType.GetClustersByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = queryReturnValue.getReturnValue ( ) ; return networkHelper.attachNetworkToClusters ( networkId , clusters.stream ( ) . map ( Cluster :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.compat.Guid > getAllClusterIdsInDataCenter ( org.ovirt.engine.core.compat.Guid dataCenterId ) { org.ovirt.engine.core.common.queries.QueryReturnValue queryReturnValue = runInternalQuery ( QueryType.GetClustersByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = queryReturnValue.getReturnValue ( ) ; return clusters.stream ( ) . map ( Cluster :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public void testAddHostedEngineStorageFails ( ) { org.mockito.Mockito.when ( command.getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ) . when ( command ) . getAllLuns ( ) ; parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.junit.Assert.assertFalse ( command.canAddDomain ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.assertCanDoActionMessages ( "Add self hosted engine storage domain succeeded where it should have failed" , command , VdcBllMessages.ACTION_TYPE_FAILED_HOSTED_ENGINE_STORAGE ) ; }

Target:
public void testAddHostedEngineStorageSucceeds ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) . when ( command ) . getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( command ) . getAllLuns ( ) ; parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.junit.Assert.assertTrue ( command.canAddDomain ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = super . getPermissionCheckSubjects ( ) ; if ( ( ( getVm ( ) ) != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( getVm ( ) . getCustomProperties ( ) ) ) ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getVm ( ) . getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.common.businessentities.ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES ) ) ; } return permissionList ; }

Target:
private void removeMemoryVolumes ( java.lang.String memoryVolume , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( memoryVolume , vmId ) , org.ovirt.engine.core.bll.ImportVmCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.log.errorFormat ( "Failed to remove memory volumes: {0}" , memoryVolume ) ; } }
Source:
public static java.lang.String map ( org.ovirt.engine.core.common.businessentities.ArchitectureType model , java.lang.String template ) { if ( model != null ) { switch ( model ) { case undefined : return Architecture.UNDEFINED.value ( ) ; case x86_64 : return Architecture.X86_64.value ( ) ; case ppc64 : return Architecture.PPC64.value ( ) ; default : return null ; } } return null ; }

Target:
public static org.ovirt.engine.api.model.Architecture map ( org.ovirt.engine.core.common.businessentities.ArchitectureType model , java.lang.String template ) { if ( model != null ) { switch ( model ) { case undefined : return org.ovirt.engine.api.model.Architecture.UNDEFINED ; case x86_64 : return org.ovirt.engine.api.model.Architecture.X86_64 ; case ppc64 : return org.ovirt.engine.api.model.Architecture.PPC64 ; default : return null ; } } return null ; }
Source:
public void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType action , org.ovirt.engine.core.common.errors.VdcFault fault ) { if ( isRaiseErrorModalPanel ( action , fault ) ) { errorPopupManager.show ( messages.uiCommonRunActionExecutionFailed ( org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . translate ( action ) , fault.getMessage ( ) ) ) ; } }

Target:
public void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType action , org.ovirt.engine.core.common.errors.VdcFault fault ) { if ( isRaiseErrorModalPanel ( action , fault ) ) { errorPopupManager.show ( org.ovirt.engine.ui.common.uicommon.FrontendEventsHandlerImpl.messages.uiCommonRunActionExecutionFailed ( org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . translate ( action ) , fault.getMessage ( ) ) ) ; } }
Source:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }

Target:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; initAndAssertValidation ( true ) ; }

Target:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; setupCpu ( ) ; validateFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile object ) { java.lang.String name = constants.UnlimitedStorageQos ( ) ; if ( ( object.getQosId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.qos.StorageQos storageQos = getModel ( ) . getStorageQos ( object.getQosId ( ) ) ; if ( storageQos != null ) { name = storageQos.getName ( ) ; } } return name ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile object ) { java.lang.String name = constants.unlimitedQos ( ) ; if ( ( object.getQosId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.qos.StorageQos storageQos = getModel ( ) . getQos ( object.getQosId ( ) ) ; if ( storageQos != null ) { name = storageQos.getName ( ) ; } } return name ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getAllRepoFilesForAllStoragePools ( org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainType , org.ovirt.engine.core.common.businessentities.StoragePoolStatus storagePoolStatus , org.ovirt.engine.core.common.businessentities.StorageDomainStatus storageDomainStatus , org.ovirt.engine.core.common.businessentities.VDSStatus vdsStatus ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_domain_type" , storageDomainType.getValue ( ) ) ; parameterSource.addValue ( "storage_pool_status" , storagePoolStatus.getValue ( ) ) ; parameterSource.addValue ( "vds_status" , vdsStatus.getValue ( ) ) ; parameterSource.addValue ( "storage_domain_status" , storageDomainStatus.getValue ( ) ) ; return getCallsHandler ( ) . executeReadList ( "GetRepo_files_in_all_storage_pools" , org.ovirt.engine.core.dao.RepoFileMetaDataDAODbFacadeImpl.ThinRepoFileMetaDataMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > getAllRepoFilesForAllStoragePools ( org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainType , org.ovirt.engine.core.common.businessentities.StoragePoolStatus storagePoolStatus , org.ovirt.engine.core.common.businessentities.StorageDomainStatus storageDomainStatus , org.ovirt.engine.core.common.businessentities.VDSStatus vdsStatus ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_domain_type" , storageDomainType.getValue ( ) ) ; parameterSource.addValue ( "storage_pool_status" , storagePoolStatus.getValue ( ) ) ; parameterSource.addValue ( "vds_status" , vdsStatus.getValue ( ) ) ; parameterSource.addValue ( "storage_domain_status" , storageDomainStatus.getValue ( ) ) ; return getCallsHandler ( ) . executeReadList ( "GetRepo_files_in_all_storage_pools" , org.ovirt.engine.core.dao.RepoFileMetaDataDAODbFacadeImpl.ThinRepoImageMapper.instance , parameterSource ) ; }