auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( templateExistsInSetup ) { if ( ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ) ) { getCollapseSnapshots ( ) . setEntity ( true ) ; getCollapseSnapshots ( ) . getChangeProhibitionReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . importCloneVMMustCollapseSnapshots ( ) ) ; getCollapseSnapshots ( ) . setIsChangable ( false ) ; } else { getCollapseSnapshots ( ) . setIsChangable ( true ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( templateExistsInSetup ) { if ( ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ) ) { getCollapseSnapshots ( ) . setEntity ( true ) ; getCollapseSnapshots ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . importCloneVMMustCollapseSnapshots ( ) ) ; getCollapseSnapshots ( ) . setIsChangable ( false ) ; } else { getCollapseSnapshots ( ) . setIsChangable ( true ) ; } } }
Source:
public void getISCSIStorageTypeForLun ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.LUNs lun = new org.ovirt.engine.core.common.businessentities.LUNs ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( ) ; connections.add ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( "Some LUN connection" , "id" , "iqn" , "password" , org.ovirt.engine.core.common.businessentities.StorageType.ISCSI , "Username" , "port" , "portal" ) ) ; lun.setLunConnections ( connections ) ; org.ovirt.engine.core.common.businessentities.StorageType storageType = command.getLUNStorageType ( lun ) ; org.junit.Assert.assertEquals ( "Lun disk should be of ISCSI storage type since it has one connection with ISCSI storage type" , StorageType.ISCSI , storageType ) ; }

Target:
public void getISCSIStorageTypeForLun ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( ) ; connections.add ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( "Some LUN connection" , "id" , "iqn" , "password" , org.ovirt.engine.core.common.businessentities.storage.StorageType.ISCSI , "Username" , "port" , "portal" ) ) ; lun.setLunConnections ( connections ) ; org.ovirt.engine.core.common.businessentities.storage.StorageType storageType = command.getLUNStorageType ( lun ) ; org.junit.Assert.assertEquals ( "Lun disk should be of ISCSI storage type since it has one connection with ISCSI storage type" , StorageType.ISCSI , storageType ) ; }
Source:
public static void addNetworkFiltersToNic ( java.util.Map < java.lang.String , java.lang.Object > struct ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableMACAntiSpoofingFilterRules ) ) { struct.put ( VdsProperties.NW_FILTER , NetworkFilters.NO_MAC_SPOOFING.getFilterName ( ) ) ; } }

Target:
private static org.ovirt.engine.core.common.businessentities.network.NetworkFilter fetchVnicProfileNetworkFilter ( org.ovirt.engine.core.common.businessentities.network.VmNic vmNic ) { if ( ( vmNic.getVnicProfileId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVnicProfileDao ( ) . get ( vmNic.getVnicProfileId ( ) ) ; if ( vnicProfile != null ) { final org.ovirt.engine.core.compat.Guid networkFilterId = vnicProfile.getNetworkFilterId ( ) ; return networkFilterId == null ? null : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkFilterDao ( ) . getNetworkFilterById ( networkFilterId ) ; } } return null ; }
Source:
private static boolean failVmFree ( java.util.List < java.lang.String > messages , java.util.List < java.lang.String > messagesToAdd ) { messages.addAll ( messagesToAdd ) ; messages.add ( VdcBllMessages.VAR__TYPE__DESKTOP_POOL.toString ( ) ) ; messages.add ( VdcBllMessages.VAR__ACTION__ATTACH_DESKTOP_TO.toString ( ) ) ; return false ; }

Target:
private static boolean failVmFree ( java.util.List < java.lang.String > messages , java.util.List < java.lang.String > messagesToAdd ) { messages.addAll ( messagesToAdd ) ; messages.add ( EngineMessage.VAR__TYPE__DESKTOP_POOL.toString ( ) ) ; messages.add ( EngineMessage.VAR__ACTION__ATTACH_DESKTOP_TO.toString ( ) ) ; return false ; }
Source:
private void handleFinalizingSuccess ( final org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand < T > . StateContext context ) { log.info ( "Finalizing successful upload to {}" , getUploadDescription ( ) ) ; stopImageTransferSession ( context.entity ) ; setVolumeLegalityInStorage ( context.entity.getVdsId ( ) , true ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.unLockImage ( ) ; updateEntityPhase ( ImageTransferPhase.FINISHED_SUCCESS ) ; }

Target:
private void handleFinalizingSuccess ( final org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand < T > . StateContext context ) { log.info ( "Finalizing successful upload to {}" , getUploadDescription ( ) ) ; stopImageTransferSession ( context.entity ) ; org.ovirt.engine.core.compat.Guid transferingVdsId = context.entity.getVdsId ( ) ; if ( verifyImage ( transferingVdsId ) ) { setVolumeLegalityInStorage ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.LEGAL_IMAGE ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.unLockImage ( ) ; updateEntityPhase ( ImageTransferPhase.FINISHED_SUCCESS ) ; } else { setImageStatus ( ImageStatus.ILLEGAL ) ; updateEntityPhase ( ImageTransferPhase.FINALIZING_FAILURE ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > returnValueList = result.getReturnValues ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValueList.get ( 0 ) . getReturnValue ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValueList.get ( 1 ) . getReturnValue ( ) ) ) ; InitClusters ( clusters , true , false ) ; InitTemplates ( templates ) ; InitCdImage ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > returnValueList = result.getReturnValues ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValueList.get ( 0 ) . getReturnValue ( ) ) ) ; initTemplates ( templates ) ; initCdImage ( ) ; }
Source:
public void testDnsResolverConfigurationNonDefaultRouteNetwork ( ) { iface.setIpv4DefaultRoute ( true ) ; network.setDnsResolverConfiguration ( sampleDnsResolverConfiguration ) ; testedNetworkAttachment.setDnsResolverConfiguration ( sampleDnsResolverConfiguration2 ) ; org.junit.Assert.assertThat ( createTestedInstance ( false , sampleDnsResolverConfiguration ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testDnsResolverConfigurationNonDefaultRouteNetwork ( ) { iface.setIpv4DefaultRoute ( true ) ; network.setDnsResolverConfiguration ( sampleDnsResolverConfiguration ) ; testedNetworkAttachment.setDnsResolverConfiguration ( sampleDnsResolverConfiguration2 ) ; org.hamcrest.MatcherAssert.assertThat ( createTestedInstance ( false , sampleDnsResolverConfiguration ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
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 findDefaultManagementNetwork ( ) { managementNetwork = defaultManagementNetworkFinder.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.AddClusterCommand.getCluster ( ) . getStoragePoolId ( ) ) ; if ( ( getManagementNetwork ( ) ) == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_DEFAULT_MANAGEMENT_NETWORK_NOT_FOUND ) ; return false ; } return true ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageType > storageTypes = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageType storageType : storageTypes ) { if ( ( storageType.isBlockDomain ( ) ) != ( item.getType ( ) . isBlockDomain ( ) ) ) { updateItemSelectability ( item , false ) ; return ; } } updateItemSelectability ( item , true ) ; return ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.StorageType > storageTypes = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType : storageTypes ) { if ( ( storageType.isBlockDomain ( ) ) != ( item.getType ( ) . isBlockDomain ( ) ) ) { updateItemSelectability ( item , false ) ; return ; } } updateItemSelectability ( item , true ) ; return ; }
Source:
public void testFindMappingEntryEmptyExternal ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; vnic.setNetworkName ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.NETWORK_NAME ) ; vnic.setVnicProfileName ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.VNIC_PROFILE1_NAME ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ctx = new org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ( ) ; ctx.setUserMappings ( java.util.Collections.singletonList ( emptySourceMapping ) ) ; ctx.setOvfVnics ( java.util.Collections.singletonList ( vnic ) ) ; underTest.handle ( ctx ) ; org.junit.Assert.assertEquals ( null , ctx.getMatched ( ) . get ( vnic ) ) ; }

Target:
public void testFindMappingEntryEmptyExternal ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; vnic.setNetworkName ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.NETWORK_NAME ) ; vnic.setVnicProfileName ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.VNIC_PROFILE1_NAME ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ctx = new org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ( ) ; ctx.setUserMappings ( java.util.Collections.singletonList ( emptySourceMapping ) ) ; ctx.setOvfVnics ( java.util.Collections.singletonList ( vnic ) ) ; underTest.handle ( ctx ) ; org.junit.Assert.assertNull ( ctx.getMatched ( ) . get ( vnic ) ) ; }
Source:
private java.lang.String getTicket ( org.ovirt.engine.api.model.GraphicsType graphicsTypeEntity ) { final org.ovirt.engine.core.common.queries.GetSignedWebsocketProxyTicketParams params = new org.ovirt.engine.core.common.queries.GetSignedWebsocketProxyTicketParams ( guid , graphicsTypeEntity ) ; final org.ovirt.engine.core.common.queries.VdcQueryReturnValue ticketQueryReturnValue = runQuery ( VdcQueryType.GetSignedWebsocketProxyTicket , params ) ; if ( ! ( ticketQueryReturnValue.getSucceeded ( ) ) ) { try { backendFailure ( ticketQueryReturnValue.getExceptionString ( ) ) ; } catch ( org.ovirt.engine.api.restapi.resource.BackendFailureException ex ) { handleError ( ex , false ) ; } } return ticketQueryReturnValue.getReturnValue ( ) ; }

Target:
private java.lang.String getTicket ( org.ovirt.engine.api.model.GraphicsType graphicsTypeEntity ) { final org.ovirt.engine.core.common.queries.GetSignedWebsocketProxyTicketParams params = new org.ovirt.engine.core.common.queries.GetSignedWebsocketProxyTicketParams ( guid , graphicsTypeEntity ) ; final org.ovirt.engine.core.common.queries.VdcQueryReturnValue ticketQueryReturnValue = runQuery ( QueryType.GetSignedWebsocketProxyTicket , params ) ; if ( ! ( ticketQueryReturnValue.getSucceeded ( ) ) ) { try { backendFailure ( ticketQueryReturnValue.getExceptionString ( ) ) ; } catch ( org.ovirt.engine.api.restapi.resource.BackendFailureException ex ) { handleError ( ex , false ) ; } } return ticketQueryReturnValue.getReturnValue ( ) ; }
Source:
private void setCorrelationId ( org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { if ( ( httpHeaders ) == null ) { return ; } java.util.List < java.lang.String > correlationIds = httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.BackendResource.CORRELATION_ID ) ; if ( ( correlationIds != null ) && ( ( correlationIds.size ( ) ) > 0 ) ) { params.setCorrelationId ( correlationIds.get ( 0 ) ) ; } }

Target:
private void setCorrelationId ( org.ovirt.engine.core.common.HasCorrelationId params ) { java.lang.String correlationId = getCurrent ( ) . getParameters ( ) . get ( org.ovirt.engine.api.restapi.resource.BackendResource.CORRELATION_ID ) ; if ( correlationId != null ) { params.setCorrelationId ( correlationId ) ; } }
Source:
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 ) ; }

Target:
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 ) ; }
Source:
private void removeDiskImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getVm ( ) . getDiskMap ( ) . values ( ) , true , false , true ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { image.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.storage.export.RemoveVmFromImportExportCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) ; image.setStoragePoolId ( org.ovirt.engine.core.bll.storage.export.RemoveVmFromImportExportCommand.getParameters ( ) . getStoragePoolId ( ) ) ; } removeVmImages ( images ) ; }

Target:
private void removeDiskImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( getVm ( ) . getDiskMap ( ) . values ( ) , true , false , true ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { image.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.storage.export.RemoveVmFromImportExportCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) ; image.setStoragePoolId ( org.ovirt.engine.core.bll.storage.export.RemoveVmFromImportExportCommand.getParameters ( ) . getStoragePoolId ( ) ) ; } removeVmImages ( images ) ; }
Source:
protected void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetStorageDomainByIdAndStoragePoolId , org.ovirt.engine.core.common.queries.StorageDomainAndPoolQueryParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , ( notFound ? null : getEntity ( 0 ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.NFS , true ) ; setUpGetConnectionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachStorageDomainFromPool , org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public static void initOsNames ( ) { 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.osNames = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsIds ( ) ; } } ; 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.GetOsNames ) , callback ) ; }

Target:
public void initOsNames ( ) { 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 ) { osNames = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; initOsIds ( ) ; } } ; 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.GetOsNames ) , callback ) ; }
Source:
boolean validatePluginAction ( java.lang.String pluginName ) { org.ovirt.engine.ui.webadmin.plugin.Plugin plugin = getPlugin ( pluginName ) ; return ( plugin != null ) && ( ( plugin.isInState ( PluginState.INITIALIZING ) ) || ( plugin.isInState ( PluginState.IN_USE ) ) ) ; }

Target:
boolean validatePluginAction ( java.lang.String pluginName , boolean allowWhileLoading ) { org.ovirt.engine.ui.webadmin.plugin.Plugin plugin = getPlugin ( pluginName ) ; if ( plugin == null ) { return false ; } boolean isInitializingOrInUse = ( plugin.isInState ( PluginState.INITIALIZING ) ) || ( plugin.isInState ( PluginState.IN_USE ) ) ; boolean isLoading = plugin.isInState ( PluginState.LOADING ) ; return isInitializingOrInUse || ( allowWhileLoading && isLoading ) ; }
Source:
public void testCheckAddEditValidations ( ) { org.ovirt.engine.core.compat.Guid clusterPolicyId = new org.ovirt.engine.core.compat.Guid ( "e754440b-76a6-4099-8235-4565ab4b5521" ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy clusterPolicy = new org.ovirt.engine.core.common.scheduling.ClusterPolicy ( ) ; clusterPolicy.setId ( clusterPolicyId ) ; org.ovirt.engine.core.bll.scheduling.commands.ClusterPolicyCRUDCommand command = new org.ovirt.engine.core.bll.scheduling.commands.ClusterPolicyCRUDCommand ( new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( clusterPolicyId , clusterPolicy ) , null ) { @ java.lang.Override protected void executeCommand ( ) { } } ; command.schedulingManager = mockScheduler ( ) ; org.junit.Assert.assertTrue ( command.checkAddEditValidations ( ) ) ; }

Target:
public void testCheckAddEditValidations ( ) { org.ovirt.engine.core.compat.Guid clusterPolicyId = new org.ovirt.engine.core.compat.Guid ( "e754440b-76a6-4099-8235-4565ab4b5521" ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy clusterPolicy = new org.ovirt.engine.core.common.scheduling.ClusterPolicy ( ) ; clusterPolicy.setId ( clusterPolicyId ) ; org.ovirt.engine.core.bll.scheduling.commands.ClusterPolicyCRUDCommand command = new org.ovirt.engine.core.bll.scheduling.commands.ClusterPolicyCRUDCommand ( new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( clusterPolicyId , clusterPolicy ) , null ) { @ java.lang.Override protected void executeCommand ( ) { } } ; command.schedulingManager = schedulingManager ; org.junit.Assert.assertTrue ( command.checkAddEditValidations ( ) ) ; }
Source:
private org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData fetchStats ( org.ovirt.engine.core.common.businessentities.VM dbVm , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vdsmVm ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vmStats = resourceManager.runVdsCommand ( VDSCommandType.GetVmStats , new org.ovirt.engine.core.common.vdscommands.GetVmStatsVDSCommandParameters ( manager.getCopyVds ( ) , vdsmVm.getVmDynamic ( ) . getId ( ) ) ) ; if ( vmStats.getSucceeded ( ) ) { return ( ( org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ) ( vmStats.getReturnValue ( ) ) ) ; } else { if ( dbVm != null ) { org.ovirt.engine.core.vdsbroker.jsonrpc.EventVMStatsRefresher.log.error ( "failed to fetch VM '{}' stats. status remain unchanged ({})" , dbVm.getName ( ) , dbVm.getStatus ( ) ) ; } } return null ; }

Target:
private java.lang.Double parseDouble ( java.lang.Object value ) { if ( java.lang.Long.class . isInstance ( value ) ) { return ( ( java.lang.Long ) ( value ) ) . doubleValue ( ) ; } return null ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getDbFacade ( ) . getVdsDAO ( ) . get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . isFiltered ( ) ) ; if ( vds != null ) { vds.setCpuName ( org.ovirt.engine.core.bll.CpuFlagsManagerHandler.FindMaxServerCpuByFlags ( vds.getcpu_flags ( ) , vds.getvds_group_compatibility_version ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . isFiltered ( ) ) ; if ( vds != null ) { vds.setCpuName ( org.ovirt.engine.core.bll.CpuFlagsManagerHandler.FindMaxServerCpuByFlags ( vds.getcpu_flags ( ) , vds.getvds_group_compatibility_version ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }
Source:
protected void addBootProtocolForRoleNetwork ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { if ( ( ( networkCluster.isDisplay ( ) ) || ( networkCluster.isMigration ( ) ) ) && ( ( ( nic.getBootProtocol ( ) ) == null ) || ( ( nic.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ) { nic.setBootProtocol ( NetworkBootProtocol.DHCP ) ; } }

Target:
protected void addBootProtocolForRoleNetwork ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { if ( ( ( ( networkCluster.isDisplay ( ) ) || ( networkCluster.isMigration ( ) ) ) || ( networkCluster.isGluster ( ) ) ) && ( ( ( nic.getBootProtocol ( ) ) == null ) || ( ( nic.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ) { nic.setBootProtocol ( NetworkBootProtocol.DHCP ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc glusterVolumeSnapshotConfigGet ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.configList" ) . withOptionalParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc ( clusterId , response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionCreate ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remotVolumeName , java.lang.String remoteUserName , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionCreate" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , remoteHost ) . withParameter ( "remoteVolumeName" , remotVolumeName ) . withParameter ( "force" , force ) . withOptionalParameter ( "remoteUserName" , remoteUserName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void testSwitchStorageDomainType ( ) { org.mockito.Mockito.when ( command.getStorageDomainStaticDAO ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void testSwitchStorageDomainType ( ) { org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public java.lang.Object runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.storage_pool storagePool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDAO ( ) . get ( _storagePoolId ) ; if ( ( storagePool != null ) && ( ( ( ( storagePool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) || ( ( storagePool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Problematic ) ) ) || ( ( storagePool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Contend ) ) ) ) { ProceedStoragePoolStats ( ) ; } return null ; }

Target:
public java.lang.Object runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.storage_pool storagePool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( _storagePoolId ) ; if ( ( storagePool != null ) && ( ( ( ( storagePool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) || ( ( storagePool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Problematic ) ) ) || ( ( storagePool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Contend ) ) ) ) { ProceedStoragePoolStats ( ) ; } return null ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > setUpLuns ( boolean withDummyLun ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = new java.util.ArrayList < > ( ) ; for ( java.lang.String GUID : org.ovirt.engine.core.bll.storage.disk.lun.GetLunsByVgIdQueryTest.GUIDS ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun.setLUN_id ( GUID ) ; luns.add ( lun ) ; } if ( withDummyLun ) { org.ovirt.engine.core.common.businessentities.storage.LUNs dummyLun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; dummyLun.setLUN_id ( org.ovirt.engine.core.bll.storage.disk.lun.GetLunsByVgIdQueryTest.DUMMY_LUN_ID ) ; luns.add ( dummyLun ) ; } return luns ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > setUpLuns ( boolean withDummyLun ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = new java.util.ArrayList < > ( ) ; for ( java.lang.String GUID : org.ovirt.engine.core.bll.storage.disk.lun.GetLunsByVgIdQueryTest.GUIDS ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun.setLUNId ( GUID ) ; luns.add ( lun ) ; } if ( withDummyLun ) { org.ovirt.engine.core.common.businessentities.storage.LUNs dummyLun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; dummyLun.setLUNId ( org.ovirt.engine.core.bll.storage.disk.lun.GetLunsByVgIdQueryTest.DUMMY_LUN_ID ) ; luns.add ( dummyLun ) ; } return luns ; }
Source:
private void doTestIpConfiguredForStaticBootProtocol ( java.lang.String address , java.lang.String netmask , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.STATIC_IP , address , netmask ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . ipConfiguredForStaticBootProtocol ( ) , matcher ) ; }

Target:
private void doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( boolean displayNetwork , org.ovirt.engine.core.common.businessentities.network.Network network , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( displayNetwork , false , false , matcher , network , attachment ) ; }
Source:
public java.lang.Object runInTransaction ( ) { getStoragePool ( ) . setstatus ( StoragePoolStatus.Maintanance ) ; getStoragePool ( ) . setStoragePoolFormatType ( masterStorageDomain.getStorageFormat ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDAO ( ) . update ( getStoragePool ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.PoolStatusChanged ( getStoragePool ( ) . getId ( ) , getStoragePool ( ) . getstatus ( ) ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { getStoragePool ( ) . setstatus ( StoragePoolStatus.Maintanance ) ; getStoragePool ( ) . setStoragePoolFormatType ( masterStorageDomain.getStorageFormat ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( getStoragePool ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.PoolStatusChanged ( getStoragePool ( ) . getId ( ) , getStoragePool ( ) . getstatus ( ) ) ; return null ; }
Source:
private void setDisks ( java.lang.Iterable value ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( value != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > cast ( value ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; super . setItems ( disks ) ; }

Target:
private void setDisks ( java.lang.Iterable value ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( value != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > cast ( value ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; super . setItems ( disks ) ; }
Source:
public void remove ( java.lang.String id ) { try { getClient ( ) . networks ( ) . delete ( id ) . execute ( ) ; } catch ( java.lang.RuntimeException e ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , e ) ; } }

Target:
protected com.woorea.openstack.quantum.model.Port createNewPortForAllocate ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , java.util.List < java.lang.String > securityGroups , java.lang.String hostId , org.ovirt.engine.core.common.businessentities.network.Network externalNetwork ) { com.woorea.openstack.quantum.model.Port portForCreate = super . createNewPortForAllocate ( nic , securityGroups , hostId , externalNetwork ) ; portForCreate.setTenantId ( externalNetwork.getTenantId ( ) ) ; return portForCreate ; }
Source:
public void testUpdateSnapshotStatusByName ( ) { dao.updateSnapshotStatusByName ( existingSnapshot.getVolumeId ( ) , existingSnapshot.getSnapshotName ( ) , GlusterSnapshotStatus.DEACTIVATED ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot = dao.getById ( existingSnapshot.getSnapshotId ( ) ) ; org.junit.Assert.assertNotNull ( snapshot ) ; org.junit.Assert.assertNotEquals ( snapshot , existingSnapshot ) ; existingSnapshot.setStatus ( GlusterSnapshotStatus.DEACTIVATED ) ; org.junit.Assert.assertEquals ( existingSnapshot , snapshot ) ; }

Target:
public void testUpdateSnapshotStatusByName ( ) { dao.updateSnapshotStatusByName ( existingSnapshot.getVolumeId ( ) , existingSnapshot.getSnapshotName ( ) , GlusterSnapshotStatus.DEACTIVATED ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot = dao.getById ( existingSnapshot.getSnapshotId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( snapshot ) ; org.junit.jupiter.api.Assertions.assertNotEquals ( snapshot , existingSnapshot ) ; existingSnapshot.setStatus ( GlusterSnapshotStatus.DEACTIVATED ) ; org.junit.jupiter.api.Assertions.assertEquals ( existingSnapshot , snapshot ) ; }
Source:
public void testGetRelevantVdsGroupQuotaForUserWithoutPrivileges ( ) throws java.lang.Exception { org.junit.Assert.assertNotNull ( unprivilegedUserSession ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = dao.getAllRelevantQuotasForVdsGroup ( FixturesTool.VDS_GROUP_RHEL6_NFS , unprivilegedUserSession.getId ( ) , true ) ; org.junit.Assert.assertEquals ( "Unprivileged user is not allowed to fetch for quota" , 0 , quotas.size ( ) ) ; }

Target:
public void testGetRelevantClusterQuotaForUserWithoutPrivileges ( ) throws java.lang.Exception { org.junit.Assert.assertNotNull ( unprivilegedUserSession ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = dao.getAllRelevantQuotasForCluster ( FixturesTool.CLUSTER_RHEL6_NFS , unprivilegedUserSession.getId ( ) , true ) ; org.junit.Assert.assertEquals ( "Unprivileged user is not allowed to fetch for quota" , 0 , quotas.size ( ) ) ; }
Source:
public void testUpdateVmDeviceUsingScsiReservationProperty ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = dao.get ( getExistingEntityId ( ) ) ; boolean usingScsiReservation = ! ( vmDevice.isUsingScsiReservation ( ) ) ; vmDevice.setUsingScsiReservation ( usingScsiReservation ) ; dao.update ( vmDevice ) ; dao.get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertEquals ( vmDevice.isUsingScsiReservation ( ) , usingScsiReservation ) ; }

Target:
public void testUpdateVmDeviceUsingScsiReservationProperty ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = dao.get ( getExistingEntityId ( ) ) ; boolean usingScsiReservation = ! ( vmDevice.isUsingScsiReservation ( ) ) ; vmDevice.setUsingScsiReservation ( usingScsiReservation ) ; dao.update ( vmDevice ) ; org.ovirt.engine.core.common.businessentities.VmDevice vmDeviceFromDb = dao.get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertEquals ( vmDeviceFromDb.isUsingScsiReservation ( ) , usingScsiReservation ) ; }
Source:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getId ( ) ) ; UpdateVmTemplate ( ) ; org.ovirt.engine.core.bll.UpdateVmTemplateCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getId ( ) ) ; UpdateVmTemplate ( ) ; updateWatchdog ( ) ; org.ovirt.engine.core.bll.UpdateVmTemplateCommand.setSucceeded ( true ) ; } }
Source:
public void setIsRoleListHidden ( boolean value ) { if ( ( isRoleListHidden ) != value ) { isRoleListHidden = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "IsRoleListHidden" ) ) ; } if ( ( getIsRoleListHiddenModel ( ) ) != null ) { getIsRoleListHiddenModel ( ) . setEntity ( value ) ; } }

Target:
public void setIsRoleListHidden ( boolean value ) { if ( ( isRoleListHidden ) != value ) { isRoleListHidden = value ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsRoleListHidden" ) ) ; } if ( ( getIsRoleListHiddenModel ( ) ) != null ) { getIsRoleListHiddenModel ( ) . setEntity ( value ) ; } }
Source:
public void testGetHostNetworksByCluster ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < java.lang.String > > map = dao.getHostNetworksByCluster ( org.ovirt.engine.core.dao.network.InterfaceDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( map ) ; org.junit.Assert.assertFalse ( map.isEmpty ( ) ) ; org.junit.Assert.assertNotNull ( map.get ( org.ovirt.engine.core.dao.network.InterfaceDaoTest.VDS_ID ) ) ; org.junit.Assert.assertFalse ( map.get ( org.ovirt.engine.core.dao.network.InterfaceDaoTest.VDS_ID ) . isEmpty ( ) ) ; }

Target:
public void testGetHostNetworksByCluster ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < java.lang.String > > map = dao.getHostNetworksByCluster ( org.ovirt.engine.core.dao.network.InterfaceDaoImplTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( map ) ; org.junit.Assert.assertFalse ( map.isEmpty ( ) ) ; org.junit.Assert.assertNotNull ( map.get ( org.ovirt.engine.core.dao.network.InterfaceDaoImplTest.VDS_ID ) ) ; org.junit.Assert.assertFalse ( map.get ( org.ovirt.engine.core.dao.network.InterfaceDaoImplTest.VDS_ID ) . isEmpty ( ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel vmSnapshotListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel ) ( result.getState ( ) ) ) ; vmSnapshotListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmSnapshotListModel.Cancel ( ) ; vmSnapshotListModel.UpdateActionAvailability ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel vmSnapshotListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel ) ( result.getState ( ) ) ) ; vmSnapshotListModel.getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmSnapshotListModel.cancel ( ) ; vmSnapshotListModel.updateActionAvailability ( ) ; } }
Source:
protected void UpdateActionAvailability ( ) { super . UpdateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( getEntity ( ) ) != null ) && ( ( ( getEntity ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( getEntity ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown ) ) ) ) && ( org.ovirt.engine.ui.uicommonweb.DataProvider.IsWindowsOsType ( getEntity ( ) . getvm_os ( ) ) ) ) ) ; }

Target:
protected void UpdateActionAvailability ( ) { super . UpdateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ( getEntity ( ) ) != null ) && ( ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown ) ) ) ) && ( org.ovirt.engine.ui.uicommonweb.DataProvider.IsWindowsOsType ( getEntity ( ) . getVmOs ( ) ) ) ) && ( getConfigurator ( ) . isClientWindownsExplorer ( ) ) ) ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( id ) == null ? 0 : id.hashCode ( ) ) ; result = ( prime * result ) + ( ( quotaId ) == null ? 0 : quotaId.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( id ) == null ? 0 : id.hashCode ( ) ) ; result = ( prime * result ) + ( ( quotaId ) == null ? 0 : quotaId.hashCode ( ) ) ; result = ( prime * result ) + ( ( diskProfileId ) == null ? 0 : diskProfileId.hashCode ( ) ) ; return result ; }
Source:
public void testUpdateBrickTask ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask asyncTask = new org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask ( ) ; asyncTask.setTaskId ( FixturesTool.GLUSTER_ASYNC_TASK_ID1 ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertEquals ( GlusterStatus.UP , existingBrick.getStatus ( ) ) ; dao.updateBrickTask ( existingBrick.getId ( ) , FixturesTool.GLUSTER_ASYNC_TASK_ID1 ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newEnity = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.Assert.assertEquals ( FixturesTool.GLUSTER_ASYNC_TASK_ID1 , newEnity.getAsyncTask ( ) . getTaskId ( ) ) ; }

Target:
public void testUpdateBrickTask ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask asyncTask = new org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask ( ) ; asyncTask.setTaskId ( FixturesTool.GLUSTER_ASYNC_TASK_ID1 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( existingBrick ) ; org.junit.jupiter.api.Assertions.assertEquals ( GlusterStatus.UP , existingBrick.getStatus ( ) ) ; dao.updateBrickTask ( existingBrick.getId ( ) , FixturesTool.GLUSTER_ASYNC_TASK_ID1 ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newEnity = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.GLUSTER_ASYNC_TASK_ID1 , newEnity.getAsyncTask ( ) . getTaskId ( ) ) ; }
Source:
public void onSave ( ) { if ( ! ( Validate ( ) ) ) { return ; } org.ovirt.engine.core.common.businessentities.Provider provider = new org.ovirt.engine.core.common.businessentities.Provider ( ) ; provider.setName ( ( ( java.lang.String ) ( privateName.getEntity ( ) ) ) ) ; provider.setDescription ( ( ( java.lang.String ) ( privateDescription.getEntity ( ) ) ) ) ; provider.setApiAddress ( ( ( java.lang.String ) ( privateUrl.getEntity ( ) ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.AddProvider , new org.ovirt.engine.core.common.action.ProviderParameters ( provider ) ) ; cancel ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { sourceListModel.getSearchCommand ( ) . execute ( ) ; }