auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterService ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterService other = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterService ) ( obj ) ) ; if ( ! ( ( ( java.util.Objects.equals ( id , other.getId ( ) ) ) && ( ( serviceType ) == ( other.getServiceType ( ) ) ) ) && ( java.util.Objects.equals ( serviceName , other.getServiceName ( ) ) ) ) ) { return false ; } return true ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterService ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterService other = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterService ) ( obj ) ) ; return ( ( java.util.Objects.equals ( id , other.id ) ) && ( ( serviceType ) == ( other.serviceType ) ) ) && ( java.util.Objects.equals ( serviceName , other.serviceName ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; if ( pool != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetStorageDomainList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ( pools.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }
Source:
public org.ovirt.engine.api.model.IpAddressAssignment adapt ( org.ovirt.engine.api.v3.types.V3IpAddressAssignment from ) { org.ovirt.engine.api.model.IpAddressAssignment to = new org.ovirt.engine.api.model.IpAddressAssignment ( ) ; if ( from.isSetAssignmentMethod ( ) ) { to.setAssignmentMethod ( from.getAssignmentMethod ( ) ) ; } if ( from.isSetIp ( ) ) { to.setIp ( org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( from.getIp ( ) ) ) ; } return to ; }

Target:
public org.ovirt.engine.api.model.IpAddressAssignment adapt ( org.ovirt.engine.api.v3.types.V3IpAddressAssignment from ) { org.ovirt.engine.api.model.IpAddressAssignment to = new org.ovirt.engine.api.model.IpAddressAssignment ( ) ; if ( from.isSetAssignmentMethod ( ) ) { to.setAssignmentMethod ( org.ovirt.engine.api.model.BootProtocol.fromValue ( from.getAssignmentMethod ( ) ) ) ; } if ( from.isSetIp ( ) ) { to.setIp ( org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( from.getIp ( ) ) ) ; } return to ; }
Source:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.sdk.decorators.VMHostDevice > list ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; return list ( url , org.ovirt.engine.sdk.entities.HostDevices.class , org.ovirt.engine.sdk.decorators.VMHostDevice.class ) ; }

Target:
public java.util.List < org.ovirt.engine.sdk.decorators.TemplateGraphicsConsole > list ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; return list ( url , org.ovirt.engine.sdk.entities.GraphicsConsoles.class , org.ovirt.engine.sdk.decorators.TemplateGraphicsConsole.class ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ( getAllUpServers ( ) ) == null ) || ( getAllUpServers ( ) . isEmpty ( ) ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND ) ; return false ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } if ( ( ( getAllUpServers ( ) ) == null ) || ( getAllUpServers ( ) . isEmpty ( ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND ) ; return false ; } return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig getHostNicVfsConfigToRemove ( org.ovirt.engine.core.common.businessentities.HostDevice device ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = networkDeviceHelper.getNicByPciDevice ( device , oldMap.values ( ) ) ; if ( nic == null ) { return null ; } return hostNicVfsConfigDao.getByNicId ( nic.getId ( ) ) ; }

Target:
private void addMissingHostNicVfsConfigsToDb ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > hostNicVfsConfigsToAdd = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.HostDevice device : fetchedMap.values ( ) ) { if ( networkDeviceHelper.isSriovDevice ( device ) ) { addToListIfNotNull ( createHostNicVfsConfigToAddIfNotExist ( device ) , hostNicVfsConfigsToAdd ) ; } } if ( ! ( hostNicVfsConfigsToAdd.isEmpty ( ) ) ) { hostNicVfsConfigDao.saveAllInBatch ( hostNicVfsConfigsToAdd ) ; } }
Source:
public void test32BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v3_3 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_32_BIT ) + 1 ) ) ; mockOsRepository ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }

Target:
public void test32BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_0 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_32_BIT ) + 1 ) ) ; mockOsRepository ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }
Source:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.context.CompensationContext createCompensationContext ( org.ovirt.engine.core.compat.TransactionScopeOption transactionScopeOption , boolean forceCompensation ) { if ( ( transactionScopeOption == ( org.ovirt.engine.core.compat.TransactionScopeOption.Suppress ) ) && ( ! forceCompensation ) ) { return org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) ; } org.ovirt.engine.core.bll.context.DefaultCompensationContext defaultContext = new org.ovirt.engine.core.bll.context.DefaultCompensationContext ( ) ; defaultContext.setCommandId ( commandId ) ; defaultContext.setCommandType ( getClass ( ) . getName ( ) ) ; defaultContext.setBusinessEntitySnapshotDAO ( getBusinessEntitySnapshotDAO ( ) ) ; defaultContext.setSnapshotSerializer ( org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) ) ; return defaultContext ; }

Target:
protected org.ovirt.engine.core.bll.interfaces.BackendInternal getBackend ( ) { return backendInternal ; }
Source:
org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentNotRemoved ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.ovirt.engine.core.compat.Guid networkAttachmentId = networkAttachment.getId ( ) ; if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentInRemoveList = params.getRemovedNetworkAttachments ( ) . contains ( networkAttachmentId ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_ATTACHMENT_IN_BOTH_LISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "NETWORK_ATTACHMENT_IN_BOTH_LISTS_ENTITY" , networkAttachmentId.toString ( ) ) ) . when ( attachmentInRemoveList ) ; }

Target:
org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentNotRemoved ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.ovirt.engine.core.compat.Guid networkAttachmentId = networkAttachment.getId ( ) ; if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentInRemoveList = params.getRemovedNetworkAttachments ( ) . contains ( networkAttachmentId ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_IN_BOTH_LISTS ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , networkAttachmentId.toString ( ) ) ) . when ( attachmentInRemoveList ) ; }
Source:
private java.lang.String produceCollectionVariables ( ) { java.lang.StringBuffer subCollectionVariables = new java.lang.StringBuffer ( ) ; for ( org.ovirt.engine.sdk.codegen.holders.CollectionHolder ch : this . collectionsHolder.values ( ) ) { subCollectionVariables.append ( this . variableTemplate.getTemplate ( ch.getName ( ) , org.ovirt.engine.sdk.codegen.utils.StringUtils.toLowerCase ( ch.getName ( ) ) ) ) ; } return subCollectionVariables.toString ( ) ; }

Target:
private java.lang.String produceCollectionVariables ( ) { java.util.List < java.lang.String > keys = new java.util.ArrayList ( collectionsHolder.keySet ( ) ) ; java.util.Collections.sort ( keys ) ; java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; for ( java.lang.String key : keys ) { org.ovirt.engine.sdk.codegen.holders.CollectionHolder ch = collectionsHolder.get ( key ) ; java.lang.String name = ch.getName ( ) ; buffer.append ( variableTemplate.getTemplate ( name , org.ovirt.engine.sdk.codegen.utils.StringUtils.toLowerCase ( name ) ) ) ; } return buffer.toString ( ) ; }
Source:
public void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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 ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void getAllErrata ( 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.Erratum > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetErrataForSystem , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getAllErrata ( 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.Erratum > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetErrataForEngine , new org.ovirt.engine.core.common.queries.GetErrataCountsParameters ( ) , aQuery ) ; }
Source:
public void tearDown ( ) throws java.lang.Exception { org.mockito.Mockito.verify ( queryStartEvent , org.mockito.Mockito.atLeastOnce ( ) ) . raise ( org.ovirt.engine.ui.frontend.Frontend.class , EventArgs.Empty ) ; org.mockito.Mockito.verify ( queryCompleteEvent , org.mockito.Mockito.atLeastOnce ( ) ) . raise ( org.ovirt.engine.ui.frontend.Frontend.class , EventArgs.Empty ) ; org.junit.Assert.assertEquals ( "Context should be 'test'" , frontend.getCurrentContext ( ) , "test" ) ; }

Target:
public void tearDown ( ) throws java.lang.Exception { org.mockito.Mockito.verify ( queryStartEvent , org.mockito.Mockito.atLeastOnce ( ) ) . raise ( org.ovirt.engine.ui.frontend.Frontend.class , EventArgs.EMPTY ) ; org.mockito.Mockito.verify ( queryCompleteEvent , org.mockito.Mockito.atLeastOnce ( ) ) . raise ( org.ovirt.engine.ui.frontend.Frontend.class , EventArgs.EMPTY ) ; org.junit.Assert.assertEquals ( "Context should be 'test'" , frontend.getCurrentContext ( ) , "test" ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.ExternalSubnet object ) { return java.lang.String.join ( ", " , object.getDnsServers ( ) ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.ExternalSubnet object ) { if ( ( object != null ) && ( ( object.getDnsServers ( ) ) != null ) ) { return java.lang.String.join ( ", " , object.getDnsServers ( ) ) ; } else { return "" ; } }
Source:
public void acquireSession ( java.lang.String userNameWithDomain , java.lang.String password ) { com.google.gwt.http.client.RequestBuilder requestBuilder = createRequest ( ) ; setPersistentAuthHeader ( requestBuilder ) ; requestBuilder.setUser ( userNameWithDomain ) ; requestBuilder.setPassword ( password ) ; sendRequest ( requestBuilder , new org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.RestApiRequestCallback ( ) { @ java.lang.Override protected void processResponse ( com.google.gwt.http.client.Response response ) { java.lang.String sessionIdFromHeader = response.getHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.SESSION_ID_HEADER ) ; if ( sessionIdFromHeader != null ) { setCurrentSessionId ( sessionIdFromHeader ) ; } reuseCurrentSession ( ) ; } } ) ; }

Target:
public void reuseSession ( ) { java.lang.String sessionId = getSessionId ( ) ; if ( sessionId != null ) { org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionAcquiredEvent.fire ( eventBus , sessionId ) ; } else { org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.logger.severe ( "Engine REST API session ID is not available" ) ; } }
Source:
public void stopHostWhichIsPoweredDown ( ) { setupCommand ( setupCommandParams ( FenceActionType.STOP ) ) ; setupBrokerResult ( createBrokerResultMap ( 0 , "" , "off" , null ) ) ; command.execute ( ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = ( ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ) ( command.getVDSReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertEquals ( Status.SKIPPED_ALREADY_IN_STATUS , result.getStatus ( ) ) ; org.junit.Assert.assertEquals ( PowerStatus.UNKNOWN , result.getPowerStatus ( ) ) ; }

Target:
public void stopHostWhichIsPoweredDown ( ) { setupCommand ( setupCommandParams ( FenceActionType.STOP ) ) ; setupBrokerResult ( createBrokerResultMap ( 0 , "" , "off" , null ) ) ; command.execute ( ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = ( ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ) ( command.getVDSReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( Status.SKIPPED_ALREADY_IN_STATUS , result.getStatus ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( PowerStatus.UNKNOWN , result.getPowerStatus ( ) ) ; }
Source:
private void updateDisplayProtocol ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > displayTypes = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDisplayTypes ( osType , cluster.getcompatibility_version ( ) ) ; initDisplayProtocolWithTypes ( displayTypes ) ; }

Target:
private void updateDisplayAndGraphics ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.DisplayType > > graphicsAndDisplays = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGraphicsAndDisplays ( osType , cluster.getcompatibility_version ( ) ) ; initDisplayModels ( graphicsAndDisplays ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( ( p.getusage_cpu_percent ( ) ) >= ( p.gethigh_utilization ( ) ) ) && ( ( p.getcpu_over_commit_time_stamp ( ) ) != null ) ) && ( ( ( new java.util.Date ( ) . getTime ( ) ) - ( p.getcpu_over_commit_time_stamp ( ) . getTime ( ) ) ) >= ( ( ( p.getcpu_over_commit_duration_minutes ( ) ) * 1000 ) * 60 ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( ( p.getUsageCpuPercent ( ) ) >= ( p.getHighUtilization ( ) ) ) && ( ( p.getCpuOverCommitTimestamp ( ) ) != null ) ) && ( ( ( new java.util.Date ( ) . getTime ( ) ) - ( p.getCpuOverCommitTimestamp ( ) . getTime ( ) ) ) >= ( ( ( p.getCpuOverCommitDurationMinutes ( ) ) * 1000 ) * 60 ) ) ; }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Cell.Context context , com.google.gwt.dom.client.Element parent , java.lang.Boolean value , com.google.gwt.safehtml.shared.SafeHtml tooltipContent , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < java.lang.Boolean > valueUpdater ) { if ( tooltipContent == null ) { tooltipContent = getTooltip ( value ) ; } org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.handleTooltipEvent ( parent , tooltipContent , event ) ; super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Cell.Context context , com.google.gwt.dom.client.Element parent , java.lang.Boolean value , java.lang.String tooltipContent , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < java.lang.Boolean > valueUpdater ) { java.lang.String tooltip ; if ( tooltipContent == null ) { tooltip = getTooltip ( value ) ; } else { tooltip = tooltipContent ; } org.ovirt.engine.ui.common.widget.tooltip.ElementTooltipUtils.setTooltipOnElement ( tooltip , parent ) ; super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; }
Source:
protected org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao getVmNetworkInterfaceDao ( ) { return new org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoDbFacadeImpl ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > getAllForVm ( org.ovirt.engine.core.compat.Guid id ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; }

Target:
public void testBootFromNetworkNoNetwork ( ) { org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao.class ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) . when ( dao ) . getAllForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( dao ) . when ( runVmValidator ) . getVmNetworkInterfaceDao ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.N , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , false , VdcBllMessages.VM_CANNOT_RUN_FROM_NETWORK_WITHOUT_NETWORK ) ; }
Source:
public void removedLabelExistsOnTheHostNotExistValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( ) ; nic.setLabels ( createSet ( "lbl1" ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = java.util.Arrays.asList ( nic ) ; org.junit.Assert.assertThat ( createNicLabelValidator ( nics ) . removedLabelExistsOnTheHost ( "lbl1" ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void removedLabelExistsOnTheHostNotExistValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( ) ; nic.setLabels ( createSet ( "lbl1" ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = java.util.Collections.singletonList ( nic ) ; org.junit.Assert.assertThat ( createNicLabelValidator ( nics ) . removedLabelExistsOnTheHost ( "lbl1" ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.utils.Pair < java.lang.Boolean , java.lang.Integer > result = Connect ( org.ovirt.engine.core.bll.storage.ConnectStorageToVdsCommand.getVds ( ) . getId ( ) ) ; setSucceeded ( result.getFirst ( ) ) ; if ( ! ( result.getFirst ( ) ) ) { setErrorMessageAtReturn ( result ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.Integer > result = Connect ( org.ovirt.engine.core.bll.storage.ConnectStorageToVdsCommand.getVds ( ) . getId ( ) ) ; setSucceeded ( result.getFirst ( ) ) ; if ( ! ( result.getFirst ( ) ) ) { setErrorMessageAtReturn ( result ) ; } }
Source:
public void getZeroSnapshotsByMemory ( ) { org.junit.Assert.assertEquals ( 0 , dao.getNumOfSnapshotsByMemory ( org.ovirt.engine.core.dao.SnapshotDaoTest.NON_EXISTING_MEMORY_VOLUME ) ) ; }

Target:
public void getZeroSnapshotsByMemory ( ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ; snapshot.setMemoryDiskId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; snapshot.setMetadataDiskId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertEquals ( 0 , dao.getNumOfSnapshotsByDisks ( snapshot ) ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getPrestartedVmToAttach ( org.ovirt.engine.core.compat.Guid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getVmPoolDAO ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Up ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( canAttachPrestartedVmToUser ( map.getvm_guid ( ) ) ) { return map.getvm_guid ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
private org.ovirt.engine.core.compat.Guid getPrestartedVmToAttach ( org.ovirt.engine.core.compat.Guid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Up ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( canAttachPrestartedVmToUser ( map.getvm_guid ( ) ) ) { return map.getvm_guid ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( null ) ; org.ovirt.engine.ui.frontend.Frontend.setLoginPassword ( null ) ; callback.asyncCallback.onSuccess ( callback.getModel ( ) , null ) ; } }

Target:
public static void LoginAsync ( final java.lang.String userName , final java.lang.String password , final java.lang.String domain , final org.ovirt.engine.ui.frontend.AsyncQuery callback ) { org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync service = GenericApiGWTServiceAsync.Util.getInstance ( ) ; org.ovirt.engine.ui.frontend.Frontend.LoginAsync ( userName , password , domain , callback , service ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filterByArchitecture ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters , org.ovirt.engine.core.common.businessentities.ArchitectureType targetArchitecture ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredClusters = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( cluster.getArchitecture ( ) . equals ( targetArchitecture ) ) { filteredClusters.add ( cluster ) ; } } return filteredClusters ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > filterByArchitecture ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters , org.ovirt.engine.core.common.businessentities.ArchitectureType targetArchitecture ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > filteredClusters = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : clusters ) { if ( cluster.getArchitecture ( ) . equals ( targetArchitecture ) ) { filteredClusters.add ( cluster ) ; } } return filteredClusters ; }
Source:
public void execute ( int iterationId ) { try { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( getStorageDomain ( ) . getstorage_type ( ) ) . connectStorageToDomainByVdsId ( getStorageDomain ( ) , getVdss ( ) . get ( iterationId ) . getId ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.storage.ConnectSingleAsyncOperation.log.errorFormat ( "Failed to connect host {0} to storage pool {1}. Exception: {3}" , getVdss ( ) . get ( iterationId ) . getvds_name ( ) , getStoragePool ( ) . getname ( ) , e ) ; } }

Target:
public void execute ( int iterationId ) { try { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( getStorageDomain ( ) . getstorage_type ( ) ) . connectStorageToDomainByVdsId ( getStorageDomain ( ) , getVdss ( ) . get ( iterationId ) . getId ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.storage.ConnectSingleAsyncOperation.log.errorFormat ( "Failed to connect host {0} to storage pool {1}. Exception: {3}" , getVdss ( ) . get ( iterationId ) . getVdsName ( ) , getStoragePool ( ) . getname ( ) , e ) ; } }
Source:
public void confFileNotExistInTar ( ) { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdsCommand ( VDSCommandType.RetrieveImageData , successfulReturnValue ( new byte [ 10 ] ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }

Target:
public void confFileNotExistInTar ( ) { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdcCommand ( VdcActionType.RetrieveImageData , successfulVdcReturnValue ( new byte [ 10 ] ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }
Source:
public void addAllocateNewMacAddress ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = createNewInterface ( ) ; java.lang.String newMac = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( macPoolManager.allocateNewMac ( ) ) . thenReturn ( newMac ) ; vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , true , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.VERSION_3_2 ) ; org.junit.Assert.assertEquals ( newMac , iface.getMacAddress ( ) ) ; }

Target:
public void addAllocateNewMacAddress ( ) { org.ovirt.engine.core.common.businessentities.network.VmNic iface = createNewInterface ( ) ; java.lang.String newMac = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( macPoolManager.allocateNewMac ( ) ) . thenReturn ( newMac ) ; vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , true , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.VERSION_3_2 ) ; org.junit.Assert.assertEquals ( newMac , iface.getMacAddress ( ) ) ; }
Source:
public void useDefaultMTU ( ) { org.ovirt.engine.core.common.businessentities.network net = new org.ovirt.engine.core.common.businessentities.network ( ) ; net.setMtu ( 0 ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.businessentities.network > > validate = validate ( net ) ; junit.framework.Assert.assertTrue ( ( ( validate.size ( ) ) == 0 ) ) ; }

Target:
public void useDefaultMTU ( ) { java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.utils.MTUValidatorTest.MtuContainer > > validate = validate ( new org.ovirt.engine.core.common.utils.MTUValidatorTest.MtuContainer ( 0 ) ) ; junit.framework.Assert.assertTrue ( ( ( validate.size ( ) ) == 0 ) ) ; }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { networkEditor.setLabel ( constants.networkVnicProfile ( ) ) ; nameEditor.setLabel ( constants.nameVnicProfile ( ) ) ; descriptionEditor.setLabel ( constants.descriptionVnicProfile ( ) ) ; portMirroringEditor.setLabel ( constants.portMirroringVnicProfile ( ) ) ; publicUseEditor.setLabel ( constants.publicUseVnicProfile ( ) ) ; networkQoSEditor.setLabel ( constants.profileQoSInstanceTypeLabel ( ) ) ; }

Target:
private void localize ( ) { networkEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.networkVnicProfile ( ) ) ; nameEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.nameVnicProfile ( ) ) ; descriptionEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.descriptionVnicProfile ( ) ) ; passthroughEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.passthorughVnicProfile ( ) ) ; portMirroringEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.portMirroringVnicProfile ( ) ) ; publicUseEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.publicUseVnicProfile ( ) ) ; networkQoSEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.profileQoSInstanceTypeLabel ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturn pause ( java.lang.String vmId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.pause" ) . withParameter ( "vmID" , vmId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturn ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterVolumeResetBrickStart ( java.lang.String volumeName , java.lang.String existingBrickDir ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.resetBrickStart" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "existingBrick" , existingBrickDir ) . 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.StatusOnlyReturn ( response ) ; }
Source:
public void setEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate value ) { cluster = null ; super . setEntity ( value ) ; if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getClusterById ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object listModel , java.lang.Object returnValue ) { cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; updateActionAvailability ( ) ; } } ) , getEntity ( ) . getVdsGroupId ( ) ) ; } }

Target:
public void setEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate value ) { cluster = null ; super . setEntity ( value ) ; if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getClusterById ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object listModel , java.lang.Object returnValue ) { cluster = ( ( org.ovirt.engine.core.common.businessentities.Cluster ) ( returnValue ) ) ; updateActionAvailability ( ) ; } } ) , getEntity ( ) . getClusterId ( ) ) ; } }
Source:
public void testUpdateAll ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmDynamic existingVm2 = dao.get ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ) ; existingVm.setStatus ( VMStatus.Down ) ; existingVm2.setVmIp ( "111" ) ; existingVm2.setVmFQDN ( "localhost.localdomain" ) ; dao.updateAll ( java.util.Arrays.asList ( existingVm , existingVm2 ) ) ; org.junit.Assert.assertEquals ( existingVm , dao.get ( existingVm.getId ( ) ) ) ; org.junit.Assert.assertEquals ( existingVm2 , dao.get ( existingVm2.getId ( ) ) ) ; }

Target:
public void testUpdateAll ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmDynamic existingVm2 = dao.get ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ) ; existingVm.setStatus ( VMStatus.Down ) ; existingVm2.setIp ( "111" ) ; existingVm2.setFqdn ( "localhost.localdomain" ) ; dao.updateAll ( java.util.Arrays.asList ( existingVm , existingVm2 ) ) ; org.junit.Assert.assertEquals ( existingVm , dao.get ( existingVm.getId ( ) ) ) ; org.junit.Assert.assertEquals ( existingVm2 , dao.get ( existingVm2.getId ( ) ) ) ; }
Source:
public void getRoleList ( 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public synchronized boolean hasTasksForEntityIdAndAction ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.common.action.VdcActionType type ) { if ( ( _tasks ) != null ) { for ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task : _tasks.values ( ) ) { if ( ( isCurrentTaskLookedFor ( id , task ) ) && ( type.equals ( task.getParameters ( ) . getDbAsyncTask ( ) . getaction_type ( ) ) ) ) { return true ; } } } return false ; }

Target:
public synchronized boolean hasTasksForEntityIdAndAction ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.common.action.VdcActionType type ) { if ( ( _tasks ) != null ) { for ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task : _tasks.values ( ) ) { if ( ( isCurrentTaskLookedFor ( id , task ) ) && ( type.equals ( task.getParameters ( ) . getDbAsyncTask ( ) . getActionType ( ) ) ) ) { return true ; } } } return false ; }
Source:
public void setMigrationHandler ( org.ovirt.engine.core.bll.scheduling.MigrationHandler migrationHandler ) { if ( ( this . migrationHandler ) != null ) { throw new java.lang.RuntimeException ( "Load balance migration handler should be set only once" ) ; } this . migrationHandler = migrationHandler ; }

Target:
public void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) . scheduleAFixedDelayJob ( this , "performLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }
Source:
public void modifiedAttachmentNotRemovedAttachmentModifiedButNotRemovedValid ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( params ) . setHost ( host ) . build ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment modifiedAttachment = createNetworkAttachment ( new org.ovirt.engine.core.common.businessentities.network.Network ( ) ) ; org.junit.Assert.assertThat ( validator.modifiedAttachmentNotRemoved ( modifiedAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateQosOverriddenInterfacesWhenNoAttachmentsPassed ( ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateQosOverriddenInterfaces ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult isVmInterfacesAttachedToVmNetworks ( final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , java.util.Set < java.lang.String > interfaceNetworkNames ) { java.util.List < java.lang.String > nonVmNetworkNames = org.ovirt.engine.core.utils.NetworkUtils.filterNonVmNetworkNames ( clusterNetworks , interfaceNetworkNames ) ; return nonVmNetworkNames.isEmpty ( ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NOT_A_VM_NETWORK , java.lang.String.format ( "$networks %1$s" , org.apache.commons.lang.StringUtils.join ( nonVmNetworkNames , "," ) ) ) ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateInterfacesAttachedToVmNetworks ( final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , java.util.Set < java.lang.String > interfaceNetworkNames ) { java.util.List < java.lang.String > nonVmNetworkNames = org.ovirt.engine.core.utils.NetworkUtils.filterNonVmNetworkNames ( clusterNetworks , interfaceNetworkNames ) ; return nonVmNetworkNames.isEmpty ( ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NOT_A_VM_NETWORK , java.lang.String.format ( "$networks %1$s" , org.apache.commons.lang.StringUtils.join ( nonVmNetworkNames , "," ) ) ) ; }