auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.bll.ValidationResult hasSpaceForSnapshots ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > sdIds = org.ovirt.engine.core.bll.ImagesHandler.getAllStorageIdsForImageIds ( getVmImageDisks ( ) ) ; org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidator msdValidator = getStorageDomainsValidator ( sdIds ) ; org.ovirt.engine.core.bll.ValidationResult retVal = msdValidator.allDomainsWithinThresholds ( ) ; if ( retVal == ( org.ovirt.engine.core.bll.ValidationResult.VALID ) ) { return msdValidator.allDomainsHaveSpaceForNewDisks ( getVmImageDisks ( ) ) ; } return retVal ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmImageDisks ( ) { if ( ( cachedVmImageDisks ) == null ) { cachedVmImageDisks = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getVmDisks ( ) , true , false , false ) ; cachedVmImageDisks.addAll ( org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( getVmDisks ( ) , true ) ) ; } return cachedVmImageDisks ; }
Source:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > getMissingStorages ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains , org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel vmdisk ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > missingStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel templateDisk = getTemplateDiskByVmDisk ( vmdisk ) ; if ( templateDisk != null ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { if ( ! ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( templateDisk.getDisk ( ) ) ) . getStorageIds ( ) . contains ( storageDomain.getId ( ) ) ) ) { missingStorageDomains.add ( storageDomain ) ; } } } return missingStorageDomains ; }

Target:
private boolean isDomainValidForDiskTemplate ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel templateDisk , org.ovirt.engine.core.common.businessentities.StorageDomain sd ) { if ( templateDisk != null ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( templateDisk.getDisk ( ) ) ) . getStorageIds ( ) . contains ( sd.getId ( ) ) ; } return true ; }
Source:
private void insertVolumeBricks ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = volume.getBricks ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick : bricks ) { if ( ( brick.getVolumeId ( ) ) == null ) { brick.setVolumeId ( volume.getId ( ) ) ; } dbFacade.getGlusterBrickDao ( ) . save ( brick ) ; } }

Target:
private void insertVolumeBricks ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = volume.getBricks ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick : bricks ) { if ( ( brick.getVolumeId ( ) ) == null ) { brick.setVolumeId ( volume.getId ( ) ) ; } glusterBrickDao.save ( brick ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepConfigListXmlRpc glusterVolumeGeoRepConfigList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepConfigListXmlRpc ( vdsServer.glusterVolumeGeoRepConfigList ( volumeName , slaveHost , slaveVolumeName ) ) ; } 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 glusterVolumeGeoRepConfigSet ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey , java.lang.String configValue , java.lang.String userName ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepConfigSet ( volumeName , slaveHost , slaveVolumeName , configKey , configValue , userName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void getUsbPolicyUsbTypeNull30 ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setcompatibility_version ( Version.v3_0 ) ; assert org.ovirt.engine.api.restapi.resource.utils.UsbResourceUtils.getUsbPolicy ( usb , vdsGroup ) . equals ( UsbPolicy.ENABLED_LEGACY ) ; }

Target:
public void getUsbPolicyUsbTypeNull30 ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setcompatibility_version ( Version.v3_0 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.utils.UsbResourceUtils.getUsbPolicy ( usb , vdsGroup ) , UsbPolicy.ENABLED_LEGACY ) ; }
Source:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getInterfaceColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn < org.ovirt.engine.core.common.businessentities.Disk , org.ovirt.engine.core.common.businessentities.DiskInterface > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.DiskInterface getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return object.getDiskInterface ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > getInterfaceColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn < org.ovirt.engine.core.common.businessentities.storage.Disk , org.ovirt.engine.core.common.businessentities.storage.DiskInterface > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.storage.DiskInterface getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return object.getDiskInterface ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
public void testLiveSnapshotWhenNoPluggedDiskSnapshot ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . isLiveSnapshotApplicable ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }

Target:
public void testLiveSnapshotWhenNoPluggedDiskSnapshot ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . isLiveSnapshotApplicable ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . isEmpty ( ) ) ; }
Source:
public void testDetachDisk ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachDiskFromVm , org.ovirt.engine.core.common.action.AttachDettachVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "EntityId" } , new java.lang.Object [ ] { PARENT_ID , org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setDetach ( true ) ; verifyRemove ( collection.remove ( org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID.toString ( ) , action ) ) ; }

Target:
public void testDetachDisk ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachDiskFromVm , org.ovirt.engine.core.common.action.AttachDettachVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "EntityInfo" } , new java.lang.Object [ ] { PARENT_ID , new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID ) } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setDetach ( true ) ; verifyRemove ( collection.remove ( org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID.toString ( ) , action ) ) ; }
Source:
protected static org.ovirt.engine.core.common.businessentities.VM buildVmOnNewTemplate ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VM tempVar = new org.ovirt.engine.core.common.businessentities.VM ( ) ; tempVar.setId ( vm.getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonUnitToVmBaseBuilder ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( vm.getStaticData ( ) , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.DedicatedVmForVdsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.MigrationOptionsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.UsbPolicyVmBaseToVmBaseBuilder ( ) ) ; return tempVar ; }

Target:
protected static org.ovirt.engine.core.common.businessentities.VM buildVmOnNewTemplate ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VM resultVm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; resultVm.setId ( vm.getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , resultVm.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonUnitToVmBaseBuilder ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( vm.getStaticData ( ) , resultVm.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.template.VmBaseToVmBaseForTemplateCompositeBaseBuilder ( ) ) ; return resultVm ; }
Source:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { if ( ( listPermissionSubjects ) == null ) { listPermissionSubjects = new java.util.ArrayList < org.ovirt.engine.core.common.PermissionSubject > ( ) ; org.ovirt.engine.core.compat.Guid diskId = ( ( _oldDisk ) == null ) ? null : _oldDisk.getId ( ) ; listPermissionSubjects.add ( new org.ovirt.engine.core.common.PermissionSubject ( diskId , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.EDIT_DISK_PROPERTIES ) ) ; } return listPermissionSubjects ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { if ( ( listPermissionSubjects ) == null ) { listPermissionSubjects = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; org.ovirt.engine.core.compat.Guid diskId = ( ( _oldDisk ) == null ) ? null : _oldDisk.getId ( ) ; listPermissionSubjects.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( diskId , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.EDIT_DISK_PROPERTIES ) ) ; } return listPermissionSubjects ; }
Source:
public void setUp ( ) { clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( clusterUtils ) . when ( command ) . getClusterUtils ( ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( command ) . getGlusterUtils ( ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( clusterId ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }

Target:
public void setUp ( ) { clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( clusterDao ) . get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( clusterUtils ) . when ( command ) . getClusterUtils ( ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( command ) . getGlusterUtils ( ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( clusterId ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > getAllWithQuery ( java.lang.String query ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > groups = getJdbcTemplate ( ) . query ( query , org.ovirt.engine.core.dao.ClusterDaoImpl.ClusterRowMapper.instance ) ; try { return getHostsAndVmsForClusters ( groups ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dao.ClusterDaoImpl.log.error ( "Can't load host and vm count for cluster. Query is '{}'. Error: {}" , query , e.getMessage ( ) ) ; org.ovirt.engine.core.dao.ClusterDaoImpl.log.debug ( "Excpetion" , e ) ; } return groups ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > getAllWithQuery ( java.lang.String query ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = getJdbcTemplate ( ) . query ( query , org.ovirt.engine.core.dao.ClusterDaoImpl.ClusterRowMapper.instance ) ; return getHostsAndVmsForClusters ( clusters ) ; }
Source:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { 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.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public void postOnSave ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { getWindow ( ) . stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; } privateItemSavedEvent.raise ( this , EventArgs.Empty ) ; }

Target:
public void postOnSave ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { getWindow ( ) . stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; getSearchCommand ( ) . execute ( ) ; } privateItemSavedEvent.raise ( this , EventArgs.EMPTY ) ; }
Source:
public void testVmRunningStateless ( ) { setUpGeneralValidations ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS ) ) . when ( vmValidator ) . vmNotRunningStateless ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS.name ( ) ) ) ; }

Target:
public void testVmRunningStateless ( ) { setUpGeneralValidations ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS ) ) . when ( vmValidator ) . vmNotRunningStateless ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS.name ( ) ) ) ; }
Source:
public org.ovirt.api.metamodel.concepts.Method getMethod ( org.ovirt.api.metamodel.concepts.Name name ) { for ( org.ovirt.api.metamodel.concepts.Method method : methods ) { if ( java.util.Objects.equals ( method.getName ( ) , name ) ) { return method ; } } if ( ( base ) != null ) { return base.getMethod ( name ) ; } return null ; }

Target:
public org.ovirt.api.metamodel.concepts.Method getMethod ( org.ovirt.api.metamodel.concepts.Name name ) { java.util.Optional < org.ovirt.api.metamodel.concepts.Method > method = methods.stream ( ) . filter ( named ( name ) ) . findFirst ( ) ; if ( method.isPresent ( ) ) { return method.get ( ) ; } if ( ( base ) != null ) { return base.getMethod ( name ) ; } return null ; }
Source:
private void updateShareable ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( ( storageType.isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupportedByConfiguration ( ) ) ; getIsShareable ( ) . setIsChangable ( false ) ; getIsShareable ( ) . setEntity ( false ) ; } else { getIsShareable ( ) . setIsChangable ( true ) ; } }

Target:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( ( isShareableDiskEnabled && ( ( getVm ( ) ) != null ) ) && ( getVm ( ) . isDown ( ) ) ) ) ; }
Source:
public org.ovirt.optimizer.service.ClusterOptimizer optimizeVmStart ( java.lang.String vmUuid , org.ovirt.optimizer.service.ClusterOptimizer.Finished finishedCallback ) { org.ovirt.optimizer.service.ClusterOptimizer optimizer = new org.ovirt.optimizer.service.ClusterOptimizer ( clusterId , bestSolution.getSteps ( ) . size ( ) , finishedCallback ) ; optimizer.getBestSolution ( ) . getFixedFacts ( ) . add ( new org.ovirt.optimizer.service.facts.VmToStart ( vmUuid ) ) ; optimizer.registerUpdater ( updater , new org.ovirt.optimizer.service.ClusterUpdateAvailableForOptimizer ( clusterId , optimizer.getSolver ( ) ) ) ; return optimizer ; }

Target:
public org.ovirt.optimizer.service.ClusterOptimizer optimizeVmStart ( java.lang.String vmUuid , org.ovirt.optimizer.service.ClusterOptimizer.Finished finishedCallback ) { org.ovirt.optimizer.service.ClusterOptimizer optimizer = new org.ovirt.optimizer.service.ClusterOptimizer ( clusterId , bestSolution.getSteps ( ) . size ( ) , finishedCallback ) ; optimizer.getBestSolution ( ) . getFixedFacts ( ) . add ( new org.ovirt.optimizer.service.facts.RunningVm ( vmUuid ) ) ; optimizer.registerUpdater ( updater , new org.ovirt.optimizer.service.ClusterUpdateAvailableForOptimizer ( clusterId , optimizer.getSolver ( ) ) ) ; return optimizer ; }
Source:
private void saveVmNumaNodeRuntimeData ( ) { if ( ! ( _vmStatisticsToSave.isEmpty ( ) ) ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > vmNumaNodesToUpdate = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmStatistics vmStats : _vmStatisticsToSave.values ( ) ) { vmNumaNodesToUpdate.addAll ( vmStats.getvNumaNodeStatisticsList ( ) ) ; } if ( ! ( vmNumaNodesToUpdate.isEmpty ( ) ) ) { getDbFacade ( ) . getVmNumaNodeDAO ( ) . massUpdateVmNumaNodeRuntimePinning ( vmNumaNodesToUpdate ) ; } } }

Target:
protected boolean isBalloonWorking ( org.ovirt.engine.core.common.businessentities.VmBalloonInfo balloonInfo ) { return ( java.lang.Math.abs ( ( ( balloonInfo.getBalloonLastMemory ( ) ) - ( balloonInfo.getBalloonTargetMemory ( ) ) ) ) ) > ( java.lang.Math.abs ( ( ( balloonInfo.getCurrentMemory ( ) ) - ( balloonInfo.getBalloonTargetMemory ( ) ) ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase runAction ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase taskParams ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { org.ovirt.engine.core.common.action.VdcReturnValueBase createResult = backend.RunAction ( task , sessionize ( taskParams ) ) ; if ( ! ( createResult.getCanDoAction ( ) ) ) { throw new org.ovirt.engine.api.restapi.resource.BackendFailureException ( localize ( createResult.getCanDoActionMessages ( ) ) ) ; } else if ( ! ( createResult.getSucceeded ( ) ) ) { throw new org.ovirt.engine.api.restapi.resource.BackendFailureException ( localize ( createResult.getExecuteFailedMessages ( ) ) ) ; } return createResult ; }

Target:
protected javax.ws.rs.core.Response performCreation ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase taskParams , org.ovirt.engine.api.restapi.resource.EntityIdResolver entityResolver , boolean block ) { return performCreation ( task , taskParams , entityResolver , block , null ) ; }
Source:
protected < T extends org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionWeightPolicyUnit > T mockPolicyUnit ( java.lang.Class < T > unitType ) throws java.lang.Exception { final T policyUnit = unitType.getConstructor ( org.ovirt.engine.core.common.scheduling.PolicyUnit.class , org.ovirt.engine.core.bll.scheduling.pending.PendingResourceManager.class ) . newInstance ( null , new org.ovirt.engine.core.bll.scheduling.pending.PendingResourceManager ( ) ) ; return org.mockito.Mockito.spy ( policyUnit ) ; }

Target:
public void setUp ( ) { org.ovirt.engine.core.bll.scheduling.pending.PendingResourceManager pendingResourceManager = new org.ovirt.engine.core.bll.scheduling.pending.PendingResourceManager ( ) ; evenDistributionCPUWeightPolicyUnit = new org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionCPUWeightPolicyUnit ( null , pendingResourceManager ) ; evenDistributionMemoryWeightPolicyUnit = new org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionMemoryWeightPolicyUnit ( null , pendingResourceManager ) ; }
Source:
private boolean isConsoleCommandsExecutionAllowed ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VM > list = getSelectedItems ( ) ; if ( list == null ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.VM vm : list ) { if ( consoleModelsCache.getVmConsolesForVm ( vm ) . canConnectToConsole ( ) ) { return true ; } } return false ; }

Target:
private boolean isConsoleCommandsExecutionAllowed ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VM > list = getSelectedItems ( ) ; if ( list == null ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.VM vm : list ) { if ( consoleModelsCache.getVmConsolesForEntity ( vm ) . canConnectToConsole ( ) ) { return true ; } } return false ; }
Source:
public static void IsLiveStorageMigrationEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters params = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.LiveStorageMigrationEnabled ) ; params.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( params , aQuery ) ; }

Target:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void testRefreshStatus ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( true ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionStatus ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.ArgumentMatchers.any ( java.util.List.class ) ) ; }

Target:
public void testRefreshStatus ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( true ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionStatus ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }
Source:
public void testChangeCaseDisplay ( ) { org.ovirt.engine.core.searchbackend.SearchObjectsBaseAutoCompleter comp = new org.ovirt.engine.core.searchbackend.SearchObjectsBaseAutoCompleter ( ) ; assertEquals ( "hello" , "Hello" , comp.changeCaseDisplay ( "hello" ) ) ; assertEquals ( "Hello" , "Hello" , comp.changeCaseDisplay ( "Hello" ) ) ; assertEquals ( "HELLO" , "Hello" , comp.changeCaseDisplay ( "HELLO" ) ) ; }

Target:
public void testChangeCaseDisplay ( ) { org.ovirt.engine.core.searchbackend.SearchObjectsBaseAutoCompleter comp = new org.ovirt.engine.core.searchbackend.SearchObjectsBaseAutoCompleter ( ) ; org.junit.Assert.assertEquals ( "hello" , "Hello" , comp.changeCaseDisplay ( "hello" ) ) ; org.junit.Assert.assertEquals ( "Hello" , "Hello" , comp.changeCaseDisplay ( "Hello" ) ) ; org.junit.Assert.assertEquals ( "HELLO" , "Hello" , comp.changeCaseDisplay ( "HELLO" ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepStatus ( volumeName , slaveHost , slaveVolumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( ) { try { java.util.Map < java.lang.String , java.lang.Object > response = vdsServer.glusterVolumeGeoRepSessionList ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testEnd ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.EndExternalJob , org.ovirt.engine.core.common.action.EndExternalJobParameters.class , new java.lang.String [ ] { "JobId" , "Status" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , true , false } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setSucceeded ( true ) ; verifyActionResponse ( resource.end ( action ) ) ; }

Target:
public void testEnd ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.EndExternalJob , org.ovirt.engine.core.common.action.EndExternalJobParameters.class , new java.lang.String [ ] { "JobId" , "Status" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , true , false } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setSucceeded ( true ) ; verifyActionResponse ( resource.end ( action ) ) ; }
Source:
public void setCommandExecuted ( ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandEntity ( getCommandId ( ) ) ; if ( cmdEntity != null ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.persistCommand ( buildCommandEntity ( cmdEntity.getRootCommandId ( ) , cmdEntity.isCallBackEnabled ( ) ) , getContext ( ) ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.updateCommandExecuted ( getCommandId ( ) ) ; } } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }

Target:
public void setCommandExecuted ( ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandEntity ( getCommandId ( ) ) ; if ( cmdEntity != null ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.persistCommand ( buildCommandEntity ( cmdEntity.getRootCommandId ( ) , cmdEntity.isCallbackEnabled ( ) ) , getContext ( ) ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.updateCommandExecuted ( getCommandId ( ) ) ; } } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }
Source:
public static void addLink ( java.lang.String url , org.ovirt.engine.api.model.BaseResource resource , java.lang.String rel , org.ovirt.engine.api.model.ParametersSet params ) { org.ovirt.engine.api.model.Link link = new org.ovirt.engine.api.model.Link ( ) ; link.setRel ( ( rel + ( org.ovirt.engine.api.utils.LinkHelper.SEARCH_RELATION ) ) ) ; link.setHref ( ( ( org.ovirt.engine.api.utils.LinkHelper.combine ( org.ovirt.engine.api.utils.LinkHelper.combine ( url , rel ) , params ) ) + ( org.ovirt.engine.api.utils.LinkHelper.SEARCH_TEMPLATE ) ) ) ; resource.getLinks ( ) . add ( link ) ; }

Target:
public static org.ovirt.engine.api.model.Link createLink ( java.lang.String url , java.lang.String rel , java.util.List < org.ovirt.engine.api.model.ParametersSet > params ) { org.ovirt.engine.api.model.Link link = new org.ovirt.engine.api.model.Link ( ) ; link.setRel ( ( rel + ( org.ovirt.engine.api.utils.LinkHelper.SEARCH_RELATION ) ) ) ; link.setHref ( ( ( org.ovirt.engine.api.utils.LinkHelper.combine ( url , params ) ) + ( org.ovirt.engine.api.utils.LinkHelper.SEARCH_TEMPLATE ) ) ) ; return link ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetTemplateInterfacesByTemplateId , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetTemplateInterfacesByTemplateId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testValidateClusterSupportForVirtioScsi ( ) { org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > cmd = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.Matchers.any ( java.util.Map.class ) ) ; cmd.getParameters ( ) . getVm ( ) . getDiskMap ( ) . values ( ) . iterator ( ) . next ( ) . setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; cmd.getVdsGroup ( ) . setCompatibilityVersion ( Version.v3_2 ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; }

Target:
public void testValidateClusterSupportForVirtioScsi ( ) { org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > cmd = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.Matchers.any ( java.util.Map.class ) ) ; cmd.getParameters ( ) . getVm ( ) . getDiskMap ( ) . values ( ) . iterator ( ) . next ( ) . setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; cmd.getVdsGroup ( ) . setCompatibilityVersion ( Version.v3_2 ) ; cmd.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getBroker ( ) . glusterVolumeReset ( org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . getVolumeName ( ) , ( ( org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . getVolumeOption ( ) ) == null ? "" : org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . getVolumeOption ( ) . getKey ( ) ) , org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . isforceAction ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getBroker ( ) . glusterVolumeReset ( org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . getVolumeName ( ) , ( ( org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . getVolumeOption ( ) ) == null ? "" : org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . getVolumeOption ( ) . getKey ( ) ) , org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . isforceAction ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public void setModel ( java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > numaNodes , java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel > vNodeModels ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel vNodeModel : vNodeModels ) { org.ovirt.engine.ui.common.view.popup.numa.VirtualNumaPanel panel = virtualNumaPanelProvider.get ( ) ; panel.setModel ( vNodeModel ) ; vNumaPanel.add ( panel ) ; } for ( org.ovirt.engine.core.common.businessentities.VdsNumaNode numaNode : numaNodes ) { numaPanel.add ( new com.google.gwt.user.client.ui.HTML ( messages.numaNode ( numaNode.getIndex ( ) ) ) ) ; } }

Target:
public void setModel ( java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > numaNodes , java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel > vNodeModels ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel vNodeModel : vNodeModels ) { org.ovirt.engine.ui.common.view.popup.numa.VirtualNumaPanel panel = virtualNumaPanelProvider.get ( ) ; panel.setModel ( vNodeModel ) ; vNumaPanel.add ( panel ) ; } for ( org.ovirt.engine.core.common.businessentities.VdsNumaNode numaNode : numaNodes ) { numaPanel.add ( new com.google.gwt.user.client.ui.HTML ( org.ovirt.engine.ui.common.view.popup.numa.HostSummaryContentPanel.messages.numaNode ( numaNode.getIndex ( ) ) ) ) ; } }
Source:
private boolean hostEmulationModeMatchesTheConfigValues ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.String [ ] hostSupportedEmulatedMachines ) { java.lang.String matchedEmulatedMachine = org.ovirt.engine.core.common.utils.ListUtils.firstMatch ( org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > GetValue ( ConfigValues.ClusterEmulatedMachines , vds.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) , hostSupportedEmulatedMachines ) ; if ( ( matchedEmulatedMachine != null ) && ( ! ( matchedEmulatedMachine.isEmpty ( ) ) ) ) { setClusterEmulatedMachine ( vds , matchedEmulatedMachine ) ; return true ; } return false ; }

Target:
private boolean hostEmulationModeMatchesTheConfigValues ( org.ovirt.engine.core.common.businessentities.VDS vds ) { java.lang.String matchedEmulatedMachine = org.ovirt.engine.core.common.utils.ListUtils.firstMatch ( org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > GetValue ( ConfigValues.ClusterEmulatedMachines , vds.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) , vds.getSupportedEmulatedMachines ( ) . split ( "," ) ) ; if ( ( matchedEmulatedMachine != null ) && ( ! ( matchedEmulatedMachine.isEmpty ( ) ) ) ) { setClusterEmulatedMachine ( vds , matchedEmulatedMachine ) ; return true ; } return false ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > createInterfacesToBond ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > existingIfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ; existingIfaces.add ( createVdsInterface ( "eth0" , false , null , null , null ) ) ; existingIfaces.add ( createVdsInterface ( "eth1" , false , null , null , null ) ) ; return existingIfaces ; }

Target:
private org.ovirt.engine.core.common.businessentities.VdsNetworkInterface createVlan ( java.lang.String baseIfaceName , int vlanId , java.lang.String networkName ) { return createVdsInterface ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , ( ( baseIfaceName + "." ) + vlanId ) , false , null , vlanId , networkName ) ; }
Source:
public boolean Validate ( ) { org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation valueValidation = new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) ; getValue ( ) . ValidateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { valueValidation } ) ; return ( getKeyList ( ) . getIsValid ( ) ) && ( getValue ( ) . getIsValid ( ) ) ; }

Target:
public boolean Validate ( ) { org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation valueValidation = new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) ; getSelectedKey ( ) . ValidateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { valueValidation } ) ; getValue ( ) . ValidateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { valueValidation } ) ; return ( getSelectedKey ( ) . getIsValid ( ) ) && ( getValue ( ) . getIsValid ( ) ) ; }
Source:
public static void IsCustomPropertiesAvailable ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportCustomProperties ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void GetClusterById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters ( id ) , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { boolean returnValue = ( ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkStoragePool ( ) ) && ( CheckStoragePoolStatusNotEqual ( StoragePoolStatus.Uninitialized , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ) ) && ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkStorageDomain ( ) ) ) && ( storageDomainStatusIsValid ( ) ) ) && ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.getStorageDomain ( ) . getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) || ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkMasterDomainIsUp ( ) ) ) ; return returnValue ; }

Target:
protected boolean canDoAction ( ) { boolean returnValue = ( ( ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkStoragePool ( ) ) && ( CheckStoragePoolStatusNotEqual ( StoragePoolStatus.Uninitialized , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ) ) && ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkStorageDomain ( ) ) ) && ( storageDomainStatusIsValid ( ) ) ) && ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.getStorageDomain ( ) . getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) || ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkMasterDomainIsUp ( ) ) ) ) && ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkForActiveVds ( ) ) != null ) ; return returnValue ; }
Source:
public void calculateFreeVirtualMemory ( ) { if ( ( ( ( getmem_commited ( ) ) != null ) && ( ( getphysical_mem_mb ( ) ) != null ) ) && ( ( getreserved_mem ( ) ) != null ) ) { maxSchedulingMemory = ( ( ( getmax_vds_memory_over_commit ( ) ) * ( getphysical_mem_mb ( ) ) ) / 100.0F ) - ( ( getmem_commited ( ) ) + ( getreserved_mem ( ) ) ) ; maxSchedulingMemory = ( ( maxSchedulingMemory ) > 0 ) ? maxSchedulingMemory : 0 ; } }

Target:
public java.lang.Integer getVdsSpmId ( ) { return vdsSpmId ; }
Source:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; } }

Target:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( QueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; } }
Source:
public org.ovirt.engine.api.model.Network get ( ) { org.ovirt.engine.api.model.Network entity = parent.lookupNetwork ( guid ) ; if ( entity == null ) { return notFound ( ) ; } org.ovirt.engine.api.model.Network network = map ( entity ) ; network.setDisplay ( null ) ; return addLinks ( network ) ; }

Target:
public org.ovirt.engine.api.model.Network get ( ) { return performGet ( VdcQueryType.GetNetworkById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) ) ; }