auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.VdcBllMessages message = org.ovirt.engine.core.common.errors.VdcBllMessages.BOND_REFERENCES_NICS_INCOHERENTLY ; return validateCoherentNicIdentification ( bond.getId ( ) , nicId , nicName , message ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return validateCoherentIdentification ( bond.getId ( ) , nicId , nicName , message , existingInterfacesMap ) ; }
Source:
private void setCustomDefinedProperties ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticDataFromParams ) { org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.VMCustomProperties properties = org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.getInstance ( ) . parseProperties ( org.ovirt.engine.core.bll.UpdateVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) , vmStaticDataFromParams.getCustomProperties ( ) ) ; vmStaticDataFromParams.setPredefinedProperties ( properties.getPredefinedProperties ( ) ) ; vmStaticDataFromParams.setUserDefinedProperties ( properties.getUseDefinedProperties ( ) ) ; }

Target:
private boolean vmDeviceChanged ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType deviceType , java.lang.String device , boolean deviceEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.UpdateVmCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmId ( ) , deviceType , device ) ; return deviceEnabled == ( vmDevices.isEmpty ( ) ) ; }
Source:
public org.ovirt.engine.sdk.decorators.VMNIC update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.NIC.class , org.ovirt.engine.sdk.decorators.VMNIC.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.VMNIC update ( java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; if ( correlationId != null ) { headersBuilder.add ( "Correlation-Id" , correlationId ) ; } java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.NIC.class , org.ovirt.engine.sdk.decorators.VMNIC.class , headers ) ; }
Source:
public void updateGlusterServerHook ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook , org.ovirt.engine.core.compat.Guid hostId ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterServerHook" , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , hook.getId ( ) ) . addValue ( "host_id" , hostId ) . addValue ( "checksum" , hook.getChecksum ( ) ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( hook.getStatus ( ) ) ) ) ; }

Target:
public void saveOrUpdateGlusterServerHook ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverHook ) { if ( ( getGlusterServerHook ( serverHook.getHookId ( ) , serverHook.getServerId ( ) ) ) == null ) { saveGlusterServerHook ( serverHook ) ; } else { updateGlusterServerHook ( serverHook ) ; } }
Source:
protected void loadTemplateData ( org.ovirt.engine.core.common.businessentities.VmTemplate template ) { setManagedVideoDevices ( template ) ; if ( ( ( template.getInterfaces ( ) ) == null ) || ( template.getInterfaces ( ) . isEmpty ( ) ) ) { template.setInterfaces ( getVmNetworkInterfaceDao ( ) . getAllForTemplate ( template.getId ( ) ) ) ; } }

Target:
protected void loadTemplateData ( org.ovirt.engine.core.common.businessentities.VmTemplate template ) { setGraphicsAndVideoDevices ( template ) ; if ( ( ( template.getInterfaces ( ) ) == null ) || ( template.getInterfaces ( ) . isEmpty ( ) ) ) { template.setInterfaces ( getVmNetworkInterfaceDao ( ) . getAllForTemplate ( template.getId ( ) ) ) ; } }
Source:
private void reportNonOperationReason ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , java.lang.String compatibleVersions , java.lang.String vdsSupportedVersions ) { java.util.Map < java.lang.String , java.lang.String > customLogValues = new java.util.HashMap < > ( ) ; customLogValues.put ( "CompatibilityVersion" , compatibleVersions ) ; customLogValues.put ( "VdsSupportedVersions" , vdsSupportedVersions ) ; org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVdsId ( ) , reason , customLogValues ) ; runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
private void reportNonOperationReason ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , java.lang.String compatibleVersions , java.lang.String vdsSupportedVersions ) { java.util.Map < java.lang.String , java.lang.String > customLogValues = new java.util.HashMap < > ( ) ; customLogValues.put ( "CompatibilityVersion" , compatibleVersions ) ; customLogValues.put ( "VdsSupportedVersions" , vdsSupportedVersions ) ; org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVdsId ( ) , reason , customLogValues ) ; runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getContext ( ) ) ) ; }
Source:
public void onSuccess ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Frontend: sucessfully executed runAction, determining result!" ) ; handleActionResult ( actionType , parameters , result , ( callback != null ? callback : org.ovirt.engine.ui.frontend.Frontend.NULLABLE_ASYNC_CALLBACK ) , state , showErrorDialog ) ; org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , state ) ; org.ovirt.engine.ui.frontend.communication.RefreshActiveModelEvent.fire ( this , true ) ; }

Target:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.lang.Throwable caught ) { try { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleQueries: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; failureEventHandler ( caught ) ; callback.executed ( f ) ; } finally { fireAsyncQueryFailedEvent ( state ) ; } }
Source:
public static void getStorageDomainList ( 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.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; 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 ) ; }

Target:
public void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public java.lang.Integer parse ( java.lang.CharSequence text ) throws java.text.ParseException { if ( ( text == null ) || ( "" . equals ( text.toString ( ) ) ) ) { return null ; } java.lang.Integer ret = null ; try { ret = java.lang.Integer.parseInt ( text.toString ( ) ) ; } catch ( java.lang.NumberFormatException e ) { } return ret ; }

Target:
public java.lang.Integer parse ( java.lang.CharSequence text ) throws java.text.ParseException { if ( ( text == null ) || ( "" . equals ( text.toString ( ) ) ) ) { return null ; } java.lang.Integer ret = null ; try { ret = java.lang.Integer.parseInt ( text.toString ( ) ) ; } catch ( java.lang.NumberFormatException e ) { throw new java.text.ParseException ( "Unable to parse String to Integer" , 0 ) ; } return ret ; }
Source:
public void setItems ( java.lang.Iterable value ) { if ( ( items ) != value ) { ItemsChanging ( value , items ) ; items = value ; ItemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }

Target:
public void setItems ( java.lang.Iterable value ) { if ( ( items ) != value ) { itemsChanging ( value , items ) ; items = value ; itemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }
Source:
protected void removeVmNetworkInterfaces ( ) { new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) . removeAll ( getVmId ( ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroupId ( ) ) ; getVm ( ) . getStaticData ( ) . setCpuProfileId ( getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult qosBaloonSupported ( ) { org.ovirt.engine.core.compat.Version version = cluster.getCompatibilityVersion ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.QOS_BALLOON_NOT_SUPPORTED ) . when ( ( ( ( version != null ) && ( ( Version.v3_3.compareTo ( version ) ) > 0 ) ) && ( cluster.isEnableBallooning ( ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult qosBaloonSupported ( ) { org.ovirt.engine.core.compat.Version version = cluster.getCompatibilityVersion ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.QOS_BALLOON_NOT_SUPPORTED ) . when ( ( ( ( version != null ) && ( ( Version.v3_3.compareTo ( version ) ) > 0 ) ) && ( cluster.isEnableBallooning ( ) ) ) ) ; }
Source:
public void testSetup ( ) { mockQuotaDAO ( ) ; org.mockito.Mockito.doReturn ( quotaDAO ) . when ( quotaManager ) . getQuotaDAO ( ) ; org.mockito.Mockito.doNothing ( ) . when ( quotaManager ) . auditLog ( org.mockito.Matchers.any ( org.ovirt.engine.core.utils.Pair.class ) ) ; setStoragePool ( ) ; }

Target:
public java.lang.Void answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { if ( ( ( ( org.ovirt.engine.core.utils.Pair ) ( invocation.getArguments ( ) [ 0 ] ) ) . getFirst ( ) ) != null ) { auditLogWritten = true ; } return null ; }
Source:
public void snapshotExistsByGuidReturnsInvalidResultWhenNoSnapshot ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.mockito.Mockito.when ( snapshotDao.exists ( vmId , snapshotId ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.snapshots.SnapshotsValidatorTest.validateInvalidResult ( validator.snapshotExists ( vmId , snapshotId ) , VdcBllMessages.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST ) ; }

Target:
public void vmNotDuringSnapshotReturnsValidForNoSnapshotInProgress ( ) throws java.lang.Exception { org.mockito.Mockito.when ( snapshotDao.exists ( vmId , SnapshotStatus.LOCKED ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.snapshots.SnapshotsValidatorTest.validateValidResult ( validator.vmNotDuringSnapshot ( vmId ) ) ; }
Source:
public void testListCrash ( ) { java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpMacPoolsQueryExpectations ( t ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) { java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpMacPoolsQueryExpectations ( t ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( ) { com.google.gwt.safehtml.shared.SafeHtml tooltip = null ; if ( ( getModel ( ) . isHotPlugAvailable ( ) ) && ( ! ( getModel ( ) . isPlugAvailableByDisks ( false ) ) ) ) { tooltip = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( org.ovirt.engine.ui.common.widget.uicommon.vm.VmDiskListModelTable.constants.diskHotPlugNotSupported ( ) ) ; } return tooltip ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getModel ( ) . getPlugCommand ( ) ; }
Source:
protected void populateTabMap ( ) { getTabNameMapping ( ) . put ( TabName.IPV4_TAB , this . ipv4Tab ) ; getTabNameMapping ( ) . put ( TabName.IPV6_TAB , this . ipv6Tab ) ; getTabNameMapping ( ) . put ( TabName.QOS_TAB , this . qosTab ) ; getTabNameMapping ( ) . put ( TabName.CUSTOM_PROPERTIES_TAB , this . customPropertiesTab ) ; }

Target:
protected void populateTabMap ( ) { getTabNameMapping ( ) . put ( TabName.IPV4_TAB , this . ipv4Tab.getTabListItem ( ) ) ; getTabNameMapping ( ) . put ( TabName.IPV6_TAB , this . ipv6Tab.getTabListItem ( ) ) ; getTabNameMapping ( ) . put ( TabName.QOS_TAB , this . qosTab.getTabListItem ( ) ) ; getTabNameMapping ( ) . put ( TabName.CUSTOM_PROPERTIES_TAB , this . customPropertiesTab.getTabListItem ( ) ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel model ) { providerNetworks.edit ( model.getProviderNetworks ( ) ) ; importedNetworks.edit ( model.getImportedNetworks ( ) ) ; dcColumn.edit ( model.getDataCenters ( ) ) ; driver.edit ( model ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel model ) { splitTable.edit ( model.getProviderNetworks ( ) , model.getImportedNetworks ( ) , null , model.getCancelImportCommand ( ) ) ; dcColumn.edit ( model.getDataCenters ( ) ) ; driver.edit ( model ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.EngineBackupLog ) ) { return false ; } org.ovirt.engine.core.common.businessentities.EngineBackupLog other = ( ( org.ovirt.engine.core.common.businessentities.EngineBackupLog ) ( obj ) ) ; return ( java.util.Objects.equals ( scope , other.scope ) ) && ( java.util.Objects.equals ( doneAt , other.doneAt ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( obj == null ) { return false ; } if ( ( this ) == obj ) { return true ; } if ( ( obj.getClass ( ) ) != ( this . getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.EngineBackupLog other = ( ( org.ovirt.engine.core.common.businessentities.EngineBackupLog ) ( obj ) ) ; return ( java.util.Objects.equals ( scope , other.scope ) ) && ( java.util.Objects.equals ( doneAt , other.doneAt ) ) ; }
Source:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public void getNetworkConnectivityCheckTimeoutInSeconds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 120 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.NetworkConnectivityCheckTimeoutInSeconds , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmInterfaceFilterParameterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.PARAMETER_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; try { resource.update ( getParameter ( ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmInterfaceFilterParameterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.PARAMETER_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; try { resource.update ( getParameter ( ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.Boolean connectAutomatically = java.lang.Boolean.TRUE ; org.ovirt.engine.core.common.businessentities.UserProfile profile = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; if ( profile != null ) { setUserProfile ( profile ) ; connectAutomatically = profile.isUserPortalVmLoginAutomatically ( ) ; } ( ( org.ovirt.engine.ui.uicommonweb.models.EditOptionsModel ) ( model ) ) . getEnableConnectAutomatically ( ) . setEntity ( connectAutomatically ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.Boolean connectAutomatically = java.lang.Boolean.TRUE ; org.ovirt.engine.core.common.businessentities.UserProfile profile = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; if ( profile != null ) { setUserProfile ( profile ) ; connectAutomatically = profile.isUserPortalVmLoginAutomatically ( ) ; ( ( org.ovirt.engine.ui.uicommonweb.models.EditOptionsModel ) ( model ) ) . getPublicKey ( ) . setEntity ( profile.getSshPublicKey ( ) ) ; } ( ( org.ovirt.engine.ui.uicommonweb.models.EditOptionsModel ) ( model ) ) . getEnableConnectAutomatically ( ) . setEntity ( connectAutomatically ) ; }
Source:
public void onTimeout ( ) { if ( org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler._nonOperationalPools.containsKey ( poolId ) ) { try { org.ovirt.engine.core.common.businessentities.storage_pool pool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDAO ( ) . get ( poolId ) ; if ( ( pool != null ) && ( ( pool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational ) ) ) { org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.NonOperationalPoolTreatment ( pool ) ; } } catch ( java.lang.Exception e ) { } } }

Target:
public void onTimeout ( ) { if ( org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler._nonOperationalPools.containsKey ( poolId ) ) { try { org.ovirt.engine.core.common.businessentities.storage_pool pool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( poolId ) ; if ( ( pool != null ) && ( ( pool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational ) ) ) { org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.NonOperationalPoolTreatment ( pool ) ; } } catch ( java.lang.Exception e ) { } } }
Source:
protected void updateScsiPassthroguhChangeability ( ) { getIsScsiPassthrough ( ) . setIsChangeable ( ( ( ! ( getIsReadOnly ( ) . getEntity ( ) ) ) && ( isEditEnabled ( ) ) ) ) ; getIsScsiPassthrough ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.cannotEnableScsiPassthroughForLunReadOnlyDisk ( ) ) ; updateSgIoUnfilteredChangeability ( ) ; }

Target:
protected void updateScsiPassthroughChangeability ( ) { getIsScsiPassthrough ( ) . setIsChangeable ( ( ( ! ( getIsReadOnly ( ) . getEntity ( ) ) ) && ( isEditEnabled ( ) ) ) ) ; getIsScsiPassthrough ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.cannotEnableScsiPassthroughForLunReadOnlyDisk ( ) ) ; updateSgIoUnfilteredChangeability ( ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > mapGroupRecords ( final java.lang.String authzName , final java.util.List < org.ovirt.engine.api.extensions.ExtMap > groups ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.extensions.ExtMap group : groups ) { results.add ( org.ovirt.engine.core.aaa.DirectoryUtils.mapGroupRecord ( authzName , group ) ) ; } return results ; }

Target:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > queryDirectoryGroups ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > directoryGroups = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.extensions.ExtMap group : org.ovirt.engine.core.aaa.AuthzUtils.queryGroupRecords ( extension , namespace , filter , groupsResolving , groupsResolvingRecursive ) ) { directoryGroups.add ( org.ovirt.engine.core.aaa.DirectoryUtils.mapGroupRecordToDirectoryGroup ( org.ovirt.engine.core.aaa.AuthzUtils.getName ( extension ) , group ) ) ; } return directoryGroups ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
protected void initAppTable ( ) { appTable = new org.ovirt.engine.ui.common.widget.editor.ListModelObjectCellTable ( ) ; appTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String object ) { return object ; } } , constants.installedApp ( ) ) ; appTable.getElement ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; com.google.gwt.user.client.ui.ScrollPanel appPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; appPanel.add ( appTable ) ; subTabLayoutPanel.add ( appPanel , constants.importVmApplicationslSubTabLabel ( ) ) ; }

Target:
protected void initAppTable ( ) { appTable = new org.ovirt.engine.ui.common.widget.editor.ListModelObjectCellTable ( ) ; appTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String object ) { return object ; } } , constants.installedApp ( ) ) ; appTable.getElement ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; com.google.gwt.user.client.ui.ScrollPanel appPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; appPanel.add ( appTable ) ; subTabLayoutPanel.add ( appPanel , constants.importVmApplicationslSubTabLabel ( ) ) ; }
Source:
private void validateInterfacesExist ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : params.getInterfaces ( ) ) { java.lang.String nameWithoutVlanId = org.ovirt.engine.core.utils.NetworkUtils.stripVlan ( iface.getName ( ) ) ; if ( ( ! ( getExistingIfaces ( ) . containsKey ( nameWithoutVlanId ) ) ) && ( ! ( bonds.containsKey ( nameWithoutVlanId ) ) ) ) { addViolation ( VdcBllMessages.NETWORK_INTERFACES_DONT_EXIST , nameWithoutVlanId ) ; } } }

Target:
private void validateInterfacesExist ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : params.getInterfaces ( ) ) { updateBaseInterface ( iface ) ; java.lang.String nameWithoutVlanId = org.ovirt.engine.core.utils.NetworkUtils.stripVlan ( iface ) ; if ( ( ! ( getExistingIfaces ( ) . containsKey ( nameWithoutVlanId ) ) ) && ( ! ( bonds.containsKey ( nameWithoutVlanId ) ) ) ) { addViolation ( VdcBllMessages.NETWORK_INTERFACES_DONT_EXIST , nameWithoutVlanId ) ; } } }
Source:
private void mapIsEmpty ( final java.util.Map < java.lang.String , java.lang.String > map ) { org.junit.Assert.assertEquals ( 0 , map.size ( ) ) ; }

Target:
public void testStringToMap ( ) { final java.lang.String str = "ipport=666,secure=true" ; java.util.Map < java.lang.String , java.lang.String > map = org.ovirt.engine.core.common.utils.pm.PowerManagementUtils.pmOptionsStringToMap ( str ) ; org.junit.Assert.assertEquals ( 2 , map.size ( ) ) ; org.junit.Assert.assertEquals ( "666" , map.get ( "ipport" ) ) ; org.junit.Assert.assertEquals ( "true" , map.get ( "secure" ) ) ; }
Source:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void testAllByConnectionId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = dao.getAllByConnectionId ( FixturesTool.EXISTING_STORAGE_CONNECTION_ID ) ; org.junit.Assert.assertEquals ( "Unexpected number of storage domains by connection id" , domains.size ( ) , 1 ) ; org.junit.Assert.assertEquals ( "Wrong storage domain id for search by connection id" , domains.get ( 0 ) . getId ( ) , FixturesTool.EXISTING_DOMAIN_ID_FOR_CONNECTION_ID ) ; }

Target:
public void testAllByConnectionId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = dao.getAllByConnectionId ( new org.ovirt.engine.core.compat.Guid ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ) ; org.junit.Assert.assertEquals ( "Unexpected number of storage domains by connection id" , domains.size ( ) , 1 ) ; org.junit.Assert.assertEquals ( "Wrong storage domain id for search by connection id" , domains.get ( 0 ) . getId ( ) , new org.ovirt.engine.core.compat.Guid ( "c2211b56-8869-41cd-84e1-78d7cb96f31d" ) ) ; }
Source:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmDisksDummies ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksDummies = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageDomainId : getParameters ( ) . getImageToDestinationDomainMap ( ) . values ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( storageDomainId ) ) ) ; disksDummies.add ( diskImage ) ; } return disksDummies ; }

Target:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmDisksDummies ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksDummies = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageDomainId : org.ovirt.engine.core.bll.ImportVmCommand.getParameters ( ) . getImageToDestinationDomainMap ( ) . values ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( storageDomainId ) ) ) ; disksDummies.add ( diskImage ) ; } return disksDummies ; }
Source:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getCopyCommand ( ) ) ) { Copy ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }

Target:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getCopyCommand ( ) ) ) { Copy ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } else if ( command == ( getChangeQuotaCommand ( ) ) ) { changeQuota ( ) ; } else if ( command.getName ( ) . equals ( "onChangeQuota" ) ) { onChangeQuota ( ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( org.ovirt.engine.core.bll.utils.VmUtils.getSnapshotMemorySizeInBytes ( vm ) ) ; image.setVolumeType ( org.ovirt.engine.core.bll.memory.MemoryUtils.storageTypeToMemoryVolumeType ( storageType ) ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; return image ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( org.ovirt.engine.core.bll.utils.VmUtils.getSnapshotMemorySizeInBytes ( vm ) ) ; image.setVolumeType ( org.ovirt.engine.core.bll.memory.MemoryUtils.storageTypeToMemoryVolumeType ( storageType ) ) ; image.setVolumeFormat ( VolumeFormat.RAW ) ; return image ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( key ) == null ? 0 : key.hashCode ( ) ) ; result = ( prime * result ) + ( ( value ) == null ? 0 : value.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( key , value ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > consoleDevices = ( ( java.util.List < java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( returnValue ) ; }
Source:
public void testAllDomainsWithinThreshold ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getSnappableVmDisks ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.name ( ) ) ) ; }

Target:
public void testAllDomainsExistAndActive ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST.name ( ) ) ) ; }
Source:
protected boolean canDoAction ( ) { boolean returnValue = super . canDoAction ( ) ; if ( returnValue && ( ( ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getSysPrepUserName ( ) ) == null ) ^ ( ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getSysPrepPassword ( ) ) == null ) ) ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_RUN_ONCE_WITH_ILLEGAL_SYSPREP_PARAM ) ; returnValue = false ; } return returnValue ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getSysPrepUserName ( ) ) == null ) ^ ( ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getSysPrepPassword ( ) ) == null ) ) { return failCanDoAction ( VdcBllMessages.VM_CANNOT_RUN_ONCE_WITH_ILLEGAL_SYSPREP_PARAM ) ; } return true ; }
Source:
void attachAlert ( org.ovirt.engine.ui.common.widget.panel.AlertPanel alertPanel ) { com.google.gwt.user.client.ui.RootPanel.get ( ) . add ( alertPanel ) ; com.google.gwt.dom.client.Element messageDivElement = alertPanel.getMessageAt ( 0 ) . getElement ( ) ; if ( org.ovirt.engine.ui.common.utils.ElementUtils.detectOverflowUsingScrollWidth ( messageDivElement ) ) { com.google.gwt.safehtml.shared.SafeHtml tooltipContent = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( messageDivElement.getInnerText ( ) ) ; org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipToElement ( tooltipContent , alertPanel.getElement ( ) , Placement.BOTTOM ) ; } }

Target:
void attachAlert ( org.ovirt.engine.ui.common.widget.panel.AlertPanel alertPanel ) { com.google.gwt.user.client.ui.RootPanel.get ( ) . add ( alertPanel ) ; com.google.gwt.dom.client.Element messageDivElement = alertPanel.getMessageAt ( 0 ) . getElement ( ) ; if ( org.ovirt.engine.ui.common.utils.ElementUtils.detectOverflowUsingScrollWidth ( messageDivElement ) ) { alertPanel.getAlertTooltip ( ) . setText ( messageDivElement.getInnerText ( ) ) ; alertPanel.getAlertTooltip ( ) . setPlacement ( Placement.BOTTOM ) ; } }
Source:
public void findNoneOfActiveVmsUsingNetworks ( ) { mockDaos ( ) ; java.util.List < java.lang.String > vmNames = vmInterfaceManager.findActiveVmsUsingNetworks ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , java.util.Collections.singletonList ( ( ( NETWORK_NAME ) + "1" ) ) ) ; org.junit.Assert.assertTrue ( vmNames.isEmpty ( ) ) ; }

Target:
public void findNoneOfActiveVmsUsingNetworks ( ) { mockDaos ( ) ; java.util.List < java.lang.String > vmNames = vmInterfaceManager.findActiveVmsUsingNetworks ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , java.util.Collections.singletonList ( ( ( NETWORK_NAME ) + "1" ) ) ) ; org.junit.Assert.assertTrue ( vmNames.isEmpty ( ) ) ; }
Source:
private void handleQxlClusterLevel ( ) { boolean isLinux = getIsLinuxOS ( ) ; boolean isQxl = ( getDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ; boolean clusterSupportsSinglePci = ( ( getSelectedCluster ( ) ) != null ) && ( ( Version.v3_3.compareTo ( getSelectedCluster ( ) . getcompatibility_version ( ) ) ) <= 0 ) ; getBehavior ( ) . enableSinglePCI ( ( ( isLinux && isQxl ) && clusterSupportsSinglePci ) ) ; }

Target:
private void deactivateInstanceTypeManagerAndUpdateFields ( ) { getBehavior ( ) . deactivateInstanceTypeManager ( new org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager.ActivatedListener ( ) { @ java.lang.Override public void activated ( ) { if ( ( getBehavior ( ) . getInstanceTypeManager ( ) ) != null ) { getBehavior ( ) . getInstanceTypeManager ( ) . updateFields ( ) ; } } } ) ; }
Source:
public void onVirtualMachineSelectionChange ( org.ovirt.engine.ui.webadmin.section.main.presenter.tab.VirtualMachineSelectionChangeEvent event ) { updateMainTabSelection ( event.getSelectedItems ( ) ) ; currentSelectedVm = null ; if ( ( ( event.getSelectedItems ( ) ) != null ) && ( ! ( event.getSelectedItems ( ) . isEmpty ( ) ) ) ) { currentSelectedVm = event.getSelectedItems ( ) . get ( 0 ) ; } updateModel ( ) ; }

Target:
public void onVirtualMachineSelectionChange ( org.ovirt.engine.ui.webadmin.section.main.presenter.tab.VirtualMachineSelectionChangeEvent event ) { updateMainTabSelection ( event.getSelectedItems ( ) ) ; currentSelectedVm = null ; if ( ( ( event.getSelectedItems ( ) ) != null ) && ( ! ( event.getSelectedItems ( ) . isEmpty ( ) ) ) ) { currentSelectedVm = event.getSelectedItems ( ) . get ( 0 ) ; } if ( isVisible ( ) ) { updateModel ( ) ; } }
Source:
public void testUpdate ( ) { existingGroup.setName ( existingGroup.getName ( ) . toUpperCase ( ) ) ; existingGroup.setDomain ( existingGroup.getDomain ( ) . toUpperCase ( ) ) ; dao.update ( existingGroup ) ; org.ovirt.engine.core.common.businessentities.aaa.DbGroup result = dao.get ( existingGroup.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingGroup , result ) ; }

Target:
public void testUpdate ( ) { existingGroup.setName ( existingGroup.getName ( ) . toUpperCase ( ) ) ; existingGroup.setDomain ( existingGroup.getDomain ( ) . toUpperCase ( ) ) ; dao.update ( existingGroup ) ; org.ovirt.engine.core.common.businessentities.aaa.DbGroup result = dao.get ( existingGroup.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( existingGroup , result ) ; }