auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) != null ) && ( ( java.lang.Boolean ) ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) ) ) { getGlusterHostAddress ( ) . setIsChangable ( true ) ; getGlusterHostPassword ( ) . setIsChangable ( true ) ; } else { getGlusterHostAddress ( ) . setIsChangable ( false ) ; getGlusterHostPassword ( ) . setIsChangable ( false ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.Boolean entity = getOptimizeForSpeed ( ) . getEntity ( ) ; if ( entity ) { getGuarantyResources ( ) . setEntity ( true ) ; } getAllowOverbooking ( ) . setIsChangable ( ( ! entity ) ) ; }
Source:
public void canDoActionPreallocatedSpaceCheckFailsSize ( ) { final int availableSize = 3 ; final int usedSize = 7 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
private static org.ovirt.engine.core.bll.validator.StorageDomainValidator mockStorageDomainValidator ( ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.StorageDomainValidator.class ) ; org.mockito.Mockito.when ( storageDomainValidator.isDomainExistAndActive ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( storageDomainValidator.isDomainWithinThresholds ( ) ) . thenReturn ( ValidationResult.VALID ) ; return storageDomainValidator ; }
Source:
protected void EndSuccessfully ( ) { org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.EndActionOnDisks ( ) ; if ( ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unlockVm ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getCompensationContext ( ) ) ; restoreVmConfigFromSnapshot ( ) ; } else { org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "VmCommand::EndVmCommand: Vm is null - not performing EndAction on Vm" ) ; } org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.setSucceeded ( true ) ; }

Target:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.endActionOnDisks ( ) ; if ( ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unlockVm ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getCompensationContext ( ) ) ; restoreVmConfigFromSnapshot ( ) ; } else { org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "VmCommand::EndVmCommand: Vm is null - not performing EndAction on Vm" ) ; } org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.setSucceeded ( true ) ; }
Source:
public static boolean VerifyAddVm ( java.util.List < java.lang.String > reasons , int nicsCount , int vmPriority ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . getAvailableMacsCount ( ) ) < nicsCount ) { if ( reasons != null ) { reasons.add ( VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES.toString ( ) ) ; } returnValue = false ; } else if ( ! ( org.ovirt.engine.core.bll.VmTemplateCommand.IsVmPriorityValueLegal ( vmPriority , reasons ) ) ) { returnValue = false ; } return returnValue ; }

Target:
public static boolean verifyAddVm ( java.util.List < java.lang.String > reasons , int nicsCount , int vmPriority ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . getAvailableMacsCount ( ) ) < nicsCount ) { if ( reasons != null ) { reasons.add ( VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES.toString ( ) ) ; } returnValue = false ; } else if ( ! ( org.ovirt.engine.core.bll.VmTemplateCommand.isVmPriorityValueLegal ( vmPriority , reasons ) ) ) { returnValue = false ; } return returnValue ; }
Source:
public void getNetworkConnectivityCheckTimeoutInSeconds ( 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 ( ) : 120 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.NetworkConnectivityCheckTimeoutInSeconds , getDefaultConfigurationVersion ( ) ) , 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 ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
public void testUpdate ( ) { setUpEntityQueryExpectations ( getVm ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , VMStatus.Down ) ) ; setUpEntityQueryExpectations ( getVm ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO , org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , VMStatus.Down ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVm , org.ovirt.engine.core.common.action.VmManagementParametersBase.class , new java.lang.String [ ] { "VmStaticData.IsoPath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO } , true , true ) ) ; org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO ) ; cdrom = resource.update ( cdrom ) ; org.junit.Assert.assertTrue ( cdrom.isSetFile ( ) ) ; }

Target:
public void testUpdate ( ) { setUpEntityQueryExpectations ( getVm ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , VMStatus.Down ) ) ; setUpEntityQueryExpectations ( getVm ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO , org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , VMStatus.Down ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVm , org.ovirt.engine.core.common.action.VmManagementParametersBase.class , new java.lang.String [ ] { "VmStaticData.IsoPath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO } , true , true ) ) ; org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO ) ; cdrom = resource.update ( cdrom ) ; org.junit.jupiter.api.Assertions.assertTrue ( cdrom.isSetFile ( ) ) ; }
Source:
public void getAAANamespaces ( 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.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getAAANamespaces ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.Map < java.lang.String , java.util.List < java.lang.String > > > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.MapConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static java.lang.Integer map ( org.ovirt.engine.api.model.NicInterface type ) { switch ( type ) { case RTL8139_VIRTIO : return 0 ; case RTL8139 : return 1 ; case E1000 : return 2 ; case VIRTIO : return 3 ; default : return - 1 ; } }

Target:
public static java.lang.Integer map ( org.ovirt.engine.api.model.NicInterface type ) { switch ( type ) { case RTL8139_VIRTIO : return 0 ; case RTL8139 : return 1 ; case E1000 : return 2 ; case VIRTIO : return 3 ; case SPAPR_VLAN : return 4 ; default : return - 1 ; } }
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.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; }

Target:
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.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; }
Source:
public void testGetAllWithFailbackByVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllWithFailbackByVds ( org.ovirt.engine.core.dao.VmStaticDaoTest.VDS_STATIC_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmStatic vm : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmStaticDaoTest.VDS_GROUP_ID , vm.getVdsGroupId ( ) ) ; } }

Target:
public void testGetAllWithFailbackByVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllWithFailbackByVds ( org.ovirt.engine.core.dao.VmStaticDaoTest.VDS_STATIC_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmStatic vm : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmStaticDaoTest.CLUSTER_ID , vm.getClusterId ( ) ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.storage.DiskVmElement updateDiskVmElementFromDisk ( org.ovirt.engine.api.model.Disk disk , org.ovirt.engine.core.common.businessentities.storage.DiskVmElement diskVmElement ) { if ( disk.isSetInterface ( ) ) { diskVmElement.setDiskInterface ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.forValue ( disk.getInterface ( ) . name ( ) . toLowerCase ( ) ) ) ; } if ( disk.isSetBootable ( ) ) { diskVmElement.setBoot ( disk.isBootable ( ) ) ; } return diskVmElement ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskVmElement updateDiskVmElementFromDisk ( org.ovirt.engine.api.model.Disk disk , org.ovirt.engine.core.common.businessentities.storage.DiskVmElement diskVmElement ) { if ( disk.isSetInterface ( ) ) { diskVmElement.setDiskInterface ( org.ovirt.engine.api.restapi.types.DiskMapper.mapInterface ( disk.getInterface ( ) ) ) ; } if ( disk.isSetBootable ( ) ) { diskVmElement.setBoot ( disk.isBootable ( ) ) ; } return diskVmElement ; }
Source:
public void testSetStatusForRequiredNetwork ( ) { org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID ) ) . thenReturn ( createHosts ( true , false ) ) ; underTest.setStatus ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME ) ) ; }

Target:
private void testSetStatusForRequiredNetwork ( java.lang.String networkNameOnNic ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = createHosts ( false , true ) ; final org.ovirt.engine.core.common.businessentities.VDS activeHost = hosts.get ( 1 ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID ) ) . thenReturn ( hosts ) ; org.mockito.Mockito.when ( hostNicsUtil.findHostNics ( activeHost.getId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( createNic ( networkNameOnNic ) ) ) ; underTest.setStatus ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME ) ) ; }
Source:
private void InitMaximalVmMemSize32OS ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetMaximalVmMemSize32OS ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; vmModel.set_MaxMemSize32 ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; } } , getHash ( ) ) ) ; }

Target:
private void initMaximalVmMemSize32OS ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaximalVmMemSize32OS ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; vmModel.set_MaxMemSize32 ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; } } , getHash ( ) ) ) ; }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { emailEditor.setLabel ( constants.manageEventsPopupEmailLabel ( ) ) ; titleLabel.setText ( constants.manageEventsPopupTitleLabel ( ) ) ; expandAllButton.setText ( constants.treeExpandAll ( ) ) ; collapseAllButton.setText ( constants.treeCollapseAll ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { emailEditor.setLabel ( constants.manageEventsPopupEmailLabel ( ) ) ; titleLabel.setText ( constants.manageEventsPopupTitleLabel ( ) ) ; expandAllButton.setText ( constants.treeExpandAll ( ) ) ; collapseAllButton.setText ( constants.treeCollapseAll ( ) ) ; infoLabel.setText ( constants.manageEventsPopupInfoLabel ( ) ) ; }
Source:
public static void getMaxVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean is64 ) { 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 262144 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( ( is64 ? org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB : org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB ) , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getAAANamespaces ( 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.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected java.lang.Long getRawValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return diskImage.getActualSizeInBytes ( ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return diskImage.getStoragesNames ( ) . get ( 0 ) ; }
Source:
protected java.sql.Array createArrayOf ( java.lang.String typeName , java.lang.Object [ ] array ) { try { return getJdbcTemplate ( ) . getDataSource ( ) . getConnection ( ) . createArrayOf ( typeName , array ) ; } catch ( java.sql.SQLException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
protected java.sql.Array createArrayOf ( java.lang.String typeName , java.lang.Object [ ] array ) { try ( java.sql.Connection connection = getJdbcTemplate ( ) . getDataSource ( ) . getConnection ( ) ) { return connection.createArrayOf ( typeName , array ) ; } catch ( java.sql.SQLException ex ) { throw new java.lang.RuntimeException ( ex ) ; } }
Source:
private void verifyDataCenterNetworks ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : result ) { org.junit.Assert.assertEquals ( FixturesTool.DATA_CENTER , net.getDataCenterId ( ) ) ; } }

Target:
private void verifyDataCenterNetworks ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > result ) { org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : result ) { org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.DATA_CENTER , net.getDataCenterId ( ) ) ; } }
Source:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; iface.setName ( getVm ( ) . getName ( ) ) ; }

Target:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; iface.setVmName ( getVm ( ) . getName ( ) ) ; }
Source:
public void validateSpaceNotWithinThreshold ( ) throws java.lang.Exception { initCommand ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( command ) . createStorageDomainValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; junit.framework.Assert.assertFalse ( command.validateSpaceRequirements ( ) ) ; }

Target:
public void validateSpaceNotWithinThreshold ( ) throws java.lang.Exception { initCommand ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( command ) . createStorageDomainValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.junit.Assert.assertFalse ( command.validateSpaceRequirements ( ) ) ; }
Source:
public void refreshHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { org.ovirt.engine.core.common.businessentities.VDSStatus newStatus = refreshCapabilities ( new java.util.concurrent.atomic.AtomicBoolean ( ) , vds ) ; if ( org.ovirt.engine.core.vdsbroker.VdsManager.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "Succeeded to refreshCapabilities for host {0} , new status will be {1} " , getVdsId ( ) , newStatus ) ; } } finally { if ( vds != null ) { UpdateDynamicData ( vds.getDynamicData ( ) ) ; monitoringStrategy.processHardwareCapabilities ( vds ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . handleVdsVersion ( vds.getId ( ) ) ; } } }

Target:
public void refreshHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { org.ovirt.engine.core.common.businessentities.VDSStatus newStatus = refreshCapabilities ( new java.util.concurrent.atomic.AtomicBoolean ( ) , vds ) ; if ( org.ovirt.engine.core.vdsbroker.VdsManager.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "Succeeded to refreshCapabilities for host {0} , new status will be {1} " , getVdsId ( ) , newStatus ) ; } } finally { if ( vds != null ) { updateDynamicData ( vds.getDynamicData ( ) ) ; monitoringStrategy.processHardwareCapabilities ( vds ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . handleVdsVersion ( vds.getId ( ) ) ; } } }
Source:
private void endVmRelatedOps ( ) { setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } }

Target:
private void endVmRelatedOps ( ) { org.ovirt.engine.core.bll.ImportVmCommand.setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( getVm ( ) ) ; } else { org.ovirt.engine.core.bll.ImportVmCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } }
Source:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( QueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.VM_ID } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( QueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.VM_ID } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VdsmVm createVmInternalData ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setId ( id ) ; vmDynamic.setRunOnVds ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs.SRC_HOST_ID ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VdsmVm ( ( - 1.0 ) ) . setVmDynamic ( vmDynamic ) . setVmStatistics ( new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ) . setInterfaceStatistics ( new java.util.ArrayList < > ( ) ) . setLunsMap ( new java.util.HashMap < > ( ) ) ; }

Target:
org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm createVmInternalData ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setId ( id ) ; vmDynamic.setRunOnVds ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs.SRC_HOST_ID ) ; return new org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm ( ( - 1.0 ) ) . setVmDynamic ( vmDynamic ) . setVmStatistics ( new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ) . setInterfaceStatistics ( new java.util.ArrayList < > ( ) ) . setLunsMap ( new java.util.HashMap < > ( ) ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.String > [ ] buildStructFromConnectionListObject ( ) { final java.util.Map < java.lang.String , java.lang.String > [ ] result = new java.util.HashMap [ org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getConnectionList ( ) . size ( ) ] ; int i = 0 ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getConnectionList ( ) ) { result [ i ] = org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelper.getInstance ( ) . createStructFromConnection ( connection , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getVdsId ( ) ) ; i ++ ; } return result ; }

Target:
protected java.util.Map < java.lang.String , java.lang.String > [ ] buildStructFromConnectionListObject ( ) { final java.util.Map < java.lang.String , java.lang.String > [ ] result = new java.util.HashMap [ org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getConnectionList ( ) . size ( ) ] ; int i = 0 ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getConnectionList ( ) ) { result [ i ] = storageConnectionHelper.createStructFromConnection ( connection , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getVdsId ( ) ) ; i ++ ; } return result ; }
Source:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
public void onRemove ( ) { for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.Role role = ( ( org.ovirt.engine.core.common.businessentities.Role ) ( item ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveRole , new org.ovirt.engine.core.common.action.RolesParameterBase ( role.getId ( ) ) ) ; } cancel ( ) ; getSearchCommand ( ) . execute ( ) ; }

Target:
public void onRemove ( ) { for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.Role role = ( ( org.ovirt.engine.core.common.businessentities.Role ) ( item ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveRole , new org.ovirt.engine.core.common.action.RolesParameterBase ( role.getId ( ) ) ) ; } cancel ( ) ; getSearchCommand ( ) . execute ( ) ; }
Source:
public static java.lang.Integer getMaxMemorySizeInMb ( org.ovirt.engine.core.common.businessentities.VmOsType osType , java.lang.String clsuter_version ) { if ( ( ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.Other ) ) || ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux ) ) ) || ( osType.name ( ) . toLowerCase ( ) . endsWith ( org.ovirt.engine.core.common.utils.VmValidationUtils.X64BIT ) ) ) { return org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VM64BitMaxMemorySizeInMB , clsuter_version ) ; } return org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VM32BitMaxMemorySizeInMB ) ; }

Target:
public static java.lang.Integer getMaxMemorySizeInMb ( org.ovirt.engine.core.common.businessentities.VmOsType osType , java.lang.String clusterVersion ) { if ( ( ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.Other ) ) || ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux ) ) ) || ( osType.name ( ) . toLowerCase ( ) . endsWith ( org.ovirt.engine.core.common.utils.VmValidationUtils.X64BIT ) ) ) { return org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VM64BitMaxMemorySizeInMB , clusterVersion ) ; } return org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VM32BitMaxMemorySizeInMB ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.gluster.StorageDevice entity ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit , java.lang.Double > convertedSize = org.ovirt.engine.core.common.utils.SizeConverter.autoConvert ( entity.getSize ( ) , SizeUnit.MiB ) ; return org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.messages.sizeUnitString ( formatSize ( convertedSize.getSecond ( ) ) , convertedSize.getFirst ( ) ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.gluster.StorageDevice entity ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit , java.lang.Double > convertedSize = org.ovirt.engine.core.common.utils.SizeConverter.autoConvert ( entity.getSize ( ) , SizeUnit.MiB ) ; return org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.messages.sizeUnitString ( formatSize ( convertedSize.getSecond ( ) ) , org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . translate ( convertedSize.getFirst ( ) ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkAttachmentDao , networkDao , vdsDao , org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorHelper.class ) ) ; return validator.validate ( ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkAttachmentDao , networkDao , vdsDao , hostSetupNetworksValidatorHelper ) ; return validator.validate ( ) ; }
Source:
public static void GetVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void GetDiskMaxSize ( 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 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxBlockDiskSize , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . isFiltered ( ) ) ; if ( vds != null ) { vds.setCpuName ( org.ovirt.engine.core.bll.CpuFlagsManagerHandler.FindMaxServerCpuByFlags ( vds.getcpu_flags ( ) , vds.getvds_group_compatibility_version ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . isFiltered ( ) ) ; if ( vds != null ) { vds.setCpuName ( org.ovirt.engine.core.bll.CpuFlagsManagerHandler.FindMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getVdsGroupCompatibilityVersion ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosValuesTest ( org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos ) { return qosValuesTest ( createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) , qos ) ; }

Target:
private void mockCalculateBaseNicWhenBaseNicIsPassed ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( org.mockito.Matchers.eq ( nic ) ) ) . thenReturn ( nic ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( org.mockito.Matchers.eq ( nic ) , org.mockito.Matchers.any ( java.util.Map.class ) ) ) . thenReturn ( nic ) ; }
Source:
public static void GetDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static boolean Is64bitOsType ( org.ovirt.engine.core.common.businessentities.VmOsType osType ) { if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.Get64bitOsTypes ( ) . contains ( osType ) ) { return true ; } return false ; }
Source:
protected void enableDisableByBootProtocol ( org.ovirt.engine.ui.uicommonweb.models.hosts.NetworkAttachmentModel model ) { boolean bootProtocolsAvailable = model.getBootProtocolsAvailable ( ) ; ipv4BootProtocolLabel.setEnabled ( bootProtocolsAvailable ) ; ipv4BootProtocol.setEnabled ( bootProtocolsAvailable ) ; ipv4BootProtocol.setEnabled ( Ipv4BootProtocol.NONE , model.getNoneBootProtocolAvailable ( ) ) ; }

Target:
protected void populateTabMap ( ) { getTabNameMapping ( ) . put ( TabName.IPV4_TAB , this . ipv4Tab ) ; getTabNameMapping ( ) . put ( TabName.IPV6_TAB , this . ipv6Tab ) ; getTabNameMapping ( ) . put ( TabName.QOS_TAB , this . qosTab ) ; getTabNameMapping ( ) . put ( TabName.CUSTOM_PROPERTIES_TAB , this . customPropertiesTab ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.VmInit > getVmInitByIds ( java.util.List < org.ovirt.engine.core.compat.Guid > ids , boolean secure ) { org.ovirt.engine.core.dao.VmInitDAO db = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmInitDao ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmInit > all = db.getVmInitByIds ( ids ) ; for ( org.ovirt.engine.core.common.businessentities.VmInit vmInit : all ) { if ( secure ) { vmInit.setPasswordAlreadyStored ( ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vmInit.getRootPassword ( ) ) ) ) ) ; vmInit.setRootPassword ( null ) ; } else { vmInit.setPasswordAlreadyStored ( false ) ; } } return all ; }

Target:
public static void removeVmInitFromDB ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { org.ovirt.engine.core.dao.VmInitDao db = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmInitDao ( ) ; db.remove ( vm.getId ( ) ) ; }
Source:
protected void ItemsChanged ( ) { super . ItemsChanged ( ) ; if ( ( ( ( getSelectionNodeList ( ) ) != null ) && ( getSelectionNodeList ( ) . isEmpty ( ) ) ) && ( ( getAttachedTagsToEntities ( ) ) != null ) ) { AttachedTagsToEntitiesChanged ( ) ; } }

Target:
protected void itemsChanged ( ) { super . itemsChanged ( ) ; if ( ( ( ( getSelectionNodeList ( ) ) != null ) && ( getSelectionNodeList ( ) . isEmpty ( ) ) ) && ( ( getAttachedTagsToEntities ( ) ) != null ) ) { AttachedTagsToEntitiesChanged ( ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { setEnumTitle ( diskImage.getImageStatus ( ) ) ; switch ( diskImage.getImageStatus ( ) ) { case OK : return getCommonResources ( ) . upImage ( ) ; case LOCKED : return getCommonResources ( ) . waitImage ( ) ; case ILLEGAL : return getCommonResources ( ) . logErrorImage ( ) ; default : return null ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { setEnumTitle ( diskImage.getImageStatus ( ) ) ; switch ( diskImage.getImageStatus ( ) ) { case OK : return getCommonResources ( ) . upImage ( ) ; case LOCKED : return getCommonResources ( ) . waitImage ( ) ; case ILLEGAL : return getCommonResources ( ) . logErrorImage ( ) ; default : return null ; } }
Source:
java.lang.String getFormattedNote ( ) { java.lang.StringBuilder formattedNote = new java.lang.StringBuilder ( constants.empty ( ) ) ; for ( int i = 0 ; i < ( notes.size ( ) ) ; i ++ ) { java.lang.String note = notes.get ( i ) ; formattedNote.append ( constants.lineBreak ( ) ) . append ( constants.htmlTab ( ) ) . append ( note ) ; } return formattedNote.toString ( ) ; }

Target:
java.lang.String getFormattedNote ( ) { java.lang.StringBuilder formattedNote = new java.lang.StringBuilder ( org.ovirt.engine.ui.common.view.popup.AbstractDiskRemoveConfirmationPopupView.constants.empty ( ) ) ; for ( int i = 0 ; i < ( notes.size ( ) ) ; i ++ ) { java.lang.String note = notes.get ( i ) ; formattedNote.append ( org.ovirt.engine.ui.common.view.popup.AbstractDiskRemoveConfirmationPopupView.constants.lineBreak ( ) ) . append ( org.ovirt.engine.ui.common.view.popup.AbstractDiskRemoveConfirmationPopupView.constants.htmlTab ( ) ) . append ( note ) ; } return formattedNote.toString ( ) ; }
Source:
public void setUp ( ) { org.mockito.Mockito.doNothing ( ) . when ( command ) . addStorageDomainInDb ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateStorageDomainDynamicFromIrs ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . saveLUNsInDB ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.LUNs.class ) ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateMetadataDevices ( ) ; }

Target:
public void setUp ( ) { org.mockito.Mockito.doNothing ( ) . when ( command ) . addStorageDomainInDb ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateStorageDomainDynamicFromIrs ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . saveLUNsInDB ( org.mockito.ArgumentMatchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.LUNs.class ) ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateMetadataDevices ( ) ; }
Source:
private static void updateOption ( org.ovirt.engine.core.common.businessentities.VdcOption option ) { java.util.Map < java.lang.String , java.lang.Object > values = org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils._vdcOptionCache.get ( option.getoption_name ( ) ) ; if ( values == null ) { values = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils._vdcOptionCache.put ( option.getoption_name ( ) , values ) ; } values.put ( option.getversion ( ) , org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.getValue ( option ) ) ; }

Target:
private static void updateOption ( org.ovirt.engine.core.common.businessentities.VdcOption option ) { java.util.Map < java.lang.String , java.lang.Object > values = org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils._vdcOptionCache.get ( option.getOptionName ( ) ) ; if ( values == null ) { values = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils._vdcOptionCache.put ( option.getOptionName ( ) , values ) ; } values.put ( option.getVersion ( ) , org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.getValue ( option ) ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { returnValue = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getBroker ( ) . glusterHookRead ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getParameters ( ) . getGlusterCommand ( ) , org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getParameters ( ) . getHookStage ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getParameters ( ) . getHookName ( ) ) ; setReturnValue ( returnValue.getHookcontent ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { returnValue = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getBroker ( ) . glusterHookRead ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getParameters ( ) . getGlusterCommand ( ) , org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getParameters ( ) . getHookStage ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getParameters ( ) . getHookName ( ) ) ; setReturnValue ( returnValue.getHookcontent ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
protected static org.ovirt.engine.core.compat.Guid getNonPrestartedVmToAttach ( org.ovirt.engine.core.compat.NGuid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.vm_pool_map > vmPoolMaps = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDAO ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Down ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.vm_pool_map map : vmPoolMaps ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.CanAttachNonPrestartedVmToUser ( map.getvm_guid ( ) ) ) { return map.getvm_guid ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
protected static org.ovirt.engine.core.compat.Guid getNonPrestartedVmToAttach ( org.ovirt.engine.core.compat.NGuid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.vm_pool_map > vmPoolMaps = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Down ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.vm_pool_map map : vmPoolMaps ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachNonPrestartedVmToUser ( map.getvm_guid ( ) ) ) { return map.getvm_guid ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }