auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > createNicNameToNetworkTypesMap ( ) { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypes = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : attachmentsToConfigure ) { org.ovirt.engine.core.common.businessentities.network.Network networkToConfigure = networkBusinessEntityMap.get ( attachment.getNetworkId ( ) ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType networkType = determineNetworkType ( networkToConfigure ) ; getNetworkTypesList ( nicNameToNetworkTypes , attachment.getNicName ( ) ) . add ( networkType ) ; } return nicNameToNetworkTypes ; }

Target:
public java.util.List < java.lang.String > findViolatedNics ( java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypesMap ) { java.util.List < java.lang.String > violatedNics = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypes : nicNameToNetworkTypesMap.entrySet ( ) ) { java.lang.String nicName = nicNameToNetworkTypes.getKey ( ) ; java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > networkTypes = nicNameToNetworkTypes.getValue ( ) ; if ( ! ( validateNetworkTypesOnNic ( networkTypes ) ) ) { violatedNics.add ( nicName ) ; } } return violatedNics ; }
Source:
private org.ovirt.engine.core.bll.context.CommandContext createCommandContext ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity option ) { org.ovirt.engine.core.common.job.Step setOptionStep = addSubStep ( StepEnum.EXECUTING , StepEnum.SETTING_GLUSTER_OPTION , getOptionValues ( volume , option ) ) ; org.ovirt.engine.core.bll.job.ExecutionContext setOptionCtx = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; setOptionCtx.setMonitored ( true ) ; setOptionCtx.setStep ( setOptionStep ) ; return dupContext ( ) . withExecutionContext ( setOptionCtx ) . withoutLock ( ) ; }

Target:
private org.ovirt.engine.core.bll.context.CommandContext createCommandContext ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity option ) { org.ovirt.engine.core.common.job.Step setOptionStep = addSubStep ( StepEnum.EXECUTING , StepEnum.SETTING_GLUSTER_OPTION , getOptionValues ( volume , option ) ) ; org.ovirt.engine.core.bll.job.ExecutionContext setOptionCtx = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; setOptionCtx.setMonitored ( true ) ; setOptionCtx.setStep ( setOptionStep ) ; return cloneContext ( ) . withExecutionContext ( setOptionCtx ) . withoutLock ( ) ; }
Source:
public static void GetMaxSpmPriority ( 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 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public static void getStorageDomainMaxNameLength ( 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 ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.List < java.lang.String > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.List < java.lang.String > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; }
Source:
protected boolean canDoAction ( ) { java.util.List < java.lang.String > canDoMessages = org.ovirt.engine.core.bll.AttachActionGroupsToRoleCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ; if ( org.ovirt.engine.core.bll.AttachActionGroupsToRoleCommand.checkIfRoleIsReadOnly ( canDoMessages ) ) { canDoMessages.add ( VdcBllMessages.VAR__TYPE__ROLE.toString ( ) ) ; canDoMessages.add ( VdcBllMessages.VAR__ACTION__ATTACH_ACTION_TO.toString ( ) ) ; return false ; } if ( checkIfGroupsCanBeAttached ( canDoMessages ) ) { return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { java.util.List < java.lang.String > canDoMessages = org.ovirt.engine.core.bll.AttachActionGroupsToRoleCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ; if ( org.ovirt.engine.core.bll.AttachActionGroupsToRoleCommand.checkIfRoleIsReadOnly ( canDoMessages ) ) { canDoMessages.add ( EngineMessage.VAR__TYPE__ROLE.toString ( ) ) ; canDoMessages.add ( EngineMessage.VAR__ACTION__ATTACH_ACTION_TO.toString ( ) ) ; return false ; } if ( checkIfGroupsCanBeAttached ( canDoMessages ) ) { return false ; } return true ; }
Source:
public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.aaa.DbUser > getUsers ( ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.aaa.DbUser > users = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user : lookupUsers ( ) ) { users.put ( user.getId ( ) , user ) ; } return users ; }

Target:
public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.aaa.DbUser > getUsers ( ) { return lookupUsers ( ) . stream ( ) . collect ( java.util.stream.Collectors.toMap ( DbUser :: getId , java.util.function.Function.identity ( ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult diskProfileNameNotUsed ( ) { for ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile profile : getDiskProfiles ( ) ) { if ( ( profile.getName ( ) . equals ( getDiskProfile ( ) . getName ( ) ) ) && ( ! ( profile.getId ( ) . equals ( getDiskProfile ( ) . getId ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_PROFILE_NAME_IN_USE ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.dao.profiles.ProfilesDao < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > getProfileDao ( ) { return getDbFacade ( ) . getDiskProfileDao ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult hotUpdateDoneWithInternalNetwork ( org.ovirt.engine.core.common.businessentities.network.Network oldNetwork , org.ovirt.engine.core.common.businessentities.network.Network newNetwork ) { return ( ( oldNetwork == null ) || ( ! ( oldNetwork.isExternal ( ) ) ) ) && ( ( newNetwork == null ) || ( ! ( newNetwork.isExternal ( ) ) ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_NETWORK_CANNOT_BE_REWIRED ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult hotUpdateDoneWithInternalNetwork ( org.ovirt.engine.core.common.businessentities.network.Network oldNetwork , org.ovirt.engine.core.common.businessentities.network.Network newNetwork ) { return ( ( oldNetwork == null ) || ( ! ( oldNetwork.isExternal ( ) ) ) ) && ( ( newNetwork == null ) || ( ! ( newNetwork.isExternal ( ) ) ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_NETWORK_CANNOT_BE_REWIRED ) ; }
Source:
protected void itemsChanged ( ) { super . itemsChanged ( ) ; if ( ( ( ( getSelectionNodeList ( ) ) != null ) && ( getSelectionNodeList ( ) . isEmpty ( ) ) ) && ( ( getAttachedTagsToEntities ( ) ) != null ) ) { AttachedTagsToEntitiesChanged ( ) ; } }

Target:
protected void itemsChanged ( ) { super . itemsChanged ( ) ; if ( ( ( ( getSelectionNodeList ( ) ) != null ) && ( getSelectionNodeList ( ) . isEmpty ( ) ) ) && ( ( getAttachedTagsToEntities ( ) ) != null ) ) { attachedTagsToEntitiesChanged ( ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepStatus ( volumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionDelete ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String userName ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionDelete ( volumeName , remoteHost , remoteVolumeName , userName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static void getAllVnicProfiles ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVnicProfiles , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( getInboundEnabled ( ) . equals ( sender ) ) { updateInboundAvailability ( ) ; } else if ( getOutboundEnabled ( ) . equals ( sender ) ) { updateOutboundAvailability ( ) ; } }

Target:
protected void flush ( ) { super . flush ( ) ; networkQoS.setName ( ( ( java.lang.String ) ( getName ( ) . getEntity ( ) ) ) ) ; networkQoS.setStoragePoolId ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenters ( ) . getSelectedItem ( ) ) ) . getId ( ) ) ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void isMTUOverrideSupported ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MTUOverrideSupported ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static void getDiskList ( 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.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public static boolean CanUpdateField ( java.lang.String objectType , java.lang.String fieldName , java.lang.Enum < ? > status , java.lang.Object fieldContainer ) { java.lang.Class < ? > type = null ; if ( ( type = org.ovirt.engine.core.utils.ObjectIdentityChecker.mAliases.get ( objectType ) ) != null ) { return org.ovirt.engine.core.utils.ObjectIdentityChecker.CanUpdateField ( type , fieldName , status , fieldContainer ) ; } else { throw new java.lang.RuntimeException ( java.lang.String.format ( "status type %1$s not exist" , type ) ) ; } }

Target:
public static boolean CanUpdateField ( java.lang.String objectType , java.lang.String fieldName , java.lang.Enum < ? > status , java.lang.Object fieldContainer ) { java.lang.Class < ? > type = org.ovirt.engine.core.utils.ObjectIdentityChecker.aliases.get ( objectType ) ; if ( type != null ) { return org.ovirt.engine.core.utils.ObjectIdentityChecker.CanUpdateField ( type , fieldName , status , fieldContainer ) ; } else { throw new java.lang.RuntimeException ( java.lang.String.format ( "status type %1$s not exist" , type ) ) ; } }
Source:
public static void RunMultipleQueries ( final java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryType > queryTypeList , final java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > queryParamsList , final org.ovirt.engine.ui.uicompat.IFrontendMultipleQueryAsyncCallback callback ) { org.ovirt.engine.ui.frontend.Frontend.RunMultipleQueries ( queryTypeList , queryParamsList , callback , null ) ; }

Target:
public static void RunMultipleQueries ( final java.util.List < org.ovirt.engine.core.common.queries.VdcQueryType > queryTypeList , final java.util.List < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > queryParamsList , final org.ovirt.engine.ui.uicompat.IFrontendMultipleQueryAsyncCallback callback , final java.lang.String context ) { org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync service = GenericApiGWTServiceAsync.Util.getInstance ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunMultipleQueries ( queryTypeList , queryParamsList , callback , context , service ) ; }
Source:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getDataCenterMaxNameLength ( 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 ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity option = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity ( ) ; option.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "id" ) ) ) ; option.setVolumeId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "volume_id" ) ) ) ; option.setKey ( rs.getString ( "option_key" ) ) ; option.setValue ( rs.getString ( "option_val" ) ) ; return option ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity option = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity ( ) ; option.setId ( getGuidDefaultEmpty ( rs , "id" ) ) ; option.setVolumeId ( getGuidDefaultEmpty ( rs , "volume_id" ) ) ; option.setKey ( rs.getString ( "option_key" ) ) ; option.setValue ( rs.getString ( "option_val" ) ) ; return option ; }
Source:
public void testGetUserID ( ) { org.ovirt.engine.core.common.users.VdcUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.users.VdcUser.class ) ; org.mockito.Mockito.when ( user.getUserId ( ) ) . thenReturn ( Guid.EVERYONE ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setVdcUser ( user ) ; org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery query = new org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ; junit.framework.Assert.assertEquals ( "wrong guid" , Guid.EVERYONE , query.getUserID ( ) ) ; }

Target:
public void testGetUserID ( ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.DbUser.class ) ; org.mockito.Mockito.when ( user.getId ( ) ) . thenReturn ( Guid.EVERYONE ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setUser ( user ) ; org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery query = new org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ; junit.framework.Assert.assertEquals ( "wrong guid" , Guid.EVERYONE , query.getUserID ( ) ) ; }
Source:
public void testRemoveNonExistant ( ) { setUpGetDomainExpectations ( StorageType.NFS , false ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpGetDomainExpectations ( StorageType.NFS , false ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network_cluster > clustersFromDB = dbFacade.getNetworkClusterDao ( ) . getAllForCluster ( cluster ) ; org.ovirt.engine.core.common.businessentities.network_cluster clusterFromDB = clustersFromDB.get ( 0 ) ; org.junit.Assert.assertNotNull ( clusterFromDB ) ; new_net.setCluster ( clusterFromDB ) ; new_net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; dao.save ( new_net ) ; org.ovirt.engine.core.common.businessentities.Network result = dao.getByName ( new_net.getname ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_net , result ) ; }

Target:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.NetworkCluster > clustersFromDB = dbFacade.getNetworkClusterDao ( ) . getAllForCluster ( cluster ) ; org.ovirt.engine.core.common.businessentities.NetworkCluster clusterFromDB = clustersFromDB.get ( 0 ) ; org.junit.Assert.assertNotNull ( clusterFromDB ) ; new_net.setCluster ( clusterFromDB ) ; new_net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; dao.save ( new_net ) ; org.ovirt.engine.core.common.businessentities.Network result = dao.getByName ( new_net.getname ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_net , result ) ; }
Source:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardZeroesTheDataSupportBreaks ( ) { setSdDiscardSupport ( true , true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , false ) , createLunWithDiscardFunctionality ( 2048L , true ) ) , storageDomain ) ) ; }

Target:
public void testGetLunsThatBreakDiscardAfterDeleteSupportStorageDomainDiscardAfterDeleteDisabled ( ) { storageDomain.setDiscardAfterDelete ( false ) ; assertGetLunsThatBreakDiscardAfterDeleteSupportContainsExpectedLuns ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 1024L ) , createLunWithDiscardSupport ( 0L ) ) , java.util.Collections.emptyList ( ) ) ; }
Source:
boolean areRequiredNetworksAvailable ( final java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > vmNetworkInterfaces , final java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > allInterfacesForVds ) { for ( final org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmIf : vmNetworkInterfaces ) { boolean found = false ; for ( final org.ovirt.engine.core.common.businessentities.VdsNetworkInterface vdsIf : allInterfacesForVds ) { if ( org.apache.commons.lang.StringUtils.equals ( vmIf.getNetworkName ( ) , vdsIf.getNetworkName ( ) ) ) { found = true ; break ; } } if ( ! found ) { return false ; } } return true ; }

Target:
boolean areRequiredNetworksAvailable ( final java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > vmNetworkInterfaces , final java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > allInterfacesForVds ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.List < java.lang.String > vmNetworkInterfacesStr = org.apache.commons.collections.ListUtils.transformedList ( vmNetworkInterfaces , org.ovirt.engine.core.bll.VdsSelector.toNetworkName ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.List < java.lang.String > vdsNetNames = org.apache.commons.collections.ListUtils.transformedList ( allInterfacesForVds , org.ovirt.engine.core.bll.VdsSelector.toNetworkName ) ; return vdsNetNames.containsAll ( vmNetworkInterfacesStr ) ; }
Source:
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 ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
private void spySdValidator ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > sdIds = new java.util.HashSet ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 ) ) ; spySdValidator ( sdIds ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage mockSourceImage ( ) { org.ovirt.engine.core.common.businessentities.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; org.mockito.Mockito.doReturn ( java.util.Collections.singletonList ( image ) ) . when ( cmd ) . getSourceImages ( ) ; org.mockito.Mockito.when ( diskImageDAO.get ( image.getImageId ( ) ) ) . thenReturn ( image ) ; return image ; }
Source:
private void migrateMacs ( org.ovirt.engine.core.compat.Guid oldMacPoolId , org.ovirt.engine.core.compat.Guid newMacPoolId , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { java.util.List < java.lang.String > vmInterfaceMacs = vmNicDao.getAllMacsByClusterId ( clusterId ) ; java.util.Objects.requireNonNull ( vmInterfaceMacs ) ; org.ovirt.engine.core.bll.network.macpool.MacPool sourcePool = poolPerCluster.getMacPoolById ( oldMacPoolId , commandContext ) ; org.ovirt.engine.core.bll.network.macpool.MacPool targetPool = poolPerCluster.getMacPoolById ( newMacPoolId , commandContext ) ; for ( java.lang.String mac : vmInterfaceMacs ) { sourcePool.freeMac ( mac ) ; targetPool.forceAddMac ( mac ) ; } }

Target:
public void moveMacsOfUpdatedCluster ( org.ovirt.engine.core.common.businessentities.Cluster sourceCluster , org.ovirt.engine.core.compat.Guid targetMacPoolId , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { java.util.Objects.requireNonNull ( sourceCluster ) ; java.util.Objects.requireNonNull ( targetMacPoolId ) ; org.ovirt.engine.core.compat.Guid sourceMacPoolId = sourceCluster.getMacPoolId ( ) ; org.ovirt.engine.core.compat.Guid clusterId = sourceCluster.getId ( ) ; java.util.Objects.requireNonNull ( sourceMacPoolId ) ; java.util.Objects.requireNonNull ( clusterId ) ; if ( needToMigrateMacs ( sourceMacPoolId , targetMacPoolId ) ) { java.util.List < java.lang.String > macsToMigrate = vmNicDao.getAllMacsByClusterId ( clusterId ) ; migrateMacsToAnotherMacPool ( sourceMacPoolId , targetMacPoolId , macsToMigrate , commandContext ) ; } }
Source:
public void render ( org.ovirt.engine.ui.userportal.section.main.view.tab.extended.Context context , org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.append ( templates.vmNameCellItem ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , "name" , context ) , item.getName ( ) ) ) ; java.lang.String description = item.getDescription ( ) ; if ( ( description != null ) && ( ! ( description.isEmpty ( ) ) ) ) { sb.append ( templates.vmDescriptionCellItem ( description ) ) ; } }

Target:
public void render ( org.ovirt.engine.ui.userportal.section.main.view.tab.extended.Context context , org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.append ( org.ovirt.engine.ui.userportal.section.main.view.tab.extended.SideTabExtendedVirtualMachineView.templates.vmNameCellItem ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , "name" , context ) , item.getName ( ) ) ) ; java.lang.String description = item.getDescription ( ) ; if ( ( description != null ) && ( ! ( description.isEmpty ( ) ) ) ) { sb.append ( org.ovirt.engine.ui.userportal.section.main.view.tab.extended.SideTabExtendedVirtualMachineView.templates.vmDescriptionCellItem ( description ) ) ; } }
Source:
private org.ovirt.engine.core.common.asynctasks.AsyncTaskType internalGetTaskType ( ) { if ( hasTaskHandlers ( ) ) { if ( ( getParameters ( ) . getExecutionReason ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionParametersBase.CommandExecutionReason.REGULAR_FLOW ) ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; } return getCurrentTaskHandler ( ) . getRevertTaskType ( ) ; } return getTaskType ( ) ; }

Target:
protected final org.ovirt.engine.core.common.action.LockProperties getLockingPropertiesSettings ( ) { return org.ovirt.engine.core.common.action.LockProperties.create ( Scope.None ) . withWait ( false ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { if ( ( ( ( "CREATION_DATE" . equals ( fieldName ) ) || ( "SIZE" . equals ( fieldName ) ) ) || ( "ACTUAL_SIZE" . equals ( fieldName ) ) ) || ( "PROVISIONED_SIZE" . equals ( fieldName ) ) ) { return BiggerOrSmallerRelationAutoCompleter.INSTANCE ; } else if ( "NUMBER_OF_VMS" . equals ( fieldName ) ) { return NumericConditionRelationAutoCompleter.INSTANCE ; } else { return StringConditionRelationAutoCompleter.INSTANCE ; } }

Target:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { if ( ( ( ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.CREATION_DATE.equals ( fieldName ) ) || ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.SIZE.equals ( fieldName ) ) ) || ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.ACTUAL_SIZE.equals ( fieldName ) ) ) || ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.PROVISIONED_SIZE.equals ( fieldName ) ) ) { return BiggerOrSmallerRelationAutoCompleter.INSTANCE ; } else if ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.NUMBER_OF_VMS.equals ( fieldName ) ) { return NumericConditionRelationAutoCompleter.INSTANCE ; } else { return StringConditionRelationAutoCompleter.INSTANCE ; } }
Source:
private static void mockConfigVals ( ) { org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLocalDisksLowFreeSpace ) ) . thenReturn ( 0 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLocalDisksCriticallyLowFreeSpace ) ) . thenReturn ( 0 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsRefreshRate ) ) . thenReturn ( 3000 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.TimeToReduceFailedRunOnVdsInMinutes ) ) . thenReturn ( 30 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsRecoveryTimeoutInMintues ) ) . thenReturn ( 3 ) ; }

Target:
public void mockEjbStrategy ( ) { origEjbStrategy = org.ovirt.engine.core.utils.ejb.EjbUtils.getStrategy ( ) ; org.ovirt.engine.core.utils.ejb.EjbUtils.setStrategy ( mockStrategy ) ; org.mockito.Mockito.when ( mockStrategy.findResource ( ContainerManagedResourceType.TRANSACTION_MANAGER ) ) . thenReturn ( tm ) ; }
Source:
public void getIsGlusterVolumeSnapshotCliScheduleEnabled ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotCliScheduleFlag , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Integer > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( 0 ) ; aQuery.asyncCallback.onSuccess ( 5 ) ; }
Source:
public static void getGlusterRemoveBricksStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; } } ; org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters parameters = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters ( clusterId , volumeId , bricks ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRemoveBricksStatus , parameters , aQuery ) ; }

Target:
public static void getGlusterRemoveBricksStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks ) { aQuery.setHandleFailure ( true ) ; org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters parameters = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters ( clusterId , volumeId , bricks ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRemoveBricksStatus , parameters , aQuery ) ; }
Source:
public void testBalance ( ) throws org.apache.xmlrpc.XmlRpcException { java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > result = proxy.balance ( org.ovirt.schedulerproxy.SchedulerProxyTest.CLASS_NAME , org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ARRAY , "" ) ; org.junit.Assert.assertTrue ( result.containsKey ( org.ovirt.schedulerproxy.SchedulerProxyTest.VM_ID ) ) ; org.junit.Assert.assertTrue ( result.get ( org.ovirt.schedulerproxy.SchedulerProxyTest.VM_ID ) . contains ( org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ID1 ) ) ; }

Target:
public void testBalance ( ) throws org.apache.xmlrpc.XmlRpcException { java.util.Map < java.lang.String , java.util.List < java.lang.String > > result = proxy.balance ( org.ovirt.schedulerproxy.SchedulerProxyTest.CLASS_NAME , org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ARRAY , "" ) . getResult ( ) ; org.junit.Assert.assertTrue ( result.containsKey ( org.ovirt.schedulerproxy.SchedulerProxyTest.VM_ID ) ) ; org.junit.Assert.assertTrue ( result.get ( org.ovirt.schedulerproxy.SchedulerProxyTest.VM_ID ) . contains ( org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ID1 ) ) ; }
Source:
public static org.ovirt.engine.core.common.vdscommands.VDSReturnValue handleVdsResult ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue result ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( result.getExceptionString ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( ( ( result.getVdsError ( ) ) != null ? result.getVdsError ( ) . getCode ( ) : org.ovirt.engine.core.common.errors.VdcBllErrors.ENGINE ) , result.getExceptionString ( ) ) ; } return result ; }

Target:
public static org.ovirt.engine.core.common.vdscommands.VDSReturnValue handleVdsResult ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue result ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( result.getExceptionString ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( ( ( result.getVdsError ( ) ) != null ? result.getVdsError ( ) . getCode ( ) : org.ovirt.engine.core.common.errors.EngineError.ENGINE ) , result.getExceptionString ( ) ) ; } return result ; }
Source:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardZeroesTheDataSupportBreaks ( ) { setSdDiscardSupport ( true , true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , false ) , createLunWithDiscardFunctionality ( 2048L , true ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { storageDomain.setSupportsDiscard ( true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 0L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
private void createDummyPolicyUnit ( ) { dummyPolicyUnit = new org.ovirt.engine.core.common.scheduling.PolicyUnit ( ) ; dummyPolicyUnit.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dummyPolicyUnit.setName ( "Dummy policy unit" ) ; }

Target:
private void createDummyPolicyUnit ( ) { dummyPolicyUnit = new org.ovirt.engine.core.common.scheduling.PolicyUnit ( ) ; dummyPolicyUnit.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dummyPolicyUnit.setName ( "Dummy policy unit" ) ; dummyPolicyUnit.setDescription ( "Description" ) ; dummyPolicyUnit.setPolicyUnitType ( PolicyUnitType.Filter ) ; dummyPolicyUnit.setParameterRegExMap ( new java.util.LinkedHashMap < java.lang.String , java.lang.String > ( ) ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getCopyCommand ( ) ) ) { Copy ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } else if ( command == ( getChangeQuotaCommand ( ) ) ) { changeQuota ( ) ; } else if ( command.getName ( ) . equals ( "onChangeQuota" ) ) { onChangeQuota ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getCopyCommand ( ) ) ) { copy ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } else if ( command == ( getChangeQuotaCommand ( ) ) ) { changeQuota ( ) ; } else if ( command.getName ( ) . equals ( "onChangeQuota" ) ) { onChangeQuota ( ) ; } }
Source:
boolean contentOverflows ( com.google.gwt.dom.client.Element elm ) { java.lang.String overflowValue = elm.getStyle ( ) . getOverflow ( ) ; elm.getStyle ( ) . setProperty ( "overflow" , "auto" ) ; boolean overflowX = ( elm.getScrollWidth ( ) ) > ( elm.getClientWidth ( ) ) ; boolean overflowY = ( elm.getScrollHeight ( ) ) > ( elm.getClientHeight ( ) ) ; elm.getStyle ( ) . setProperty ( "overflow" , overflowValue ) ; return overflowX || overflowY ; }

Target:
protected boolean showTooltip ( com.google.gwt.dom.client.Element parent , java.lang.String value ) { if ( ( title ) != null ) { return true ; } com.google.gwt.safehtml.shared.SafeHtml escapedValue = getEscapedValue ( value ) ; com.google.gwt.safehtml.shared.SafeHtml renderedValue = getRenderedValue ( escapedValue ) ; return ( super . showTooltip ( parent , value ) ) || ( ! ( escapedValue.equals ( renderedValue ) ) ) ; }
Source:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public static void getUserMessageOfTheDayViaPublic ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void testWithMaintenancedHostAndSomeHaveEnoughMemoryForTwo ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "3" ) ; hostedEngine.setVmMemSizeMb ( 5000 ) ; hosts.get ( 2 ) . setHighlyAvailableLocalMaintenance ( true ) ; hosts.get ( 3 ) . setPhysicalMemMb ( 6000 ) ; hosts.get ( 4 ) . setPhysicalMemMb ( 2048 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.Assert.assertEquals ( 4 , result.size ( ) ) ; }

Target:
public void testWithMaintenancedHostAndSomeHaveEnoughMemoryForTwo ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "3" ) ; hostedEngine.setVmMemSizeMb ( 5000 ) ; hosts.get ( 2 ) . setHighlyAvailableLocalMaintenance ( true ) ; hosts.get ( 3 ) . setPhysicalMemMb ( 6000 ) ; hosts.get ( 4 ) . setPhysicalMemMb ( 2048 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.jupiter.api.Assertions.assertEquals ( 4 , result.size ( ) ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase RunAutoAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters ) { return RunAction ( actionType , parameters ) ; }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isRunOnlyIfAllCanDoPass , boolean waitForResult ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = notAllowToRunAction ( actionType ) ; if ( returnValue != null ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) ; list.add ( returnValue ) ; return list ; } else { return runMultipleActionsImpl ( actionType , parameters , false , isRunOnlyIfAllCanDoPass , waitForResult ) ; } }
Source:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public void getGlusterHooks ( 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.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }