auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { networkCreatingManager.updateVnics ( ( ( idToUpdate ) == null ? ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) : idToUpdate ) , ( ( java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType > ) ( unitVmModel.getNicsWithLogicalNetworks ( ) . getItems ( ) ) ) ) ; } else { networkCreatingManager.getCallback ( ) . queryFailed ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { networkCreatingManager.updateVnics ( ( ( idToUpdate ) == null ? ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) : idToUpdate ) , unitVmModel.getNicsWithLogicalNetworks ( ) . getItems ( ) ) ; } else { networkCreatingManager.getCallback ( ) . queryFailed ( ) ; } }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( sessionId.hashCode ( ) ) ; result = ( prime * result ) + ( super . hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = super . hashCode ( ) ; return ( prime * result ) + ( ( sessionId ) == null ? 0 : sessionId.hashCode ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > getAllForConnection ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { return getCallsHandler ( ) . executeReadList ( "Getstorage_server_connectionsByKey" , org.ovirt.engine.core.dao.StorageServerConnectionDAODbFacadeImpl.mapper , getCustomMapSqlParameterSource ( ) . addValue ( "iqn" , connection.getiqn ( ) ) . addValue ( "connection" , connection.getconnection ( ) ) . addValue ( "port" , connection.getport ( ) ) . addValue ( "portal" , connection.getportal ( ) ) . addValue ( "username" , connection.getuser_name ( ) ) . addValue ( "password" , org.ovirt.engine.core.dal.dbbroker.DbFacadeUtils.encryptPassword ( connection.getpassword ( ) ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > getAllForConnection ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { return getCallsHandler ( ) . executeReadList ( "Getstorage_server_connectionsByKey" , org.ovirt.engine.core.dao.StorageServerConnectionDAODbFacadeImpl.mapper , getCustomMapSqlParameterSource ( ) . addValue ( "iqn" , connection.getiqn ( ) ) . addValue ( "connection" , connection.getconnection ( ) ) . addValue ( "port" , connection.getport ( ) ) . addValue ( "portal" , connection.getportal ( ) ) . addValue ( "username" , connection.getuser_name ( ) ) ) ; }
Source:
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 ) ) . intValue ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , 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:
private java.lang.String getNetworkId ( java.lang.String networkName ) { org.ovirt.engine.core.compat.Guid clusterId = getClusterId ( ) ; org.ovirt.engine.core.common.businessentities.Network n = getClusterNetwork ( clusterId , null , networkName ) ; if ( n != null ) { return n.getId ( ) . toString ( ) ; } return null ; }

Target:
private java.lang.String getNetworkId ( java.lang.String networkName ) { if ( networkName != null ) { org.ovirt.engine.core.compat.Guid clusterId = getClusterId ( ) ; org.ovirt.engine.core.common.businessentities.Network n = getClusterNetwork ( clusterId , null , networkName ) ; if ( n != null ) { return n.getId ( ) . toString ( ) ; } } return null ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmRngDevice getDevice ( org.ovirt.engine.core.compat.Guid deviceId , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VmRngDevice device = new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) ; device.setVmId ( vmId ) ; device.setDeviceId ( deviceId ) ; device.setBytes ( 12 ) ; device.setPeriod ( 34 ) ; device.setSource ( VmRngDevice.Source.RANDOM ) ; return device ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VmRngDevice getDevice ( org.ovirt.engine.core.compat.Guid deviceId , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VmRngDevice device = new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) ; device.setVmId ( vmId ) ; device.setDeviceId ( deviceId ) ; device.setBytes ( 12 ) ; device.setPeriod ( 34 ) ; device.setSource ( VmRngDevice.Source.RANDOM ) ; return device ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnRemove" ) ) { onRemove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } else if ( "OnRemove" . equals ( command.getName ( ) ) ) { onRemove ( ) ; } else if ( "Cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } }
Source:
private static void addMessageToAuditLog ( org.ovirt.engine.core.common.AuditLogType auditLogType , java.lang.String storageDomainName , java.lang.String vdsName ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "StorageDomainName" , storageDomainName ) ; logable.addCustomValue ( "VdsName" , vdsName ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , auditLogType ) ; }

Target:
public static void addMessageToAuditLog ( org.ovirt.engine.core.common.AuditLogType auditLogType , java.lang.String storageDomainName , java.lang.String vdsName ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "StorageDomainName" , storageDomainName ) ; logable.addCustomValue ( "VdsName" , vdsName ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , auditLogType ) ; }
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.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 ; }

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.List.class , VdcQueryType.GetAvailableStoragePoolVersions , parameters , model.getId ( ) ) , null ) ) ; return model ; }
Source:
public static void IsStorageDomainNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( source ) ) ; return storageDomains.isEmpty ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Storage: name=" + name ) , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) , aQuery ) ; }

Target:
public static void IsStorageDomainNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; return storageDomains.isEmpty ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Storage: name=" + name ) , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) , aQuery ) ; }
Source:
protected java.util.Locale getLocaleFromRequest ( final javax.servlet.http.HttpServletRequest request ) { java.lang.String localeString = getLocaleStringFromReferer ( request ) ; if ( null == localeString ) { localeString = getLocaleStringFromPath ( request.getPathInfo ( ) ) ; } java.util.Locale locale = org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( localeString , true ) ; return locale ; }

Target:
protected java.util.Locale getLocaleFromRequest ( final javax.servlet.http.HttpServletRequest request ) { java.lang.String localeString = getLocaleStringFromReferer ( request ) ; if ( localeString == null ) { localeString = getLocaleStringFromPath ( request.getPathInfo ( ) ) ; } java.util.Locale locale = org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( localeString , true ) ; return locale ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > filteredStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : storageDomains ) { if ( ( a.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { filteredStorageDomains.add ( a ) ; } } vmListModel.PostExportGetStorageDomainList ( filteredStorageDomains ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > filteredStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : storageDomains ) { if ( ( a.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { filteredStorageDomains.add ( a ) ; } } vmListModel.PostExportGetStorageDomainList ( filteredStorageDomains ) ; }
Source:
public boolean Validate ( ) { if ( ( ( getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) || ( ( getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.SOFT_ENFORCEMENT ) ) ) { return true ; } boolean isValid = true ; for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel : getDisks ( ) ) { diskModel.getQuota ( ) . validateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.SelectedQuotaValidation ( ) } ) ; isValid &= diskModel.getQuota ( ) . getIsValid ( ) ; } return isValid ; }

Target:
public boolean validate ( ) { if ( ( ( getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) || ( ( getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.SOFT_ENFORCEMENT ) ) ) { return true ; } boolean isValid = true ; for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel : getDisks ( ) ) { diskModel.getQuota ( ) . validateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.SelectedQuotaValidation ( ) } ) ; isValid &= diskModel.getQuota ( ) . getIsValid ( ) ; } return isValid ; }
Source:
protected void setObjectName ( java.lang.Object object , java.lang.String name , boolean isSuffix ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . getVm ( ) ; if ( isSuffix ) { vm.setName ( ( ( vm.getName ( ) ) + name ) ) ; } else { vm.setName ( name ) ; } }

Target:
protected void setObjectName ( java.lang.Object object , java.lang.String name ) { ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . getVm ( ) . setName ( name ) ; }
Source:
public void testCanEditARunningVM ( ) { prepareVmToPassValidate ( ) ; vm.setStatus ( VMStatus.Up ) ; mockDiskDaoGetAllForVm ( java.util.Collections.emptyList ( ) , true ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areUpdatedFieldsLegal ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void testCanEditARunningVM ( ) { prepareVmToPassValidate ( ) ; vm.setStatus ( VMStatus.Up ) ; mockDiskDaoGetAllForVm ( java.util.Collections.emptyList ( ) ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areUpdatedFieldsLegal ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
private void storagePoolAlreadyHasCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > groupList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; groupList.add ( group ) ; org.powermock.api.mockito.PowerMockito.when ( vdsGroupDAO.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( groupList ) ; }

Target:
private void storagePoolAlreadyHasCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > groupList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; groupList.add ( group ) ; org.mockito.Mockito.when ( vdsGroupDAO.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( groupList ) ; }
Source:
public void execute ( ) { org.ovirt.engine.ui.common.presenter.popup.numa.UpdatedVnumaEvent.fire ( this , nodeModel.getVm ( ) . getId ( ) , nodeModel.isPinned ( ) , nodeModel.getVmNumaNode ( ) . getIndex ( ) , ( - 1 ) ) ; org.ovirt.engine.ui.common.view.popup.numa.DraggableVirtualNumaPanel.menuPopup.hide ( ) ; }

Target:
public void execute ( ) { org.ovirt.engine.ui.common.presenter.popup.numa.UpdatedVnumaEvent.fire ( this , nodeModel.getVm ( ) . getId ( ) , false , nodeModel.getIndex ( ) , ( - 1 ) ) ; org.ovirt.engine.ui.common.view.popup.numa.DraggableVirtualNumaPanel.menuPopup.hide ( ) ; }
Source:
public void testImportWithClusterName ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ( "Cluster: name=" + ( NAMES [ 1 ] ) ) , SearchType.Cluster , getCluster ( 1 ) ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setName ( NAMES [ 1 ] ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster ) ; }

Target:
public void testImportWithClusterName ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ( "Cluster: name=" + ( NAMES [ 1 ] ) ) , SearchType.Cluster , getCluster ( 1 ) ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setName ( NAMES [ 1 ] ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , false , false ) ; }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
private void applyNetworkChangesToHosts ( ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand < T > . SyncNetworkParametersBuilder builder = new SyncNetworkParametersBuilder ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) , getOldNetwork ( ) ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.NetworkParametersBuilder.updateParametersSequencing ( parameters ) ; org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getBackend ( ) . runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , parameters ) ; } }

Target:
private void applyNetworkChangesToHosts ( ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand < T > . SyncNetworkParametersBuilder builder = new SyncNetworkParametersBuilder ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) , getOldNetwork ( ) ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.NetworkParametersBuilder.updateParametersSequencing ( parameters ) ; runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , parameters ) ; } }
Source:
public void testObjectsEqual ( ) { java.lang.Integer ten = new java.lang.Integer ( 10 ) ; junit.framework.Assert.assertFalse ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( ten , new java.lang.Integer ( 20 ) ) ) ; junit.framework.Assert.assertTrue ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( ten , new java.lang.Integer ( 10 ) ) ) ; junit.framework.Assert.assertTrue ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( null , null ) ) ; junit.framework.Assert.assertFalse ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( ten , null ) ) ; junit.framework.Assert.assertFalse ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( null , ten ) ) ; }

Target:
public void testObjectsEqual ( ) { java.lang.Integer ten = java.lang.Integer.valueOf ( 10 ) ; junit.framework.Assert.assertFalse ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( ten , java.lang.Integer.valueOf ( 20 ) ) ) ; junit.framework.Assert.assertTrue ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( ten , java.lang.Integer.valueOf ( 10 ) ) ) ; junit.framework.Assert.assertTrue ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( null , null ) ) ; junit.framework.Assert.assertFalse ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( ten , null ) ) ; junit.framework.Assert.assertFalse ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( null , ten ) ) ; }
Source:
public void validateFailsForCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; mockIsGlusterEnabled ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; mockIsGlusterEnabled ( true ) ; mockCompatibilityVersion ( Version.v3_5 ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( ) , null ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; mockIsGlusterEnabled ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; mockIsGlusterEnabled ( true ) ; mockCompatibilityVersion ( Version.v3_5 ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void violationAppearsTwice ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic1 = createNic ( "nic0" , null ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic2 = createNic ( "nic1" , null ) ; mockExistingIfaces ( nic1 , nic2 ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic1 , nic1 , nic2 , nic2 ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_INTERFACES_ALREADY_SPECIFIED , nic1.getName ( ) , nic2.getName ( ) ) ; }

Target:
public void violationAppearsTwice ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic1 = createNic ( "nic0" , null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic2 = createNic ( "nic1" , null ) ; mockExistingIfaces ( nic1 , nic2 ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic1 , nic1 , nic2 , nic2 ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_INTERFACES_ALREADY_SPECIFIED , nic1.getName ( ) , nic2.getName ( ) ) ; }
Source:
protected boolean canDoAction ( ) { setGlusterVolumeId ( getGeoRepSession ( ) . getMasterVolumeId ( ) ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( getGeoRepSession ( ) . getStatus ( ) . equals ( GeoRepSessionStatus.ACTIVE ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GEOREP_SESSION_ALREADY_STARTED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( getGeoRepSession ( ) . getStatus ( ) . equals ( GeoRepSessionStatus.ACTIVE ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GEOREP_SESSION_ALREADY_STARTED ) ; } return true ; }
Source:
public void addParameter ( java.lang.String name , java.lang.String value ) { com.google.gwt.user.client.ui.Hidden hidden = new com.google.gwt.user.client.ui.Hidden ( name , value ) ; form.getElement ( ) . appendChild ( hidden.getElement ( ) ) ; java.util.List < com.google.gwt.user.client.ui.Hidden > oldHiddenList = hiddens.get ( name ) ; if ( oldHiddenList == null ) { hiddens.put ( name , new java.util.LinkedList < com.google.gwt.user.client.ui.Hidden > ( java.util.Collections.singletonList ( hidden ) ) ) ; } else { oldHiddenList.add ( hidden ) ; } }

Target:
public void addParameter ( java.lang.String name , java.lang.String value ) { com.google.gwt.user.client.ui.Hidden hidden = new com.google.gwt.user.client.ui.Hidden ( name , value ) ; form.getElement ( ) . appendChild ( hidden.getElement ( ) ) ; java.util.List < com.google.gwt.user.client.ui.Hidden > oldHiddenList = hiddens.get ( name ) ; if ( oldHiddenList == null ) { hiddens.put ( name , new java.util.LinkedList ( java.util.Collections.singletonList ( hidden ) ) ) ; } else { oldHiddenList.add ( hidden ) ; } }
Source:
protected void init ( ) { super . init ( ) ; if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) != null ) { needsHostDevices = hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) ; } loadVmInit ( ) ; fetchVmDisksFromDb ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterDisksBasedOnCinder ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) ; org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . setUseCinderCommandCallback ( ( ! ( cinderDisks.isEmpty ( ) ) ) ) ; }

Target:
protected void init ( ) { super . init ( ) ; if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) != null ) { needsHostDevices = hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) ; } loadVmInit ( ) ; fetchVmDisksFromDb ( ) ; }
Source:
public void testMemoryMapping ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( Guid.Empty ) ; vds.setPhysicalMemMb ( 4000 ) ; org.ovirt.engine.api.model.Host host = org.ovirt.engine.api.restapi.types.HostMapper.map ( vds , ( ( org.ovirt.engine.api.model.Host ) ( null ) ) ) ; assertNotNull ( host.getMemory ( ) ) ; assertEquals ( java.lang.Long.valueOf ( host.getMemory ( ) ) , java.lang.Long.valueOf ( 4194304000L ) ) ; }

Target:
public void testMemoryMapping ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( Guid.Empty ) ; vds.setPhysicalMemMb ( 4000 ) ; org.ovirt.engine.api.model.Host host = org.ovirt.engine.api.restapi.types.HostMapper.map ( vds , ( ( org.ovirt.engine.api.model.Host ) ( null ) ) ) ; assertNotNull ( host.getMemory ( ) ) ; assertEquals ( host.getMemory ( ) , java.lang.Long.valueOf ( 4194304000L ) ) ; }
Source:
public static void endTaskStep ( org.ovirt.engine.core.compat.Guid stepId , org.ovirt.engine.core.common.job.JobExecutionStatus exitStatus ) { try { if ( stepId != null ) { org.ovirt.engine.core.common.job.Step step = org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . getStep ( stepId.getValue ( ) ) ; if ( step != null ) { step.markStepEnded ( exitStatus ) ; org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . updateStep ( step ) ; } } } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.job.ExecutionHandler.log.errorFormat ( "Failed to terminate step {0} with status {1}" , stepId , exitStatus , e ) ; } }

Target:
public static void endTaskStep ( org.ovirt.engine.core.compat.Guid stepId , org.ovirt.engine.core.common.job.JobExecutionStatus exitStatus ) { try { if ( stepId != null ) { org.ovirt.engine.core.common.job.Step step = org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . getStep ( stepId ) ; if ( step != null ) { step.markStepEnded ( exitStatus ) ; org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . updateStep ( step ) ; } } } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.job.ExecutionHandler.log.errorFormat ( "Failed to terminate step {0} with status {1}" , stepId , exitStatus , e ) ; } }
Source:
protected void setUpFilteredQueryExpectations ( ) { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < > ( ) ; filterValue.add ( "true" ) ; org.easymock.EasyMock.reset ( httpHeaders ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.USER_FILTER_HEADER ) ) . andReturn ( filterValue ) ; }

Target:
protected void setUpFilteredQueryExpectations ( ) { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < > ( ) ; filterValue.add ( "true" ) ; org.mockito.Mockito.reset ( httpHeaders ) ; org.mockito.Mockito.when ( httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.USER_FILTER_HEADER ) ) . thenReturn ( filterValue ) ; }
Source:
public void onRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( T qos : sourceListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.action.QosParametersBase < T > parameter = new org.ovirt.engine.core.common.action.QosParametersBase < T > ( ) ; parameter.setQosId ( qos.getId ( ) ) ; parameters.add ( parameter ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( getRemoveActionType ( ) , parameters ) ; cancel ( ) ; }

Target:
public void onRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( T qos : sourceListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.action.QosParametersBase < T > parameter = new org.ovirt.engine.core.common.action.QosParametersBase ( ) ; parameter.setQosId ( qos.getId ( ) ) ; parameters.add ( parameter ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( getRemoveActionType ( ) , parameters ) ; cancel ( ) ; }
Source:
private void mockVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setStatus ( VMStatus.Down ) ; vm.setStoragePoolId ( org.ovirt.engine.core.bll.snapshots.RemoveSnapshotCommandTest.STORAGE_POOL_ID ) ; vm.setClusterCompatibilityVersion ( Version.v3_5 ) ; org.mockito.Mockito.doReturn ( vm ) . when ( cmd ) . getVm ( ) ; }

Target:
private void mockVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setStatus ( VMStatus.Down ) ; vm.setStoragePoolId ( org.ovirt.engine.core.bll.snapshots.RemoveSnapshotCommandTest.STORAGE_POOL_ID ) ; org.mockito.Mockito.doReturn ( vm ) . when ( cmd ) . getVm ( ) ; }
Source:
private static void setHookId ( org.ovirt.engine.api.model.Hook hook , java.lang.String hookName , java.lang.String eventName , java.lang.String md5 ) { org.ovirt.engine.core.compat.NGuid guid = org.ovirt.engine.api.restapi.types.HostMapper.generateHookId ( eventName , hookName , md5 ) ; hook.setId ( ( guid != null ? guid.toString ( ) : null ) ) ; }

Target:
private static void setHookId ( org.ovirt.engine.api.model.Hook hook , java.lang.String hookName , java.lang.String eventName , java.lang.String md5 ) { org.ovirt.engine.core.compat.NGuid guid = org.ovirt.engine.api.restapi.types.HostMapper.generateHookId ( eventName , hookName , md5 ) ; hook.setId ( guid.toString ( ) ) ; }
Source:
private static void mockVerifyAddVM ( org.ovirt.engine.core.bll.AddVmCommand < ? > cmd ) { org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . verifyAddVM ( org.mockito.Matchers.anyListOf ( java.lang.String.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anyInt ( ) ) ; }

Target:
private static void mockVerifyAddVM ( org.ovirt.engine.core.bll.AddVmCommand < ? > cmd ) { org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . verifyAddVM ( org.mockito.Matchers.anyListOf ( java.lang.String.class ) , org.mockito.Matchers.anyInt ( ) ) ; }
Source:
public static void GetClusterNetworkList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters ( clusterId ) , aQuery ) ; }

Target:
public static void GetClusterNetworkList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters ( clusterId ) , aQuery ) ; }
Source:
public void insufficientDiskSpace ( ) { final int lotsOfSpaceRequired = 1073741824 ; final int pctOfSpaceRequired = 0 ; final org.ovirt.engine.core.bll.ImportVmTemplateCommand c = setupDiskSpaceTest ( lotsOfSpaceRequired , pctOfSpaceRequired ) ; org.junit.Assert.assertFalse ( c.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( c.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW.toString ( ) ) ) ; }

Target:
public void insufficientDiskSpace ( ) { final int lotsOfSpaceRequired = 1073741824 ; final org.ovirt.engine.core.bll.ImportVmTemplateCommand c = setupDiskSpaceTest ( lotsOfSpaceRequired ) ; org.junit.Assert.assertFalse ( c.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( c.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW.toString ( ) ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > getLogicalUnits ( ) { boolean reportStatus = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendHostStorageResource.REPORT_STATUS , true , true ) ; return getBackendCollection ( VdcQueryType.GetDeviceList , new org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters ( asGuid ( hostId ) , org.ovirt.engine.core.common.businessentities.storage.StorageType.UNKNOWN , reportStatus , null ) ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > getLogicalUnits ( ) { boolean reportStatus = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendHostStorageResource.REPORT_STATUS , true , true ) ; org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters params = new org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters ( asGuid ( hostId ) , org.ovirt.engine.core.common.businessentities.storage.StorageType.UNKNOWN , reportStatus , null , true ) ; return getBackendCollection ( VdcQueryType.GetDeviceList , params ) ; }
Source:
private org.ovirt.engine.core.common.interfaces.IVdcUser getCurrentUser ( ) { java.lang.String sessionId = org.ovirt.engine.core.bll.GetRolesForDelegationByUserQuery.getParameters ( ) . getSessionId ( ) ; org.ovirt.engine.core.common.interfaces.IVdcUser user = null ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( sessionId ) ) ) { user = org.ovirt.engine.core.bll.session.SessionDataContainer.getInstance ( ) . getUser ( sessionId ) ; } return user ; }

Target:
private org.ovirt.engine.core.common.interfaces.IVdcUser getCurrentUser ( ) { java.lang.String sessionId = org.ovirt.engine.core.bll.GetRolesForDelegationByUserQuery.getParameters ( ) . getSessionId ( ) ; org.ovirt.engine.core.common.interfaces.IVdcUser user = null ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( sessionId ) ) ) { user = org.ovirt.engine.core.bll.session.SessionDataContainer.getInstance ( ) . getUser ( sessionId , false ) ; } return user ; }
Source:
protected void changeStorageDomainStatusInTransaction ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = getStoragePoolIsoMap ( domain ) ; org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; context.snapshotEntityStatus ( map , map.getstatus ( ) ) ; updateStatus ( map , status ) ; getCompensationContext ( ) . stateChanged ( ) ; } return null ; } } ) ; }

Target:
protected void changeStorageDomainStatusInTransaction ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { for ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map : getStoragePoolIsoMap ( domain ) ) { context.snapshotEntityStatus ( map , map.getstatus ( ) ) ; updateStatus ( map , status ) ; } } getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; }
Source:
protected void afterUpdate ( ) { boolean newSizeUnderCurrentConsumption = getQuotaManager ( ) . isStorageQuotaExceeded ( getQuota ( ) . getId ( ) ) ; if ( newSizeUnderCurrentConsumption ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "QuotaName" , getQuotaName ( ) ) ; auditLogDirector.log ( logable , AuditLogType.QUOTA_STORAGE_RESIZE_LOWER_THEN_CONSUMPTION ) ; } }

Target:
protected void afterUpdate ( ) { boolean newSizeUnderCurrentConsumption = getQuotaManager ( ) . isStorageQuotaExceeded ( getQuota ( ) . getId ( ) ) ; if ( newSizeUnderCurrentConsumption ) { auditLogDirector.log ( this , AuditLogType.QUOTA_STORAGE_RESIZE_LOWER_THEN_CONSUMPTION ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = getStoragePoolIsoMap ( domain ) ; org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; context.snapshotEntityStatus ( map , map.getstatus ( ) ) ; updateStatus ( map , status ) ; getCompensationContext ( ) . stateChanged ( ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { for ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map : getStoragePoolIsoMap ( domain ) ) { context.snapshotEntityStatus ( map , map.getstatus ( ) ) ; updateStatus ( map , status ) ; } } getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
protected void init ( T parameters ) { super . init ( parameters ) ; setVmTemplateId ( parameters.getContainerId ( ) ) ; parameters.setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.VmTemplate , org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ) ; imageToDestinationDomainMap = org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getParameters ( ) . getImageToDestinationDomainMap ( ) ; imageFromSourceDomainMap = new java.util.HashMap < > ( ) ; }

Target:
public void init ( ) { super . init ( ) ; setVmTemplateId ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getParameters ( ) . getContainerId ( ) ) ; org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getParameters ( ) . setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.VmTemplate , org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ) ; imageToDestinationDomainMap = org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getParameters ( ) . getImageToDestinationDomainMap ( ) ; imageFromSourceDomainMap = new java.util.HashMap < > ( ) ; }
Source:
public static < TSource > TSource firstOrDefault ( java.lang.Iterable < TSource > source , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < ? super TSource > predicate , TSource defaultValue ) { for ( TSource item : source ) { if ( predicate.match ( item ) ) { return item ; } } return defaultValue ; }

Target:
public static < TSource > TSource firstOrDefault ( java.lang.Iterable < TSource > source , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < ? super TSource > predicate , TSource defaultValue ) { if ( source != null ) { for ( TSource item : source ) { if ( predicate.match ( item ) ) { return item ; } } } return defaultValue ; }
Source:
public static java.util.Collection < org.ovirt.engine.core.aaa.DirectoryUser > mapPrincipalRecordsToDirectoryUsers ( final java.lang.String authzName , final java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > users ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.extensions.ExtMap user : users ) { results.add ( org.ovirt.engine.core.bll.aaa.DirectoryUtils.mapPrincipalRecordToDirectoryUser ( authzName , user ) ) ; } return results ; }

Target:
public java.util.Collection < org.ovirt.engine.core.aaa.DirectoryUser > mapPrincipalRecordsToDirectoryUsers ( final java.lang.String authzName , final java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > users ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.extensions.ExtMap user : users ) { results.add ( mapPrincipalRecordToDirectoryUser ( authzName , user ) ) ; } return results ; }
Source:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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 ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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 ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public synchronized void _timer_Elapsed ( ) { if ( thereAreTasksToPoll ( ) ) { pollAndUpdateAsyncTasks ( ) ; if ( ( thereAreTasksToPoll ( ) ) && ( logChangedMap ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Finished polling Tasks, will poll again in {0} seconds." , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.AsyncTaskPollingRate ) ) ; logChangedMap = false ; } if ( ( _tasks.size ( ) ) > 0 ) { cleanZombieTasks ( ) ; } } }

Target:
public synchronized void _timer_Elapsed ( ) { if ( thereAreTasksToPoll ( ) ) { pollAndUpdateAsyncTasks ( ) ; if ( ( thereAreTasksToPoll ( ) ) && ( logChangedMap ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Finished polling Tasks, will poll again in {0} seconds." , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AsyncTaskPollingRate ) ) ; logChangedMap = false ; } if ( ( _tasks.size ( ) ) > 0 ) { cleanZombieTasks ( ) ; } } }