auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void createStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setStatus ( status ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.when ( storageDomainDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; org.mockito.Mockito.when ( storageDomainDAO.getForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; }

Target:
private void createStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setStatus ( status ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( storageDomainDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; org.mockito.Mockito.when ( storageDomainDAO.getForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; }
Source:
protected void releaseMonitorLock ( org.ovirt.engine.core.utils.lock.EngineLock monitoringLock , java.lang.String commandName ) { org.ovirt.engine.core.bll.VdsCommand.getLockManager ( ) . releaseLock ( monitoringLock ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.VdsCommand.getVds ( ) ; log.infoFormat ( ( commandName + " finished. Lock released. Monitoring can run now for host {0} from data-center {1}" ) , vds.getName ( ) , vds.getStoragePoolName ( ) ) ; }

Target:
protected void logMonitorLockReleased ( java.lang.String commandName ) { final org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.VdsCommand.getVds ( ) ; log.infoFormat ( ( commandName + " finished. Lock released. Monitoring can run now for host {0} from data-center {1}" ) , vds.getName ( ) , vds.getStoragePoolName ( ) ) ; }
Source:
public static < T > java.util.ArrayList < T > Intersection ( java.util.ArrayList < java.util.ArrayList < T > > lists ) { java.util.ArrayList < T > result = new java.util.ArrayList < T > ( ) ; if ( ( lists != null ) && ( ! ( lists.isEmpty ( ) ) ) ) { result.addAll ( lists.get ( 0 ) ) ; for ( java.util.ArrayList < T > list : lists ) { result.retainAll ( list ) ; } } return result ; }

Target:
public static < T > java.util.ArrayList < T > intersection ( java.util.ArrayList < java.util.ArrayList < T > > lists ) { java.util.ArrayList < T > result = new java.util.ArrayList < T > ( ) ; if ( ( lists != null ) && ( ! ( lists.isEmpty ( ) ) ) ) { result.addAll ( lists.get ( 0 ) ) ; for ( java.util.ArrayList < T > list : lists ) { result.retainAll ( list ) ; } } return result ; }
Source:
private void SetSearchStringPage ( int newSearchPageNumber ) { if ( org.ovirt.engine.core.compat.Regex.IsMatch ( getSearchString ( ) , org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.PAGE_STRING_REGEX , RegexOptions.IgnoreCase ) ) { setSearchString ( org.ovirt.engine.core.compat.Regex.replace ( getSearchString ( ) , org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.PAGE_STRING_REGEX , ( " page " + newSearchPageNumber ) ) ) ; } else { setSearchString ( ( ( ( getSearchString ( ) ) + " page " ) + newSearchPageNumber ) ) ; } }

Target:
private void setSearchStringPage ( int newSearchPageNumber ) { if ( org.ovirt.engine.core.compat.Regex.IsMatch ( getSearchString ( ) , org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.PAGE_STRING_REGEX , RegexOptions.IgnoreCase ) ) { setSearchString ( org.ovirt.engine.core.compat.Regex.replace ( getSearchString ( ) , org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.PAGE_STRING_REGEX , ( " page " + newSearchPageNumber ) ) ) ; } else { setSearchString ( ( ( ( getSearchString ( ) ) + " page " ) + newSearchPageNumber ) ) ; } }
Source:
public void diskInterfaceNotSupportedByOs ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; vm.setVmOs ( 2 ) ; initializeOsRepository ( vm.getOs ( ) , DiskInterface.VirtIO ) ; org.junit.Assert.assertThat ( validator.isDiskInterfaceSupported ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; }

Target:
public void diskInterfaceNotSupportedByOs ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; vm.setVmOs ( 2 ) ; initializeOsRepository ( vm.getOs ( ) , DiskInterface.VirtIO ) ; org.junit.Assert.assertThat ( validator.isDiskInterfaceSupported ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; }
Source:
public void testAddExistingBlockDomainSuccessfully ( ) { org.mockito.Mockito.when ( command.getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ) . thenReturn ( getLUNs ( ) ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getSucceeded ( ) ) ; }

Target:
public void testAddExistingBlockDomainSuccessfully ( ) { org.mockito.Mockito.when ( command.getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getSucceeded ( ) ) ; }
Source:
public void addToCallbackMap ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { if ( ! ( cmdCallbackMap.containsKey ( cmdEntity.getId ( ) ) ) ) { org.ovirt.engine.core.bll.CommandBase < ? > cmd = coco.retrieveCommand ( cmdEntity.getId ( ) ) ; if ( ( cmd != null ) && ( ( cmd.getCallback ( ) ) != null ) ) { cmdCallbackMap.put ( cmdEntity.getId ( ) , cmd.getCallback ( ) ) ; } } }

Target:
public void addToCallbackMap ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { if ( ! ( cmdCallbackMap.containsKey ( cmdEntity.getId ( ) ) ) ) { org.ovirt.engine.core.bll.CommandBase < ? > cmd = coco.retrieveCommand ( cmdEntity.getId ( ) ) ; if ( ( cmd != null ) && ( ( cmd.getCallback ( ) ) != null ) ) { cmdCallbackMap.put ( cmdEntity.getId ( ) , new org.ovirt.engine.core.bll.tasks.CommandExecutor.CommandContainer ( cmd.getCallback ( ) , pollingRate ) ) ; } } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Role > getAllForUserAndGroups ( org.ovirt.engine.core.compat.Guid id , java.lang.String groupIds , int appMode ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "user_id" , id ) . addValue ( "group_ids" , groupIds ) . addValue ( "app_mode" , appMode ) ; return getCallsHandler ( ) . executeReadList ( "GetAllRolesByUserIdAndGroupIds" , org.ovirt.engine.core.dao.RoleDAODbFacadeImpl.RolesRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Role > getAnyAdminRoleForUserAndGroups ( org.ovirt.engine.core.compat.Guid id , java.lang.String groupIds , int appMode ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "user_id" , id ) . addValue ( "group_ids" , groupIds ) . addValue ( "app_mode" , appMode ) ; return getCallsHandler ( ) . executeReadList ( "GetAnyAdminRoleByUserIdAndGroupIds" , org.ovirt.engine.core.dao.RoleDAODbFacadeImpl.RolesRowMapper.instance , parameterSource ) ; }
Source:
public void validateFailsOnNullHookId ( ) { setupMocks ( ) ; cmd.getParameters ( ) . setHookId ( null ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }

Target:
public void validateFailsOnNullHookId ( ) { setupMocks ( ) ; cmd.getParameters ( ) . setHookId ( null ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validate ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }
Source:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > > aQuery , org.ovirt.engine.core.compat.Guid networkId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.network.VmNetworkStatistics stats ) { return createIdParameterMapper ( stats.getId ( ) ) . addValue ( "rx_drop" , stats.getReceiveDropRate ( ) ) . addValue ( "rx_rate" , stats.getReceiveRate ( ) ) . addValue ( "tx_drop" , stats.getTransmitDropRate ( ) ) . addValue ( "tx_rate" , stats.getTransmitRate ( ) ) . addValue ( "iface_status" , stats.getStatus ( ) ) . addValue ( "vm_id" , stats.getVmId ( ) ) ; }

Target:
protected org.springframework.jdbc.core.RowMapper < org.ovirt.engine.core.common.businessentities.network.VmNetworkStatistics > createEntityRowMapper ( ) { return org.ovirt.engine.core.dao.network.VmNetworkStatisticsDaoDbFacadeImpl.VmNetworkStatisticsRowMapper.INSTANCE ; }
Source:
public void qosBondSpeedZero ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosBondSpeedSetup ( 0 , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
private void mockCalculateBaseNicWhenVlanNicIsPassed ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseNic , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanNic ) { org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( org.mockito.Matchers.eq ( vlanNic ) ) ) . thenReturn ( baseNic ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( org.mockito.Matchers.eq ( vlanNic ) , org.mockito.Matchers.any ( java.util.Map.class ) ) ) . thenReturn ( baseNic ) ; }
Source:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue runPublicQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase params ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: runPublicQuery invoked! '{}'" , queryType ) ; if ( ( params.getCorrelationId ( ) ) == null ) { params.setCorrelationId ( org.ovirt.engine.core.utils.CorrelationIdTracker.getCorrelationId ( ) ) ; } debugQuery ( queryType , params ) ; return getBackend ( ) . runPublicQuery ( queryType , params ) ; }

Target:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue runPublicQuery ( org.ovirt.engine.core.common.queries.QueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase params ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: runPublicQuery invoked! '{}'" , queryType ) ; if ( ( params.getCorrelationId ( ) ) == null ) { params.setCorrelationId ( org.ovirt.engine.core.utils.CorrelationIdTracker.getCorrelationId ( ) ) ; } debugQuery ( queryType , params ) ; return getBackend ( ) . runPublicQuery ( queryType , params ) ; }
Source:
private static java.lang.String decrypt ( java.lang.String source , java.security.Key key ) throws java.io.UnsupportedEncodingException , java.security.InvalidKeyException , java.security.NoSuchAlgorithmException , javax.crypto.BadPaddingException , javax.crypto.IllegalBlockSizeException , javax.crypto.NoSuchPaddingException { javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( org.ovirt.engine.core.utils.crypt.EncryptionUtils.algo ) ; rsa.init ( javax.crypto.Cipher.DECRYPT_MODE , key ) ; return new java.lang.String ( rsa.doFinal ( org.apache.commons.codec.binary.Base64.decodeBase64 ( source ) ) , "UTF-8" ) ; }

Target:
private static java.lang.String decrypt ( java.lang.String source , java.security.Key key ) throws java.security.InvalidKeyException , java.security.NoSuchAlgorithmException , javax.crypto.BadPaddingException , javax.crypto.IllegalBlockSizeException , javax.crypto.NoSuchPaddingException { javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( org.ovirt.engine.core.utils.crypt.EncryptionUtils.algo ) ; rsa.init ( javax.crypto.Cipher.DECRYPT_MODE , key ) ; return new java.lang.String ( rsa.doFinal ( org.apache.commons.codec.binary.Base64.decodeBase64 ( source ) ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) ; }
Source:
private static void flatGroups ( org.ovirt.engine.api.extensions.ExtMap entity , org.ovirt.engine.api.extensions.ExtKey key , java.util.List < java.lang.String > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : entity.< java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > > get ( key , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { if ( ! ( accumulator.contains ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ) ) { accumulator.add ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.flatGroups ( group , Authz.GroupRecord.GROUPS , accumulator ) ; } } }

Target:
private static void flatGroups ( org.ovirt.engine.api.extensions.ExtMap entity , org.ovirt.engine.api.extensions.ExtKey key , java.util.Map < java.lang.String , org.ovirt.engine.api.extensions.ExtMap > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : entity.< java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > > get ( key , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { if ( ! ( accumulator.containsKey ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ) ) { accumulator.put ( group.get ( Authz.GroupRecord.ID ) , group ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.flatGroups ( group , Authz.GroupRecord.GROUPS , accumulator ) ; } } }
Source:
public static void GetCustomPropertiesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.HashMap < org.ovirt.engine.core.compat.Version , java.lang.String > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmCustomProperties , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void GetTemplateById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ) ( source ) ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo cifsOption = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo ( ) ; cifsOption.setKey ( "user.cifs" ) ; list.add ( cifsOption ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > GetWindowsOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmOsType type : org.ovirt.engine.core.common.businessentities.VmOsType.values ( ) ) { if ( type.isWindows ( ) ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes.add ( type ) ; } } return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; }
Source:
public java.util.Date parse ( java.lang.CharSequence text ) throws java.text.ParseException { if ( ( text == null ) || ( text.toString ( ) . isEmpty ( ) ) ) { return null ; } else { return new java.util.Date ( java.util.Date.parse ( text.toString ( ) ) ) ; } }

Target:
private org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabelEditor < java.util.Date > getInstanceOfDateEditor ( ) { return new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabelEditor < java.util.Date > ( new com.google.gwt.text.shared.AbstractRenderer < java.util.Date > ( ) { @ java.lang.Override public java.lang.String render ( java.util.Date entity ) { if ( entity == null ) { return constants.unAvailablePropertyLabel ( ) ; } return org.ovirt.engine.ui.common.widget.renderer.GlusterRebalanceDateTimeRenderer.getLocalizedDateTimeFormat ( ) . format ( entity ) ; } } ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.network.Network network ) { return network.getName ( ) . equals ( getNetworkName ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network getNetworkByName ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { java.lang.String networkName = org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetworkName ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : networks ) { if ( network.getName ( ) . equals ( networkName ) ) { return network ; } } return null ; }
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.RunQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , 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.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void Cluster_SelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.Cluster_SelectedItemChanged ( ) ; }

Target:
private void dataCenter_SelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenter_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) ; if ( dataCenter != null ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; } }
Source:
public void testGetNetworkNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; java.util.List < org.ovirt.engine.api.restapi.resource.Network > entities = new java.util.ArrayList < > ( ) ; setUpEntityQueryExpectations ( QueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , entities ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNetworkNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; java.util.List < org.ovirt.engine.api.restapi.resource.Network > entities = new java.util.ArrayList < > ( ) ; setUpEntityQueryExpectations ( QueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , entities ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private static void flatGroups ( java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > groupIds , java.util.List < java.lang.String > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : groupIds ) { if ( ! ( accumulator.contains ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ) ) { accumulator.add ( group.get ( Authz.GroupRecord.ID ) ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.flatGroups ( group , Authz.GroupRecord.GROUPS , accumulator ) ; } } }

Target:
private static void flatGroups ( org.ovirt.engine.api.extensions.ExtMap entity , org.ovirt.engine.api.extensions.ExtKey key , java.util.Map < java.lang.String , org.ovirt.engine.api.extensions.ExtMap > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : entity.< java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > > get ( key , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { if ( ! ( accumulator.containsKey ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ) ) { accumulator.put ( group.get ( Authz.GroupRecord.ID ) , group ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.flatGroups ( group , Authz.GroupRecord.GROUPS , accumulator ) ; } } }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( storage_pool_idField ) == null ? 0 : storage_pool_idField.hashCode ( ) ) ; result = ( prime * result ) + ( ( vds_idField ) == null ? 0 : vds_idField.hashCode ( ) ) ; result = ( prime * result ) + ( vds_spm_idField ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( storage_pool_idField , vds_idField , vds_spm_idField ) ; }
Source:
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 ) ; }

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:
private boolean validateInputManagementNetwork ( ) { managementNetwork = getManagementNetworkById ( ) ; if ( ( managementNetwork ) == null ) { addValidationMessage ( EngineMessage.NETWORK_NOT_EXISTS ) ; return false ; } final org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase networkClusterValidator = createNetworkClusterValidator ( ) ; return ( ( validate ( networkClusterValidator.networkBelongsToClusterDataCenter ( org.ovirt.engine.core.bll.AddClusterCommand.getCluster ( ) , managementNetwork ) ) ) && ( validate ( networkClusterValidator.managementNetworkRequired ( managementNetwork ) ) ) ) && ( validate ( networkClusterValidator.managementNetworkNotExternal ( managementNetwork ) ) ) ; }

Target:
private boolean validateInputManagementNetwork ( ) { setManagementNetwork ( getManagementNetworkById ( ) ) ; if ( ( getManagementNetwork ( ) ) == null ) { addValidationMessage ( EngineMessage.NETWORK_NOT_EXISTS ) ; return false ; } final org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase networkClusterValidator = createNetworkClusterValidator ( ) ; return ( ( validate ( networkClusterValidator.networkBelongsToClusterDataCenter ( org.ovirt.engine.core.bll.AddClusterCommand.getCluster ( ) , getManagementNetwork ( ) ) ) ) && ( validate ( networkClusterValidator.managementNetworkRequired ( getManagementNetwork ( ) ) ) ) ) && ( validate ( networkClusterValidator.managementNetworkNotExternal ( getManagementNetwork ( ) ) ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getDbFacade ( ) . getVmDeviceDao ( ) . removeAll ( removedDeviceIds ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmGuestAgentNics.keySet ( ) ) { getDbFacade ( ) . getVmGuestAgentInterfaceDao ( ) . removeAllForVm ( vmId ) ; } for ( java.util.List < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > nics : vmGuestAgentNics.values ( ) ) { if ( nics != null ) { for ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface nic : nics ) { getDbFacade ( ) . getVmGuestAgentInterfaceDao ( ) . save ( nic ) ; } } } return null ; }
Source:
private static boolean IsLegalStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { boolean result ; switch ( status ) { case Down : case InstallFailed : case Maintenance : case NonOperational : case NonResponsive : case Reboot : case Installing : case Connecting : result = true ; break ; default : result = false ; break ; } return result ; }

Target:
private static boolean IsLegalStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { boolean result ; switch ( status ) { case Down : case InstallFailed : case Maintenance : case NonOperational : case NonResponsive : case Reboot : case Installing : case Connecting : case Kdumping : result = true ; break ; default : result = false ; break ; } return result ; }
Source:
protected boolean canDoAction ( ) { boolean returnValue = true ; if ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getNewParentId ( ) . equals ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getTagId ( ) ) ) { addCanDoActionMessage ( EngineMessage.TAGS_SPECIFIED_TAG_CANNOT_BE_THE_PARENT_OF_ITSELF ) ; returnValue = false ; } if ( org.ovirt.engine.core.bll.TagsDirector.getInstance ( ) . isTagDescestorOfTag ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getTagId ( ) , org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getNewParentId ( ) ) ) { addCanDoActionMessage ( EngineMessage.TAGS_SPECIFIED_TAG_CANNOT_BE_THE_PARENT_OF_ITSELF ) ; returnValue = false ; } return returnValue ; }

Target:
protected boolean validate ( ) { boolean returnValue = true ; if ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getNewParentId ( ) . equals ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getTagId ( ) ) ) { addValidationMessage ( EngineMessage.TAGS_SPECIFIED_TAG_CANNOT_BE_THE_PARENT_OF_ITSELF ) ; returnValue = false ; } if ( org.ovirt.engine.core.bll.TagsDirector.getInstance ( ) . isTagDescestorOfTag ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getTagId ( ) , org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getNewParentId ( ) ) ) { addValidationMessage ( EngineMessage.TAGS_SPECIFIED_TAG_CANNOT_BE_THE_PARENT_OF_ITSELF ) ; returnValue = false ; } return returnValue ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddClusterCommand.getCluster ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , org.ovirt.engine.core.bll.AddClusterCommand.getActionType ( ) . getActionGroup ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Arrays.asList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddClusterCommand.getCluster ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , org.ovirt.engine.core.bll.AddClusterCommand.getActionType ( ) . getActionGroup ( ) ) , new org.ovirt.engine.core.bll.utils.PermissionSubject ( calculateMacPoolIdToUse ( ) , org.ovirt.engine.core.common.VdcObjectType.MacPool , org.ovirt.engine.core.common.businessentities.ActionGroup.CONFIGURE_MAC_POOL ) ) ; }
Source:
public static void getMaximalVmMemSize64OS ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : - 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void initDefaultOSes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.defaultOSes = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDefaultOSes ) , callback ) ; }
Source:
private void canDoActionUpdateDescription ( org.ovirt.engine.core.common.businessentities.VMStatus status ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = createDiskImage ( ) ; disk.setReadOnly ( false ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.getDiskInfo ( ) . setReadOnly ( false ) ; disk.setDescription ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; initializeCommand ( parameters , java.util.Collections.singletonList ( createVm ( status ) ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
private void validateUpdateDescription ( org.ovirt.engine.core.common.businessentities.VMStatus status ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = createDiskImage ( ) ; disk.setReadOnly ( false ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.getDiskInfo ( ) . setReadOnly ( false ) ; disk.setDescription ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; initializeCommand ( parameters , java.util.Collections.singletonList ( createVm ( status ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
private void doTestNetworkIpAddressWasSameAsHostnameAndChangedForBootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol bootProtocol ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( bootProtocol , null , null ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( attachment ) ; org.ovirt.engine.core.bll.ValidationResult actual = validator.networkIpAddressWasSameAsHostnameAndChanged ( null ) ; org.junit.Assert.assertThat ( actual , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
private void doTestNetworkIpAddressWasSameAsHostnameAndChangedForBootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol bootProtocol ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( bootProtocol , null , null ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( attachment ) ; org.ovirt.engine.core.bll.ValidationResult actual = validator.networkIpAddressWasSameAsHostnameAndChanged ( null ) ; org.junit.Assert.assertThat ( actual , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public static void getExternalProviderComputeResourceList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalComputeResource > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetComputeResourceFromExternalProvider , params , aQuery ) ; }
Source:
private void endVmRelatedOps ( ) { org.ovirt.engine.core.bll.ImportVmCommand.setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( getVm ( ) ) ; } else { org.ovirt.engine.core.bll.ImportVmCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "VM is null, not performing full endAction" ) ; } }

Target:
protected void endSuccessfully ( ) { checkTrustedService ( ) ; endActionOnAllImageGroups ( ) ; org.ovirt.engine.core.bll.VmHandler.unLockVm ( getVm ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.setSucceeded ( true ) ; }
Source:
public void testConnectionWithValidMountOptionsSucceeds ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.NFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( getCommand ( ) ) . validateMountOptions ( ) ; org.mockito.Mockito.when ( getCommand ( ) . getStorageConnDao ( ) . get ( newPosixConnection.getId ( ) ) ) . thenReturn ( newPosixConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( getCommand ( ) ) ; }

Target:
public void testConnectionWithValidMountOptionsSucceeds ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.NFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( getCommand ( ) ) . validateMountOptions ( ) ; org.mockito.Mockito.when ( getCommand ( ) . getStorageConnDao ( ) . get ( newPosixConnection.getId ( ) ) ) . thenReturn ( newPosixConnection ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( getCommand ( ) ) ; }
Source:
public void testScoreForMemoryLoad ( ) throws java.lang.Exception { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > > cache = newCache ( ) ; final java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VDS > hosts = loadHosts ( "basic_power_saving_hosts_mem_load.csv" , cache ) ; final java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > vms = loadVMs ( "basic_power_saving_vms.csv" , cache ) ; testScore ( evenDistributionMemoryWeightPolicyUnit , hosts , vms , org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionWeightPolicyUnitTest.DESTINATION_HOST ) ; }

Target:
public void testScoreForMemoryLoad ( ) throws java.lang.Exception { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > > cache = newCache ( ) ; final java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VDS > hosts = loadHosts ( "basic_balancing_hosts_mem_load.csv" , cache ) ; final java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > vms = loadVMs ( "basic_balancing_vms.csv" , cache ) ; testScore ( evenDistributionMemoryWeightPolicyUnit , hosts , vms , org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionWeightPolicyUnitTest.DESTINATION_HOST ) ; }
Source:
public static org.ovirt.engine.api.model.Permit map ( org.ovirt.engine.api.model.PermitType entity , org.ovirt.engine.api.model.Permit template ) { org.ovirt.engine.api.model.Permit model = new org.ovirt.engine.api.model.Permit ( ) ; model.setName ( entity.value ( ) ) ; model.setId ( java.lang.String.valueOf ( entity.getId ( ) ) ) ; model.setAdministrative ( ( ( entity.getRole ( ) ) == ( org.ovirt.engine.api.model.RoleType.ADMIN ) ) ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.Permit map ( org.ovirt.engine.api.model.PermitType entity , org.ovirt.engine.api.model.Permit template ) { org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup = org.ovirt.engine.api.restapi.types.PermitMapper.map ( entity , ( ( org.ovirt.engine.core.common.businessentities.ActionGroup ) ( null ) ) ) ; return org.ovirt.engine.api.restapi.types.PermitMapper.map ( actionGroup , ( ( org.ovirt.engine.api.model.Permit ) ( null ) ) ) ; }
Source:
protected void detachUserFromVmFromPool ( ) { if ( ! ( Guid.Empty.equals ( getAdUserId ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.Permissions perm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . getForRoleAndAdElementAndObject ( PredefinedRoles.ENGINE_USER.getId ( ) , getAdUserId ( ) , getVmId ( ) ) ; if ( perm != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . remove ( perm.getId ( ) ) ; } } }

Target:
protected void detachUserFromVmFromPool ( ) { if ( ! ( Guid.Empty.equals ( getAdUserId ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.Permission perm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . getForRoleAndAdElementAndObject ( PredefinedRoles.ENGINE_USER.getId ( ) , getAdUserId ( ) , getVmId ( ) ) ; if ( perm != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . remove ( perm.getId ( ) ) ; } } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filterClustersWithoutArchitecture ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredClusters = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( ( cluster.getArchitecture ( ) ) != ( org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ) ) { filteredClusters.add ( cluster ) ; } } return filteredClusters ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > filterClustersWithoutArchitecture ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > filteredClusters = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : clusters ) { if ( ( cluster.getArchitecture ( ) ) != ( org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ) ) { filteredClusters.add ( cluster ) ; } } return filteredClusters ; }
Source:
public void Cluster_SelectedItemChanged ( ) { UpdateDefaultHost ( ) ; UpdateCustomProperties ( ) ; UpdateMinAllocatedMemory ( ) ; UpdateNumOfSockets ( ) ; if ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } }

Target:
public void Cluster_SelectedItemChanged ( ) { UpdateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; UpdateMinAllocatedMemory ( ) ; UpdateNumOfSockets ( ) ; if ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } }
Source:
public static void isTemplateNameUnique ( 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 ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }