auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void twoArgsWithSameLongName ( ) { org.ovirt.engine.core.uutils.cli.ExtendedCliParser parser = new org.ovirt.engine.core.uutils.cli.ExtendedCliParser ( ) ; parser.addArg ( new org.ovirt.engine.core.uutils.cli.ArgumentBuilder ( ) . shortName ( "-a" ) . longName ( "--aa" ) . valueRequied ( true ) . build ( ) ) ; parser.addArg ( new org.ovirt.engine.core.uutils.cli.ArgumentBuilder ( ) . shortName ( "-b" ) . longName ( "--aa" ) . valueRequied ( true ) . build ( ) ) ; }

Target:
public void twoArgsWithSameLongName ( ) { org.ovirt.engine.core.uutils.cli.ExtendedCliParser parser = new org.ovirt.engine.core.uutils.cli.ExtendedCliParser ( ) ; parser.addArg ( new org.ovirt.engine.core.uutils.cli.ArgumentBuilder ( ) . shortName ( "-a" ) . longName ( "--aa" ) . valueRequired ( true ) . build ( ) ) ; parser.addArg ( new org.ovirt.engine.core.uutils.cli.ArgumentBuilder ( ) . shortName ( "-b" ) . longName ( "--aa" ) . valueRequired ( true ) . build ( ) ) ; }
Source:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void canDoActionSuccess ( ) { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeVirtIODisk ( ) ; initStorageDomain ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }

Target:
public void validateSuccess ( ) { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeVirtIODisk ( ) ; initStorageDomain ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . isEmpty ( ) ) ; }
Source:
public java.net.Socket createSocket ( java.lang.String host , int port , java.net.InetAddress clientHost , int clientPort ) throws java.io.IOException , java.net.UnknownHostException { javax.net.ssl.SSLSocket socket = ( ( javax.net.ssl.SSLSocket ) ( sslcontext.getSocketFactory ( ) . createSocket ( host , port , clientHost , clientPort ) ) ) ; socket.setEnabledProtocols ( new java.lang.String [ ] { "SSLv3" } ) ; return socket ; }

Target:
public java.net.Socket createSocket ( java.lang.String host , int port , java.net.InetAddress clientHost , int clientPort ) throws java.io.IOException , java.net.UnknownHostException { javax.net.ssl.SSLSocket socket = ( ( javax.net.ssl.SSLSocket ) ( sslcontext.getSocketFactory ( ) . createSocket ( host , port , clientHost , clientPort ) ) ) ; socket.setEnabledProtocols ( new java.lang.String [ ] { this . protocol } ) ; return socket ; }
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.VDSGroup > list = getClusterByServiceList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) , supportsVirtService , supportsGlusterService ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

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.VDSGroup > list = getClusterByServiceList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) , supportsVirtService , supportsGlusterService ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
public static void addBondToParams ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel , org.ovirt.engine.core.common.businessentities.network.Bond bond ) { for ( java.util.Iterator < org.ovirt.engine.core.common.businessentities.network.Bond > iterator = dataFromHostSetupNetworksModel.removedBonds.iterator ( ) ; iterator.hasNext ( ) ; ) { org.ovirt.engine.core.common.businessentities.network.Bond removedBond = iterator.next ( ) ; if ( removedBond.getName ( ) . equals ( bond.getName ( ) ) ) { iterator.remove ( ) ; break ; } } dataFromHostSetupNetworksModel.newOrModifiedBonds.add ( bond ) ; }

Target:
private static void removeLabel ( java.lang.String srcIfaceName , org.ovirt.engine.core.compat.Guid srcIfaceId , java.lang.String label , org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel ) { dataFromHostSetupNetworksModel.removeLabelFromParameters ( new org.ovirt.engine.core.common.businessentities.network.NicLabel ( srcIfaceId , srcIfaceName , label ) ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.compat.Guid > getRedundantVolumesToDeleteAfterCommitSnapshot ( org.ovirt.engine.core.compat.Guid diskId , org.ovirt.engine.core.compat.Guid activeVolumeId ) { java.util.List < org.ovirt.engine.core.compat.Guid > redundantSnapshotIdsToDelete = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > crucialSnapshotsChain = org.ovirt.engine.core.bll.storage.CINDERStorageHelper.getDiskImageDao ( ) . getAllSnapshotsForLeaf ( activeVolumeId ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allVolumesInCinderDisk = org.ovirt.engine.core.bll.storage.CINDERStorageHelper.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( diskId ) ; allVolumesInCinderDisk.removeAll ( crucialSnapshotsChain ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : allVolumesInCinderDisk ) { redundantSnapshotIdsToDelete.add ( diskImage.getVmSnapshotId ( ) ) ; } return redundantSnapshotIdsToDelete ; }

Target:
public static java.util.List < org.ovirt.engine.core.compat.Guid > getRedundantVolumesToDeleteAfterCommitSnapshot ( org.ovirt.engine.core.compat.Guid diskId , java.util.Set < org.ovirt.engine.core.compat.Guid > criticalSnapshotsChain ) { java.util.List < org.ovirt.engine.core.compat.Guid > redundantSnapshotIdsToDelete = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allVolumesInCinderDisk = org.ovirt.engine.core.bll.storage.CINDERStorageHelper.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( diskId ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : allVolumesInCinderDisk ) { if ( ! ( criticalSnapshotsChain.contains ( diskImage.getVmSnapshotId ( ) ) ) ) { redundantSnapshotIdsToDelete.add ( diskImage.getVmSnapshotId ( ) ) ; } } return redundantSnapshotIdsToDelete ; }
Source:
protected boolean validate ( ) { if ( ( getStoragePool ( ) ) == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST ) ; return false ; } if ( ( getQuotaId ( ) ) == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID ) ; return false ; } if ( ( quotaDao.getById ( getQuotaId ( ) ) ) == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST ) ; return false ; } return true ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.validator.storage.StoragePoolValidator spValidator = new org.ovirt.engine.core.bll.validator.storage.StoragePoolValidator ( getStoragePool ( ) ) ; if ( ! ( validate ( spValidator.exists ( ) ) ) ) { return false ; } if ( ( getQuotaId ( ) ) == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID ) ; return false ; } if ( ( quotaDao.getById ( getQuotaId ( ) ) ) == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST ) ; return false ; } return true ; }
Source:
protected boolean canDoAction ( ) { if ( org.ovirt.engine.core.bll.MoveDisksCommand.getParameters ( ) . getParametersList ( ) . isEmpty ( ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED ) ; } return true ; }

Target:
private boolean verifyNoLunDisks ( ) { for ( org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters : org.ovirt.engine.core.bll.MoveDisksCommand.getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.bll.MoveDisksCommand.getDiskDao ( ) . get ( moveDiskParameters.getImageGroupID ( ) ) ; if ( ! ( validate ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) . validateDiskIsNotLun ( ) ) ) ) { return false ; } } return true ; }
Source:
protected void EndSuccessfully ( ) { setVmTemplateId ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getImagesParameters ( ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . EndAction ( VdcActionType.CreateImageTemplate , p ) ; } if ( ( reloadVmTemplateFromDB ( ) ) != null ) { endDefaultOperations ( ) ; } org.ovirt.engine.core.bll.AddVmTemplateCommand.setSucceeded ( true ) ; }

Target:
protected void endSuccessfully ( ) { setVmTemplateId ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getImagesParameters ( ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . EndAction ( VdcActionType.CreateImageTemplate , p ) ; } if ( ( reloadVmTemplateFromDB ( ) ) != null ) { endDefaultOperations ( ) ; } org.ovirt.engine.core.bll.AddVmTemplateCommand.setSucceeded ( true ) ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM vm = resource.get ( ) ; assertTrue ( vm.isSetStatistics ( ) ) ; verifyModel ( vm , 0 ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM vm = resource.get ( ) ; assertTrue ( vm.isSetStatistics ( ) ) ; verifyModel ( vm , 0 ) ; } finally { accepts.clear ( ) ; } }
Source:
protected boolean isImageIsNotLocked ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getimageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Move ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_ARE_LOCKED ) ; } else { addCanDoActionMessage ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } return false ; } return true ; }

Target:
protected boolean isImageNotLocked ( ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ; if ( ( diskImage.getimageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Move ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; addCanDoActionMessage ( java.lang.String.format ( "$%1$s %2$s" , "diskAlias" , diskImage.getDiskAlias ( ) ) ) ; } else { addCanDoActionMessage ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } return false ; } return true ; }
Source:
protected < T extends org.ovirt.engine.core.dao.DAO > T getDAO ( java.lang.Class < T > daoType ) { T dao = org.ovirt.engine.core.dao.DaoFactory.get ( daoType ) ; if ( dao instanceof org.ovirt.engine.core.dao.BaseDAODbFacade ) { org.ovirt.engine.core.dao.BaseDAODbFacade dbFacadeDAO = ( ( org.ovirt.engine.core.dao.BaseDAODbFacade ) ( dao ) ) ; dbFacadeDAO.setTemplate ( jdbcTemplate ) ; dbFacadeDAO.setDialect ( dbEngineDialect ) ; dbFacadeDAO.setDbFacade ( this ) ; } else { } return dao ; }

Target:
protected < T extends org.ovirt.engine.core.dao.DAO > T getDao ( java.lang.Class < T > daoType ) { T dao = org.ovirt.engine.core.dao.DaoFactory.get ( daoType ) ; if ( dao instanceof org.ovirt.engine.core.dao.BaseDAODbFacade ) { org.ovirt.engine.core.dao.BaseDAODbFacade dbFacadeDAO = ( ( org.ovirt.engine.core.dao.BaseDAODbFacade ) ( dao ) ) ; dbFacadeDAO.setTemplate ( jdbcTemplate ) ; dbFacadeDAO.setDialect ( dbEngineDialect ) ; dbFacadeDAO.setDbFacade ( this ) ; } else { } return dao ; }
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 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup ) , UsbPolicy.ENABLED_LEGACY ) ; }

Target:
public void getUsbPolicyUsbTypeNull31 ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setcompatibility_version ( Version.v3_1 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getcompatibility_version ( ) ) , UsbPolicy.ENABLED_NATIVE ) ; }
Source:
public static void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public void testParameterizedConstructor ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid expectedUserID = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; param = getTypeParameterClass ( ) . getConstructor ( org.ovirt.engine.core.compat.Guid.class ) . newInstance ( expectedUserID ) ; org.junit.Assert.assertEquals ( "Wrong user ID" , expectedUserID , param.getUserId ( ) ) ; }

Target:
public void testParameterizedConstructor ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid expectedUserID = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; param = getTypeParameterClass ( ) . getConstructor ( org.ovirt.engine.core.compat.Guid.class ) . newInstance ( expectedUserID ) ; org.junit.Assert.assertEquals ( "Wrong user ID" , expectedUserID , param.getUserId ( ) ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; if ( ( value == null ) || ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( ( ( java.lang.String ) ( value ) ) ) ) ) { result.setSuccess ( false ) ; result.getReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . emptyImagePath ( ) ) ; } return result ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; if ( ( value == null ) || ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( ( ( java.lang.String ) ( value ) ) ) ) ) { result.setSuccess ( false ) ; result.getReasons ( ) . add ( org.ovirt.engine.ui.uicommonweb.models.storage.UploadImageModel.constants.emptyImagePath ( ) ) ; } return result ; }
Source:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmDeviceUtils ( ) . setVmDevices ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; vmHandler.updateVmInitFromDB ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) , true ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.unlockVmTemplate ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full endAction" ) ; } }

Target:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmDeviceUtils ( ) . setVmDevices ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; vmHandler.updateVmInitFromDB ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) , true ) ; incrementDbGeneration ( ) ; vmTemplateHandler.unlockVmTemplate ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full endAction" ) ; } }
Source:
private void setUpMockUpForStart ( ) { prepareMocks ( cmd ) ; org.mockito.Mockito.when ( serviceDao.getByServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.ServiceType.class ) ) ) . thenReturn ( getGlusterServiceListByServiceType ( ServiceType.GLUSTER_SWIFT , GlusterServiceStatus.STOPPED ) ) ; org.mockito.Mockito.doReturn ( getGlusterServerServicesByServerIdAndServiceType ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , ServiceType.GLUSTER_SWIFT , GlusterServiceStatus.STOPPED ) ) . when ( serverServiceDao ) . getByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.ServiceType.class ) ) ; }

Target:
private void setUpMockUpForStart ( ) { prepareMocks ( cmd ) ; org.mockito.Mockito.when ( serviceDao.getByServiceType ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.ServiceType.class ) ) ) . thenReturn ( getGlusterServiceListByServiceType ( ServiceType.GLUSTER_SWIFT , GlusterServiceStatus.STOPPED ) ) ; org.mockito.Mockito.doReturn ( getGlusterServerServicesByServerIdAndServiceType ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , ServiceType.GLUSTER_SWIFT , GlusterServiceStatus.STOPPED ) ) . when ( serverServiceDao ) . getByServerIdAndServiceType ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.ServiceType.class ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.Quota mockBasicQuota ( ) { ( dbCalls ) ++ ; org.ovirt.engine.core.common.businessentities.Quota quota = new org.ovirt.engine.core.common.businessentities.Quota ( ) ; quota.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; quota.setStoragePoolId ( storage_pool.getId ( ) ) ; quota.setDescription ( "My Quota description" ) ; quota.setQuotaName ( "My Quota Name" ) ; quota.setGraceStoragePercentage ( 20 ) ; quota.setGraceVdsGroupPercentage ( 20 ) ; quota.setThresholdStoragePercentage ( 80 ) ; quota.setThresholdVdsGroupPercentage ( 80 ) ; quota.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.HARD_ENFORCEMENT ) ; return quota ; }

Target:
private org.ovirt.engine.core.common.businessentities.Quota mockBasicQuota ( ) { ( dbCalls ) ++ ; org.ovirt.engine.core.common.businessentities.Quota quota = new org.ovirt.engine.core.common.businessentities.Quota ( ) ; quota.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; quota.setStoragePoolId ( storage_pool.getId ( ) ) ; quota.setDescription ( "My Quota description" ) ; quota.setQuotaName ( "My Quota Name" ) ; quota.setGraceStoragePercentage ( 20 ) ; quota.setGraceClusterPercentage ( 20 ) ; quota.setThresholdStoragePercentage ( 80 ) ; quota.setThresholdClusterPercentage ( 80 ) ; quota.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.HARD_ENFORCEMENT ) ; return quota ; }
Source:
public void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public 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 ) { return source != null ? source : java.util.Collections.emptyList ( ) ; } } ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
public void testNoDiskBootFromIsoDomain ( ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer mock = mockIsoDomainListSyncronizer ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.compat.Guid ( ) ) . when ( mock ) . findActiveISODomain ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.CD , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , true , null ) ; }

Target:
public void testNoDiskBootFromIsoDomain ( ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer mock = mockIsoDomainListSyncronizer ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( mock ) . findActiveISODomain ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.CD , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , true , null ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filter ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( ( ( "policy unit:" + ( getName ( ) ) ) + "filter is not implemented" ) ) ; return hosts ; }

Target:
public org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > balance ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , java.util.Map < java.lang.String , java.lang.String > parameters , java.util.ArrayList < java.lang.String > messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( ( ( "policy unit:" + ( getPolicyUnit ( ) . getName ( ) ) ) + "balance is not implemented" ) ) ; return null ; }
Source:
protected void removeVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVmMap > all = getTagDao ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVmMap tagVm : all ) { getTagDao ( ) . detachVmFromTag ( tagVm.gettag_id ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > getInterfaces ( ) { if ( ( interfaces ) == null ) { interfaces = org.ovirt.engine.core.bll.VmCommand.getVmNicDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } return interfaces ; }
Source:
public void testGetAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAll ( ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }

Target:
public void testGetAllWithPermissionsPrivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertTrue ( result.contains ( existingVds ) ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; if ( disk.isShareable ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( constants.shareable ( ) ) ; } return null ; }

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.getId ( ) . toString ( ) ; }
Source:
public org.ovirt.engine.core.compat.Guid createAsyncTask ( org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return createAsyncTask ( parentCommand , null , org.ovirt.engine.core.bll.CommandBase.EMPTY_GUID_ARRAY ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { return createTaskImpl ( taskId , asyncTaskCreationInfo , parentCommand , description , entityType , entityIds ) ; } catch ( java.lang.RuntimeException ex ) { log.errorFormat ( "Error during CreateTask for command: {0}. Exception {1}" , getClass ( ) . getName ( ) , ex ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } return org.ovirt.engine.core.compat.Guid.Empty ; }
Source:
public javax.ws.rs.core.Response remove ( org.ovirt.engine.api.model.Action action ) { get ( ) ; boolean force = false ; if ( ( action != null ) && ( action.isSetForce ( ) ) ) { force = action.isForce ( ) ; } return performAction ( VdcActionType.RemoveVds , new org.ovirt.engine.core.common.action.RemoveVdsParameters ( guid , force ) ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; boolean force = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendHostResource.FORCE , true , false ) ; return performAction ( VdcActionType.RemoveVds , new org.ovirt.engine.core.common.action.RemoveVdsParameters ( guid , force ) ) ; }
Source:
public static void getStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isConnectionExtensionExists ( org.ovirt.engine.core.compat.Guid connExtId ) { org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension connExt = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionExtensionDao ( ) . get ( connExtId ) ; if ( connExt == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_EXTENSION_DOES_NOT_EXIST , java.lang.String.format ( "$%1$s %2$s" , "connExtId" , connExtId.toString ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isConnectionExtensionExists ( org.ovirt.engine.core.compat.Guid connExtId ) { org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension connExt = getDbFacade ( ) . getStorageServerConnectionExtensionDao ( ) . get ( connExtId ) ; if ( connExt == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_EXTENSION_DOES_NOT_EXIST , java.lang.String.format ( "$%1$s %2$s" , "connExtId" , connExtId.toString ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN ) ; }

Target:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) . when ( command ) . getAllImageSnapshots ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
private void setupNetworkClusterDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > expectedVdsGroup = java.util.Collections.singletonList ( cluster ) ; org.ovirt.engine.core.dao.VdsGroupDao vdsGroupDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDao.class ) ; org.mockito.Mockito.when ( vdsGroupDaoMock.getAllForStoragePool ( storagePoolId ) ) . thenReturn ( expectedVdsGroup ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVdsGroupDao ( ) ) . thenReturn ( vdsGroupDaoMock ) ; }

Target:
private void setupNetworkClusterDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > expectedCluster = java.util.Collections.singletonList ( cluster ) ; org.ovirt.engine.core.dao.ClusterDao clusterDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; org.mockito.Mockito.when ( clusterDaoMock.getAllForStoragePool ( storagePoolId ) ) . thenReturn ( expectedCluster ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getClusterDao ( ) ) . thenReturn ( clusterDaoMock ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateAttachmentNotReferenceVlanDevice ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = existingInterfacesMap.get ( attachment.getNicName ( ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ATTACHMENT_REFERENCE_VLAN_DEVICE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "ATTACHMENT_REFERENCE_VLAN_DEVICE_ENTITY" , attachment.getNetworkName ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "nicName" , attachment.getNicName ( ) ) ) . when ( ( ( nic != null ) && ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( nic ) ) ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateAttachmentNotReferenceVlanDevice ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = existingInterfacesMap.get ( attachment.getNicName ( ) ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.ATTACHMENT_REFERENCE_VLAN_DEVICE ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , attachment.getNetworkName ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.VAR_NIC_NAME , attachment.getNicName ( ) ) ) . when ( ( ( nic != null ) && ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( nic ) ) ) ) ; }
Source:
public void addExternallyManagedVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > externalVmList ) { for ( org.ovirt.engine.core.common.businessentities.VmStatic currVm : externalVmList ) { org.ovirt.engine.core.common.action.AddVmFromScratchParameters params = new org.ovirt.engine.core.common.action.AddVmFromScratchParameters ( currVm , null , null ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.AddVmFromScratch , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.VdsEventListener.log.debugFormat ( "Failed adding Externally managed VM {0}" , currVm.getName ( ) ) ; } } }

Target:
public void addExternallyManagedVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > externalVmList ) { for ( org.ovirt.engine.core.common.businessentities.VmStatic currVm : externalVmList ) { org.ovirt.engine.core.common.action.AddVmParameters params = new org.ovirt.engine.core.common.action.AddVmParameters ( currVm ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.AddVmFromScratch , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.VdsEventListener.log.debug ( "Failed adding Externally managed VM '{}'" , currVm.getName ( ) ) ; } } }
Source:
public boolean canShowConsole ( org.ovirt.engine.ui.uicommonweb.models.userportal.ConsoleProtocol selectedProtocol , org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { if ( selectedProtocol == null ) { return false ; } boolean isSpiceAvailable = ( selectedProtocol.equals ( ConsoleProtocol.SPICE ) ) && ( canOpenSpiceConsole ( item ) ) ; boolean isRdpAvailable = ( selectedProtocol.equals ( ConsoleProtocol.RDP ) ) && ( canOpenRDPConsole ( item ) ) ; boolean isVncAvailable = selectedProtocol.equals ( ConsoleProtocol.VNC ) ; return ( isSpiceAvailable || isRdpAvailable ) || isVncAvailable ; }

Target:
public boolean canShowConsole ( org.ovirt.engine.ui.uicommonweb.models.ConsoleProtocol selectedProtocol , org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel item ) { if ( selectedProtocol == null ) { return false ; } boolean isSpiceAvailable = ( selectedProtocol.equals ( ConsoleProtocol.SPICE ) ) && ( canOpenSpiceConsole ( item ) ) ; boolean isRdpAvailable = ( selectedProtocol.equals ( ConsoleProtocol.RDP ) ) && ( canOpenRDPConsole ( item ) ) ; boolean isVncAvailable = selectedProtocol.equals ( ConsoleProtocol.VNC ) ; return ( isSpiceAvailable || isRdpAvailable ) || isVncAvailable ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel getPosixModelByStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { switch ( storage.getStorageType ( ) ) { case GLUSTERFS : return new org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel ( ) ; default : return new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; } }

Target:
private org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel getStorageModelByStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { switch ( storage.getStorageType ( ) ) { case NFS : return new org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ( ) ; case FCP : return new org.ovirt.engine.ui.uicommonweb.models.storage.FcpStorageModel ( ) ; case ISCSI : return new org.ovirt.engine.ui.uicommonweb.models.storage.IscsiStorageModel ( ) ; case LOCALFS : return new org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ( ) ; case POSIXFS : return new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; case GLUSTERFS : return new org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel ( ) ; } return null ; }
Source:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.common.vdscommands.gluster.SetUpGlusterGeoRepMountBrokerVDSParameters parameters = org.ovirt.engine.core.vdsbroker.gluster.SetupGlusterGeoRepMountBrokerVDSCommand.getParameters ( ) ; status = org.ovirt.engine.core.vdsbroker.gluster.SetupGlusterGeoRepMountBrokerVDSCommand.getBroker ( ) . glusterGeoRepMountBrokerSetup ( parameters.getRemoteVolumeName ( ) , parameters.getRemoteUserName ( ) , parameters.getRemoteGroupName ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.SetupGlusterGeoRepMountBrokerVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.common.vdscommands.gluster.SetUpGlusterGeoRepMountBrokerVDSParameters parameters = org.ovirt.engine.core.vdsbroker.gluster.SetupGlusterGeoRepMountBrokerVDSCommand.getParameters ( ) ; status = org.ovirt.engine.core.vdsbroker.gluster.SetupGlusterGeoRepMountBrokerVDSCommand.getBroker ( ) . glusterGeoRepMountBrokerSetup ( parameters.getRemoteVolumeName ( ) , parameters.getRemoteUserName ( ) , parameters.getRemoteGroupName ( ) , parameters.isPartial ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.SetupGlusterGeoRepMountBrokerVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
private org.ovirt.engine.core.common.action.RemoveCinderDiskParameters buildChildCommandParameters ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { org.ovirt.engine.core.common.action.RemoveCinderDiskParameters removeDiskParams = new org.ovirt.engine.core.common.action.RemoveCinderDiskParameters ( cinderDisk.getId ( ) ) ; removeDiskParams.setParentCommand ( org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllVmCinderDisksCommand.getActionType ( ) ) ; removeDiskParams.setParentParameters ( org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllVmCinderDisksCommand.getParameters ( ) ) ; removeDiskParams.setShouldBeLogged ( false ) ; removeDiskParams.setShouldBeEndedByParent ( false ) ; return removeDiskParams ; }

Target:
private org.ovirt.engine.core.common.action.RemoveCinderDiskParameters buildChildCommandParameters ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { org.ovirt.engine.core.common.action.RemoveCinderDiskParameters removeDiskParams = new org.ovirt.engine.core.common.action.RemoveCinderDiskParameters ( cinderDisk.getId ( ) ) ; removeDiskParams.setParentCommand ( org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllVmCinderDisksCommand.getActionType ( ) ) ; removeDiskParams.setParentParameters ( org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllVmCinderDisksCommand.getParameters ( ) ) ; removeDiskParams.setShouldBeLogged ( false ) ; removeDiskParams.setEndProcedure ( EndProcedure.COMMAND_MANAGED ) ; return removeDiskParams ; }
Source:
private void numaSupport ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.core.common.businessentities.VDS host = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSelectedItem ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = getSelectedItems ( ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.numa.NumaSupportModel model = new org.ovirt.engine.ui.uicommonweb.models.hosts.numa.NumaSupportModel ( hosts , host , this ) ; setWindow ( model ) ; }

Target:
private void onNumaSupport ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getWindow ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.hosts.numa.NumaSupportModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.numa.NumaSupportModel ) ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getWindow ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > updateParamsList = model.getUpdateParameters ( ) ; if ( ! ( updateParamsList.isEmpty ( ) ) ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.UpdateVmNumaNodes , updateParamsList ) ; } org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.setWindow ( null ) ; }
Source:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }