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

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.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public static void getDataCenterList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void getDataCenterList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
protected void initLabelModels ( ) { java.util.Collections.sort ( originalLabels , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > > items = new java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > > ( ) ; for ( java.lang.String label : originalLabels ) { org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > labelModel = new org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > ( ) ; labelModel.setItems ( suggestedLabels ) ; labelModel.setSelectedItem ( label ) ; items.add ( labelModel ) ; } setItems ( items ) ; }

Target:
protected void initLabelModels ( ) { java.util.Collections.sort ( originalLabels , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > > items = new java.util.LinkedList < > ( ) ; for ( java.lang.String label : originalLabels ) { org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > labelModel = new org.ovirt.engine.ui.uicommonweb.models.ListModel ( ) ; labelModel.setItems ( suggestedLabels ) ; labelModel.setSelectedItem ( label ) ; items.add ( labelModel ) ; } setItems ( items ) ; }
Source:
public static boolean isVmPriorityValueLegal ( int value , java.util.List < java.lang.String > reasons ) { boolean res = false ; if ( ( value >= 0 ) && ( value <= ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VmPriorityMaxValue ) ) ) ) { res = true ; } else { reasons.add ( VdcBllMessages.VM_OR_TEMPLATE_ILLEGAL_PRIORITY_VALUE.toString ( ) ) ; reasons.add ( java.lang.String.format ( "$MaxValue %1$s" , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VmPriorityMaxValue ) ) ) ; } return res ; }

Target:
public static boolean isVmPriorityValueLegal ( int value , java.util.List < java.lang.String > reasons ) { boolean res = false ; if ( ( value >= 0 ) && ( value <= ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VmPriorityMaxValue ) ) ) ) { res = true ; } else { reasons.add ( VdcBllMessages.VM_OR_TEMPLATE_ILLEGAL_PRIORITY_VALUE.toString ( ) ) ; reasons.add ( java.lang.String.format ( "$MaxValue %1$s" , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VmPriorityMaxValue ) ) ) ; } return res ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( "OnRemove" . equals ( command.getName ( ) ) ) { onRemove ( ) ; } else if ( "OnRestore" . equals ( command.getName ( ) ) ) { onRestore ( ) ; } else if ( "CancelConfirmation" . equals ( command.getName ( ) ) ) { cancelConfirmation ( ) ; } else if ( "RemoveVmTemplates" . equals ( command.getName ( ) ) ) { removeTemplateBackup ( ) ; } else { super . executeCommand ( command ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { switch ( command.getName ( ) ) { case "OnRemove" : onRemove ( ) ; break ; case "OnRestore" : onRestore ( ) ; break ; case "RemoveVmTemplates" : removeTemplateBackup ( ) ; break ; default : super . executeCommand ( command ) ; } }
Source:
public void testListGlobalLimit ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaStorage ( getStorageGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; control.replay ( ) ; org.ovirt.engine.api.model.QuotaStorageLimits storageLimits = collection.list ( ) ; assertStorageLimitsFound ( storageLimits , 1 ) ; org.ovirt.engine.api.model.QuotaStorageLimit storageLimit = storageLimits.getQuotaStorageLimits ( ) . get ( 0 ) ; assertEquals ( storageLimit.getLimit ( ) , org.ovirt.engine.api.restapi.resource.BackendQuotaStorageLimitsResourceTest.STORAGE_SIZE_GB ) ; }

Target:
public void testListGlobalLimit ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaStorage ( getStorageGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; control.replay ( ) ; org.ovirt.engine.api.model.QuotaStorageLimits storageLimits = collection.list ( ) ; assertStorageLimitsFound ( storageLimits , 1 ) ; org.ovirt.engine.api.model.QuotaStorageLimit storageLimit = storageLimits.getQuotaStorageLimits ( ) . get ( 0 ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendQuotaStorageLimitsResourceTest.STORAGE_SIZE_GB , storageLimit.getLimit ( ) ) ; }
Source:
public void testQueryForInvalidVolumeId ( ) { org.mockito.Mockito.doReturn ( Guid.Empty ) . when ( getQueryParameters ( ) ) . getVolumeId ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( volumeDao ) . getById ( Guid.Empty ) ; getQuery ( ) . executeQueryCommand ( ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( getQuery ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertEquals ( EngineMessage.GLUSTER_VOLUME_ID_INVALID.toString ( ) , returnValue.getExceptionString ( ) ) ; }

Target:
public void testQueryForInvalidVolumeId ( ) { org.mockito.Mockito.doReturn ( Guid.Empty ) . when ( getQueryParameters ( ) ) . getVolumeId ( ) ; getQuery ( ) . executeQueryCommand ( ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( getQuery ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertEquals ( EngineMessage.GLUSTER_VOLUME_ID_INVALID.toString ( ) , returnValue.getExceptionString ( ) ) ; }
Source:
protected void updateVmDevices ( java.util.List < java.lang.String > vmsToUpdate ) { java.util.Map [ ] vms = getVmInfo ( vmsToUpdate ) ; if ( vms != null ) { for ( java.util.Map vm : vms ) { processVmDevices ( vm ) ; } } }

Target:
protected void updateVmDevices ( java.util.List < java.lang.String > vmsToUpdate ) { if ( vmsToUpdate.isEmpty ( ) ) { return ; } java.util.Map [ ] vms = getVmInfo ( vmsToUpdate ) ; if ( vms != null ) { for ( java.util.Map vm : vms ) { processVmDevices ( vm ) ; } } }
Source:
public void isConnWithSameDetailsExistNoConnections ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( storageConnDao.getAllForStorage ( newNFSConnection.getconnection ( ) ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newNFSConnection ) ; org.junit.Assert.assertFalse ( isExists ) ; }

Target:
public void isConnWithSameDetailsExistNoConnections ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( storageConnDao.getAllForStorage ( newNFSConnection.getconnection ( ) ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newNFSConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }
Source:
public void testVmWithDisks ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; disks.add ( new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( vm , null , disks ) , true , null ) ; }

Target:
public void testVmWithDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; disks.add ( new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , null , disks ) , true , null ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VmInit buildCloudInitParameters ( org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel model ) { if ( ( model.getIsSysprepEnabled ( ) . getEntity ( ) ) || ( model.getIsCloudInitEnabled ( ) . getEntity ( ) ) ) { return buildModelSpecificParameters ( model.getIsWindowsOS ( ) , model.getSysPrepSelectedDomainName ( ) . getEntity ( ) ) ; } else { return null ; } }

Target:
public org.ovirt.engine.core.common.businessentities.VmInit buildCloudInitParameters ( org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel model ) { if ( ( model.getIsSysprepEnabled ( ) . getEntity ( ) ) || ( model.getIsCloudInitEnabled ( ) . getEntity ( ) ) ) { return buildModelSpecificParameters ( model.getIsWindowsOS ( ) ) ; } else { return null ; } }
Source:
private void updateVmStaticTable ( ) { final org.ovirt.engine.core.dao.VmStaticDao vmStaticDao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStaticDao ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic : vmStaticDao.getAllWithoutIcon ( ) ) { setIconsByOs ( vmStatic ) ; vmStaticDao.update ( vmStatic ) ; } final org.ovirt.engine.core.dao.VmTemplateDao vmTemplateDao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate : vmTemplateDao.getAllWithoutIcon ( ) ) { setIconsByOs ( vmTemplate ) ; vmTemplateDao.update ( vmTemplate ) ; } }

Target:
private void updateVmStaticTable ( ) { for ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic : vmStaticDao.getAllWithoutIcon ( ) ) { setIconsByOs ( vmStatic ) ; vmStaticDao.update ( vmStatic ) ; } for ( org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate : vmTemplateDao.getAllWithoutIcon ( ) ) { setIconsByOs ( vmTemplate ) ; vmTemplateDao.update ( vmTemplate ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetDirectoryUserByPrincipalQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.aaa.DirectoryUtils.mapPrincipalRecordToDirectoryUser ( org.ovirt.engine.core.bll.GetDirectoryUserByPrincipalQuery.getParameters ( ) . getAuthz ( ) , org.ovirt.engine.core.aaa.AuthzUtils.fetchPrincipalRecord ( org.ovirt.engine.core.utils.extensionsmgr.EngineExtensionsManager.getInstance ( ) . getExtensionByName ( org.ovirt.engine.core.bll.GetDirectoryUserByPrincipalQuery.getParameters ( ) . getAuthz ( ) ) , org.ovirt.engine.core.bll.GetDirectoryUserByPrincipalQuery.getParameters ( ) . getPrincnipal ( ) ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetDirectoryUserByPrincipalQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.aaa.DirectoryUtils.mapPrincipalRecordToDirectoryUser ( org.ovirt.engine.core.bll.GetDirectoryUserByPrincipalQuery.getParameters ( ) . getAuthz ( ) , org.ovirt.engine.core.aaa.AuthzUtils.fetchPrincipalRecord ( org.ovirt.engine.core.utils.extensionsmgr.EngineExtensionsManager.getInstance ( ) . getExtensionByName ( org.ovirt.engine.core.bll.GetDirectoryUserByPrincipalQuery.getParameters ( ) . getAuthz ( ) ) , org.ovirt.engine.core.bll.GetDirectoryUserByPrincipalQuery.getParameters ( ) . getPrincnipal ( ) , false , false ) ) ) ; }
Source:
private void prepareStorageServer ( org.ovirt.engine.core.common.action.HostStoragePoolParametersBase parameters , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > res = org.ovirt.engine.core.bll.storage.ISCSIStorageHelper.updateIfaces ( connections , parameters.getVds ( ) . getId ( ) ) ; connections.clear ( ) ; connections.addAll ( res ) ; }

Target:
private boolean prepareStorageServer ( org.ovirt.engine.core.common.action.HostStoragePoolParametersBase parameters , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > res = org.ovirt.engine.core.bll.storage.ISCSIStorageHelper.updateIfaces ( connections , parameters.getVds ( ) . getId ( ) ) ; connections.clear ( ) ; connections.addAll ( res ) ; return true ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return getParameters ( ) . isNeedsLocking ( ) ? java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVmId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM , getSnapshotIsBeingTakenForVmMessage ( ) ) ) : null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getParameters ( ) . isNeedsLocking ( ) ? java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVmId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM , getSnapshotIsBeingTakenForVmMessage ( ) ) ) : null ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String label = getNetworkLabel ( ) . getSelectedItem ( ) ; getNetworkLabel ( ) . setItems ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; getNetworkLabel ( ) . setSelectedItem ( label ) ; stopProgress ( ) ; onExportChanged ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String label = getNetworkLabel ( ) . getSelectedItem ( ) ; getNetworkLabel ( ) . setItems ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; getNetworkLabel ( ) . setSelectedItem ( label ) ; onExportChanged ( ) ; }
Source:
public void testGuestFQDN ( ) { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vmDynamic.setVmFQDN ( "localhost.localdomain" ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.VM map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.model.VM ) ( null ) ) ) ; assertNotNull ( map.getGuestInfo ( ) . getFqdn ( ) ) ; assertEquals ( map.getGuestInfo ( ) . getFqdn ( ) , "localhost.localdomain" ) ; }

Target:
public void testGuestFQDN ( ) { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vmDynamic.setVmFQDN ( "localhost.localdomain" ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.VM map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.model.VM ) ( null ) ) ) ; assertNotNull ( map.getFqdn ( ) ) ; assertEquals ( map.getFqdn ( ) , "localhost.localdomain" ) ; }
Source:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public void updateChangeConnectionType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections iscsiConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( iscsiConnection ) ; org.mockito.Mockito.when ( storageConnDao.get ( iscsiConnection.geIid ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE ) ; }

Target:
public void updateChangeConnectionType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections iscsiConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( iscsiConnection ) ; org.mockito.Mockito.when ( storageConnDao.get ( iscsiConnection.getId ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE ) ; }
Source:
public void testValidateValid ( ) { org.mockito.Mockito.when ( mockProblematicVmMacsFinder.findProblematicMacs ( mockVM ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; final org.ovirt.engine.core.bll.ValidationResult actual = underTest.validate ( mockVM ) ; org.junit.Assert.assertThat ( actual , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateValid ( ) { final org.ovirt.engine.core.bll.ValidationResult actual = underTest.validate ( mockVM ) ; org.junit.Assert.assertThat ( actual , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void setUpDaoMocks ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacadeMock = getDbFacadeMockInstance ( ) ; org.ovirt.engine.core.dao.SnapshotDao snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.when ( dbFacadeMock.getSnapshotDao ( ) ) . thenReturn ( snapshotDaoMock ) ; org.mockito.Mockito.when ( snapshotDaoMock.getAll ( vmId , getUser ( ) . getId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( snapshot ) ) ; }

Target:
private void setUpDaoMocks ( ) { org.mockito.Mockito.when ( snapshotDaoMock.getAll ( vmId , getUser ( ) . getId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( snapshot ) ) ; }
Source:
private void addGraphicsDevice ( ) { for ( org.ovirt.engine.core.common.businessentities.GraphicsType type : org.ovirt.engine.core.common.businessentities.GraphicsType.values ( ) ) { org.ovirt.engine.core.common.businessentities.GraphicsDevice graphicsDevice = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getGraphicsDevices ( ) . get ( type ) ; if ( graphicsDevice == null ) { continue ; } graphicsDevice.setVmId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.AddVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.AddGraphicsDevice , new org.ovirt.engine.core.bll.GraphicsParameters ( graphicsDevice ) ) ; } }

Target:
private void addGraphicsDevice ( ) { for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice graphicsDevice : org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getGraphicsDevices ( ) . values ( ) ) { if ( graphicsDevice == null ) { continue ; } graphicsDevice.setVmId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.AddVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.AddGraphicsDevice , new org.ovirt.engine.core.bll.GraphicsParameters ( graphicsDevice ) ) ; } }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getActionState ( ) ) { case EXECUTE : if ( ! ( getParameters ( ) . getTaskGroupSuccess ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_IMPORT_IMAGE_FINISHED_FAILURE ; } if ( ( ( getParameters ( ) . getExecutionIndex ( ) ) == 0 ) && ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getSucceeded ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_IMPORT_IMAGE ; } break ; case END_SUCCESS : return org.ovirt.engine.core.common.AuditLogType.USER_IMPORT_IMAGE_FINISHED_SUCCESS ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.USER_IMPORT_IMAGE_FINISHED_FAILURE ; } return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getActionState ( ) ) { case EXECUTE : if ( ! ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_IMPORT_IMAGE_FINISHED_FAILURE ; } if ( ( ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getExecutionIndex ( ) ) == 0 ) && ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getSucceeded ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_IMPORT_IMAGE ; } break ; case END_SUCCESS : return org.ovirt.engine.core.common.AuditLogType.USER_IMPORT_IMAGE_FINISHED_SUCCESS ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.USER_IMPORT_IMAGE_FINISHED_FAILURE ; } return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; }
Source:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( true , false ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }

Target:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( true , false ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
public double getActualDiskSize ( ) { double result = 0 ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : getDiskImageMap ( ) . values ( ) ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { result += ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) . getActualSize ( ) ; } } return result ; }

Target:
public double getActualDiskSize ( ) { double result = 0 ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : getDiskImageMap ( ) . values ( ) ) { result += disk.getActualSize ( ) ; } return result ; }
Source:
protected void doEdit ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel model ) { driver.edit ( model ) ; monitorCount.setValue ( java.lang.Integer.toString ( getModel ( ) . getMonitorCount ( ) ) ) ; oS.setValue ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getOsName ( getModel ( ) . getOS ( ) ) ) ; defaultHost.setTitle ( getModel ( ) . getDefaultHost ( ) ) ; }

Target:
protected void doEdit ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel model ) { driver.edit ( model ) ; monitorCount.setValue ( java.lang.Integer.toString ( getModel ( ) . getMonitorCount ( ) ) ) ; oS.setValue ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getOsName ( getModel ( ) . getOS ( ) ) ) ; }
Source:
protected org.ovirt.engine.core.authentication.DirectoryGroup getAdGroup ( ) { if ( ( ( mGroup ) == null ) && ( ! ( getGroupId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.common.businessentities.DbGroup dbGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbGroupDao ( ) . get ( getGroupId ( ) ) ; org.ovirt.engine.core.authentication.Directory directory = org.ovirt.engine.core.authentication.DirectoryManager.getInstance ( ) . getDirectory ( dbGroup.getDomain ( ) ) ; mGroup = directory.findGroup ( dbGroup.getExternalId ( ) ) ; } return mGroup ; }

Target:
protected org.ovirt.engine.core.authentication.DirectoryGroup getAdGroup ( ) { if ( ( ( mGroup ) == null ) && ( ! ( getGroupId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.common.businessentities.DbGroup dbGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbGroupDao ( ) . get ( getGroupId ( ) ) ; org.ovirt.engine.core.authentication.Directory directory = org.ovirt.engine.core.authentication.DirectoryManager.getInstance ( ) . getDirectory ( dbGroup.getDomain ( ) ) ; if ( directory != null ) { mGroup = directory.findGroup ( dbGroup.getExternalId ( ) ) ; } } return mGroup ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityWithNoCertificateInfoExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Host model = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityWithNoCertificateInfoExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.Host model = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.ArgumentMatchers.anyString ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel ) ( target ) ) ; java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > filteredHosts = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { if ( isHostAvailable ( host ) ) { filteredHosts.add ( host ) ; } } diskModel.getHost ( ) . setItems ( filteredHosts ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > filteredHosts = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { if ( isHostAvailable ( host ) ) { filteredHosts.add ( host ) ; } } getHost ( ) . setItems ( filteredHosts ) ; }
Source:
public void clusterWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }

Target:
public void clusterWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }
Source:
private java.util.List < org.ovirt.engine.core.compat.Guid > parseFilterResults ( java.lang.Object result ) { if ( ( result == null ) || ( ! ( result instanceof java.lang.Object [ ] ) ) ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.log.error ( "External scheduler error, malformed filter results" ) ; return null ; } java.util.List < org.ovirt.engine.core.compat.Guid > retValue = new java.util.LinkedList < org.ovirt.engine.core.compat.Guid > ( ) ; for ( java.lang.Object hostID : ( ( java.lang.Object [ ] ) ( result ) ) ) { retValue.add ( new org.ovirt.engine.core.compat.Guid ( hostID.toString ( ) ) ) ; } return retValue ; }

Target:
private java.util.List < org.ovirt.engine.core.compat.Guid > parseFilterResults ( java.lang.Object result ) { if ( ! ( result instanceof java.lang.Object [ ] ) ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.log.error ( "External scheduler error, malformed filter results" ) ; return null ; } java.util.List < org.ovirt.engine.core.compat.Guid > retValue = new java.util.LinkedList < org.ovirt.engine.core.compat.Guid > ( ) ; for ( java.lang.Object hostID : ( ( java.lang.Object [ ] ) ( result ) ) ) { retValue.add ( new org.ovirt.engine.core.compat.Guid ( hostID.toString ( ) ) ) ; } return retValue ; }
Source:
protected void addReverseDetailItem ( com.google.gwt.safehtml.shared.SafeHtml label , java.lang.String value , com.google.gwt.dom.client.DListElement parent ) { com.google.gwt.dom.client.Element dt = com.google.gwt.dom.client.Document.get ( ) . createElement ( "dt" ) ; dt.setInnerText ( value ) ; parent.appendChild ( dt ) ; com.google.gwt.dom.client.Element dd = com.google.gwt.dom.client.Document.get ( ) . createElement ( "dd" ) ; dd.setInnerSafeHtml ( label ) ; parent.appendChild ( dd ) ; }

Target:
protected void addReverseDetailItem ( com.google.gwt.safehtml.shared.SafeHtml label , com.google.gwt.safehtml.shared.SafeHtml value , com.google.gwt.dom.client.DListElement parent ) { com.google.gwt.dom.client.Element dt = com.google.gwt.dom.client.Document.get ( ) . createElement ( "dt" ) ; dt.setInnerSafeHtml ( value ) ; parent.appendChild ( dt ) ; com.google.gwt.dom.client.Element dd = com.google.gwt.dom.client.Document.get ( ) . createElement ( "dd" ) ; dd.setInnerSafeHtml ( label ) ; parent.appendChild ( dd ) ; }
Source:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworks ( java.lang.String clusterId ) { org.ovirt.engine.core.compat.NGuid dataCenterId = getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters ( asGuid ( clusterId ) ) , null ) . getStoragePoolId ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( dataCenterId ) ) ; return getBackendCollection ( VdcQueryType.GetAllNetworks , params ) ; }

Target:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworks ( java.lang.String clusterId ) { org.ovirt.engine.core.compat.Guid dataCenterId = getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( clusterId ) ) , null ) . getStoragePoolId ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ; return getBackendCollection ( VdcQueryType.GetAllNetworks , params ) ; }
Source:
public static boolean isAdminUser ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > userRoles = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getRoleDAO ( ) . getAnyAdminRoleForUserAndGroups ( user.getId ( ) , org.apache.commons.lang.StringUtils.join ( user.getGroupIds ( ) , "," ) ) ; if ( ! ( userRoles.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.debug ( "LoginAdminUser: User logged to admin using role '{}'" , userRoles.get ( 0 ) . getname ( ) ) ; return true ; } return false ; }

Target:
public static boolean isAdminUser ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > userRoles = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getRoleDAO ( ) . getAnyAdminRoleForUserAndGroups ( user.getId ( ) , org.apache.commons.lang.StringUtils.join ( user.getGroupIds ( ) , "," ) ) ; if ( ! ( userRoles.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.debug ( "LoginAdminUser: User logged to admin using role '{}'" , userRoles.get ( 0 ) . getName ( ) ) ; return true ; } return false ; }
Source:
protected org.ovirt.engine.api.model.DataCenter deprecatedPopulate ( org.ovirt.engine.api.model.DataCenter model , org.ovirt.engine.core.common.businessentities.StoragePool entity ) { org.ovirt.engine.core.common.queries.GetAvailableStoragePoolVersionsParameters parameters = new org.ovirt.engine.core.common.queries.GetAvailableStoragePoolVersionsParameters ( ) ; parameters.setStoragePoolId ( new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) ; model.setSupportedVersions ( getMapper ( java.util.List.class , org.ovirt.engine.api.model.SupportedVersions.class ) . map ( getEntity ( java.util.ArrayList.class , VdcQueryType.GetAvailableStoragePoolVersions , parameters , model.getId ( ) ) , null ) ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.DataCenter deprecatedPopulate ( org.ovirt.engine.api.model.DataCenter model , org.ovirt.engine.core.common.businessentities.StoragePool entity ) { org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) ; model.setSupportedVersions ( getMapper ( java.util.List.class , org.ovirt.engine.api.model.SupportedVersions.class ) . map ( getEntity ( java.util.ArrayList.class , VdcQueryType.GetAvailableStoragePoolVersions , parameters , model.getId ( ) ) , null ) ) ; return model ; }
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.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.GetStorageDomainsByVmTemplateIdQueryParameters ( templateId ) , aQuery ) ; }

Target:
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.GetStorageDomainsByVmTemplateIdQueryParameters ( templateId ) , aQuery ) ; }
Source:
protected int calcSpmCpuConsumption ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return ( vds.getSpmStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ? 0 : ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.SpmVCpuConsumption ) ) * ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VcpuConsumptionPercentage ) ) ) / ( vds.getCpuCores ( ) ) ; }

Target:
protected int calcSpmCpuConsumption ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return ( vds.getSpmStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ? 0 : ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.SpmVCpuConsumption ) ) * ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VcpuConsumptionPercentage ) ) ) / ( vds.getCpuCores ( ) ) ; }
Source:
public void validateFailsOnPassDiscardSupport ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain srcSd = initStorageDomain ( srcStorageId ) ; srcSd.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstSd = initStorageDomain ( dstStorageId ) ; dstSd.setStatus ( StorageDomainStatus.Active ) ; org.mockito.Mockito.when ( diskVmElementValidator.isPassDiscardSupported ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ; }

Target:
public void validateFailsOnPassDiscardSupport ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain srcSd = initStorageDomain ( srcStorageId ) ; srcSd.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstSd = initStorageDomain ( dstStorageId ) ; dstSd.setStatus ( StorageDomainStatus.Active ) ; org.mockito.Mockito.when ( diskVmElementValidator.isPassDiscardSupported ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VdsStatic map ( java.lang.String protocol , org.ovirt.engine.core.common.businessentities.VdsStatic template ) { org.ovirt.engine.core.common.businessentities.VdsStatic entity = ( template != null ) ? template : new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; org.ovirt.engine.api.model.HostProtocol hostProtocol = org.ovirt.engine.api.model.HostProtocol.fromValue ( protocol ) ; org.ovirt.engine.core.common.businessentities.VdsProtocol result = null ; switch ( hostProtocol ) { case STOMP : result = org.ovirt.engine.core.common.businessentities.VdsProtocol.STOMP ; break ; case AMQP : result = org.ovirt.engine.core.common.businessentities.VdsProtocol.AMQP ; break ; case XML : default : result = org.ovirt.engine.core.common.businessentities.VdsProtocol.XML ; break ; } entity.setProtocol ( result ) ; return entity ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VdsStatic map ( java.lang.String protocol , org.ovirt.engine.core.common.businessentities.VdsStatic template ) { org.ovirt.engine.core.common.businessentities.VdsStatic entity = ( template != null ) ? template : new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; org.ovirt.engine.api.model.HostProtocol hostProtocol = org.ovirt.engine.api.model.HostProtocol.fromValue ( protocol ) ; org.ovirt.engine.core.common.businessentities.VdsProtocol result = null ; switch ( hostProtocol ) { case STOMP : result = org.ovirt.engine.core.common.businessentities.VdsProtocol.STOMP ; break ; case XML : default : result = org.ovirt.engine.core.common.businessentities.VdsProtocol.XML ; break ; } entity.setProtocol ( result ) ; return entity ; }
Source:
protected org.ovirt.engine.ui.common.widget.table.SimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > createActionTable ( ) { return new org.ovirt.engine.ui.userportal.widget.table.column.UserPortalSimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > ( modelProvider , getTableResources ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getEventBus ( ) , new org.ovirt.engine.ui.userportal.widget.refresh.UserPortalRefreshManager ( modelProvider , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getClientStorage ( ) ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.table.SimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > createActionTable ( ) { return new org.ovirt.engine.ui.userportal.widget.table.column.UserPortalSimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > ( modelProvider , getTableResources ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getClientStorage ( ) , new org.ovirt.engine.ui.userportal.widget.refresh.UserPortalRefreshManager ( modelProvider , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getClientStorage ( ) ) ) ; }