auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void doTestLocaleOverride ( java.lang.String name ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( name ) ; java.util.List < java.lang.String > errors = et.translateErrorText ( java.util.Collections.singletonList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) , java.util.Locale.ITALIAN ) ; org.junit.Assert.assertEquals ( "Unexpected Size" , 1 , errors.size ( ) ) ; org.junit.Assert.assertEquals ( "String should equal" , "Impossibile trovare il desktop" , errors.get ( 0 ) ) ; java.lang.String error = et.translateErrorTextSingle ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT , java.util.Locale.ITALIAN ) ; org.junit.Assert.assertEquals ( "String should equal" , "Impossibile trovare il desktop" , error ) ; }

Target:
private static void doTestLocaleOverride ( java.lang.String name ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( name ) ; java.util.List < java.lang.String > errors = et.translateErrorText ( java.util.Collections.singletonList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) , java.util.Locale.ITALIAN ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , errors.size ( ) , "Unexpected Size" ) ; org.junit.jupiter.api.Assertions.assertEquals ( "Impossibile trovare il desktop" , errors.get ( 0 ) , "String should equal" ) ; java.lang.String error = et.translateErrorTextSingle ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT , java.util.Locale.ITALIAN ) ; org.junit.jupiter.api.Assertions.assertEquals ( "Impossibile trovare il desktop" , error , "String should equal" ) ; }
Source:
private void removeVmStatlessImages ( ) { isFailedStatlessSnapshot = true ; org.ovirt.engine.core.bll.VmPoolHandler.removeVmStatelessImages ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }

Target:
private void removeVmStatlessImages ( ) { isFailedStatlessSnapshot = true ; org.ovirt.engine.core.bll.VmPoolHandler.ProcessVmPoolOnStopVm ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }
Source:
com.google.gwt.http.client.RequestBuilder createRequest ( ) { com.google.gwt.http.client.RequestBuilder requestBuilder = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , restApiBaseUrl ) ; requestBuilder.setHeader ( "Prefer" , "persistent-auth, csrf-protection" ) ; requestBuilder.setHeader ( "Session-TTL" , getSessionTimeout ( ) ) ; java.lang.String sessionId = getSessionId ( ) ; if ( sessionId != null ) { requestBuilder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.SESSION_ID_HEADER , sessionId ) ; } return requestBuilder ; }

Target:
com.google.gwt.http.client.RequestBuilder createRequest ( java.lang.String engineAuthToken ) { com.google.gwt.http.client.RequestBuilder builder = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , restApiBaseUrl ) ; builder.setHeader ( "Session-TTL" , restApiSessionTimeout ) ; java.lang.String preferValue = "persistent-auth, csrf-protection" ; if ( engineAuthToken != null ) { preferValue += ", new-auth" ; builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.ENGINE_AUTH_TOKEN_HEADER , engineAuthToken ) ; } builder.setHeader ( "Prefer" , preferValue ) ; java.lang.String sessionId = getSessionId ( ) ; if ( sessionId != null ) { builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.SESSION_ID_HEADER , sessionId ) ; } return builder ; }
Source:
public boolean isValid ( java.lang.Integer value , javax.validation.ConstraintValidatorContext context ) { return value == null ? true : ( value >= ( min ) ) && ( value <= ( max ) ) ; }

Target:
public boolean isValid ( java.lang.Integer value , javax.validation.ConstraintValidatorContext context ) { boolean result = ( value == null ) ? true : ( value >= ( min ) ) && ( value <= ( max ) ) ; if ( ! result ) { context.buildConstraintViolationWithTemplate ( rangeMessage ) . addConstraintViolation ( ) ; } return result ; }
Source:
private void failureEventHandler ( final java.lang.Throwable caught ) { java.lang.String errorMessage ; if ( caught instanceof com.google.gwt.user.client.rpc.StatusCodeException ) { errorMessage = ( ( getConstants ( ) . requestToServerFailedWithCode ( ) ) + ": " ) + ( ( ( com.google.gwt.user.client.rpc.StatusCodeException ) ( caught ) ) . getStatusCode ( ) ) ; } else { errorMessage = ( ( getConstants ( ) . requestToServerFailed ( ) ) + ": " ) + ( caught.getLocalizedMessage ( ) ) ; } failureEventHandler ( errorMessage ) ; }

Target:
public void runMultipleActions ( final java.util.List < org.ovirt.engine.core.common.action.VdcActionType > actionTypes , final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , final java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks , final org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback failureCallback , final java.lang.Object state , boolean aggregateErrors ) { runMultipleActions ( actionTypes , parameters , callbacks , failureCallback , state , aggregateErrors , ( aggregateErrors ? new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionType > ( ) : null ) , ( aggregateErrors ? new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) : null ) ) ; }
Source:
protected void onSelectedItemChanged ( ) { super . onSelectedItemChanged ( ) ; UpdateActionAvailability ( ) ; }

Target:
public void postOnSaveInternal ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; cancel ( ) ; if ( ( ( model.getIsNew ( ) ) && ( returnValue != null ) ) && ( returnValue.getSucceeded ( ) ) ) { setGuideContext ( returnValue.getActionReturnValue ( ) ) ; updateActionAvailability ( ) ; getGuideCommand ( ) . execute ( ) ; } }
Source:
public void setEnabled ( boolean enabled ) { contentWidget.setEnabled ( enabled ) ; if ( enabled ) { labelElement.replaceClassName ( style.labelDisabled ( ) , style.labelEnabled ( ) ) ; } else { labelElement.replaceClassName ( style.labelEnabled ( ) , style.labelDisabled ( ) ) ; } }

Target:
public void setEnabled ( boolean enabled ) { contentWidget.setEnabled ( enabled ) ; if ( enabled ) { labelElement.replaceClassName ( style.labelDisabled ( ) , style.labelEnabled ( ) ) ; } else { labelElement.replaceClassName ( style.labelEnabled ( ) , style.labelDisabled ( ) ) ; } updateWidgetTitle ( null ) ; }
Source:
private boolean isVmInterfacesAttachedToVmNetworks ( ) { java.util.List < java.lang.String > nonVmNetworkNames = org.ovirt.engine.core.utils.NetworkUtils.filterNonVmNetworkNames ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDAO ( ) . getAllForCluster ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getvds_group_id ( ) ) , org.ovirt.engine.core.common.businessentities.Entities.interfacesByNetworkName ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getInterfaces ( ) ) . keySet ( ) ) ; if ( ( nonVmNetworkNames.size ( ) ) > 0 ) { AddCustomValue ( "Networks" , org.apache.commons.lang.StringUtils.join ( nonVmNetworkNames , "," ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NOT_A_VM_NETWORK ) ; return false ; } return true ; }

Target:
private boolean isVmInterfacesAttachedToVmNetworks ( final java.util.List < org.ovirt.engine.core.common.businessentities.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 ) ; if ( ( nonVmNetworkNames.size ( ) ) > 0 ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NOT_A_VM_NETWORK ) ; addCanDoActionMessage ( java.lang.String.format ( "$networks %1$s" , org.apache.commons.lang.StringUtils.join ( nonVmNetworkNames , "," ) ) ) ; return false ; } return true ; }
Source:
public void testClusterLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.CLUSTER_ID ) ; cluster.setDataCenter ( new org.ovirt.engine.api.model.DataCenter ( ) ) ; cluster.getDataCenter ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.DATA_CENTER_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( cluster ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.CLUSTER_HREF , cluster.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.DATA_CENTER_HREF , cluster.getDataCenter ( ) . getHref ( ) ) ; }

Target:
public void testClusterLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.CLUSTER_ID ) ; cluster.setDataCenter ( new org.ovirt.engine.api.model.DataCenter ( ) ) ; cluster.getDataCenter ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.DATA_CENTER_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( cluster ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.CLUSTER_HREF , cluster.getHref ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.DATA_CENTER_HREF , cluster.getDataCenter ( ) . getHref ( ) ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { if ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getTemplateType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { return true ; } return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getMasterVm ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getUserId ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { if ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getTemplateType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { return true ; } return validate ( cpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getMasterVm ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getUserId ( ) ) ) ; }
Source:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.column.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { com.google.gwt.resources.client.ImageResource image = resources.triangleDown ( ) ; com.google.gwt.safehtml.shared.SafeHtml imageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( image ) . getHTML ( ) ) ; sb.append ( templates.image ( imageHtml ) ) ; }

Target:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.column.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( ! ( isVisible ( value ) ) ) { return ; } com.google.gwt.resources.client.ImageResource image = resources.expanderDownImage ( ) ; com.google.gwt.safehtml.shared.SafeHtml imageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( image ) . getHTML ( ) ) ; sb.append ( templates.image ( imageHtml ) ) ; }
Source:
public void testWithNonHEHost ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "3" ) ; hostedEngine.setVmMemSizeMb ( 7000 ) ; hosts.get ( 2 ) . setHighlyAvailableIsActive ( false ) ; hosts.get ( 3 ) . setPhysicalMemMb ( 2048 ) ; hosts.get ( 4 ) . setPhysicalMemMb ( 2048 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.Assert.assertEquals ( 4 , result.size ( ) ) ; }

Target:
public void testWithNonHEHost ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "3" ) ; hostedEngine.setVmMemSizeMb ( 7000 ) ; hosts.get ( 2 ) . setHighlyAvailableIsActive ( false ) ; hosts.get ( 3 ) . setPhysicalMemMb ( 2048 ) ; hosts.get ( 4 ) . setPhysicalMemMb ( 2048 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.jupiter.api.Assertions.assertEquals ( 4 , result.size ( ) ) ; }
Source:
protected org.ovirt.engine.api.model.Network getClusterNetwork ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid id , java.lang.String name ) { for ( org.ovirt.engine.api.model.Network entity : getBackendCollection ( org.ovirt.engine.api.model.Network.class , VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) ) ) { if ( ( ( id != null ) && ( id.equals ( entity.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( entity.getName ( ) ) ) ) ) { return entity ; } } return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.Network lookupClusterNetwork ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid id , java.lang.String name , java.util.List < org.ovirt.engine.api.restapi.resource.Network > networks ) { for ( org.ovirt.engine.api.restapi.resource.Network network : networks ) { if ( ( ( id != null ) && ( id.equals ( network.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( network.getName ( ) ) ) ) ) { return network ; } } return null ; }
Source:
protected com.google.gwt.safehtml.shared.SafeHtml getHeaderHtml ( ) { if ( ( headerImage ) == null ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.common.widget.table.header.ImageResourceHeader.CONSTANTS.empty ( ) ) ; } return org.ovirt.engine.ui.common.widget.table.header.ImageResourceHeader.TEMPLATES.headerImage ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( headerImage ) . getHTML ( ) ) ) ; }

Target:
protected com.google.gwt.safehtml.shared.SafeHtml getHeaderHtml ( ) { if ( ( headerImage ) == null ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.common.widget.table.header.ImageResourceHeader.constants.empty ( ) ) ; } if ( isInline ( ) ) { return org.ovirt.engine.ui.common.widget.table.header.ImageResourceHeader.templates.tableHeaderInlineImage ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( headerImage ) . getHTML ( ) ) ) ; } else { return org.ovirt.engine.ui.common.widget.table.header.ImageResourceHeader.templates.tableHeaderImage ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( headerImage ) . getHTML ( ) ) ) ; } }
Source:
public org.ovirt.engine.core.compat.Guid getStorageDomainId ( ) { if ( ( storageDomainId ) == null ) { storageDomainId = getCinderDisk ( ) . getStorageIds ( ) . get ( 0 ) ; } return storageDomainId ; }

Target:
public org.ovirt.engine.core.compat.Guid getStorageDomainId ( ) { if ( ( storageDomainId ) == null ) { storageDomainId = ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getDiskDao ( ) . get ( getDisk ( ) . getId ( ) ) ) ) . getStorageIds ( ) . get ( 0 ) ; storageDomainId = getDisk ( ) . getStorageIds ( ) . get ( 0 ) ; } return storageDomainId ; }
Source:
private org.ovirt.engine.core.common.action.VdcActionType getParentCommandType ( ) { org.ovirt.engine.core.common.action.VdcActionType parentCommand = org.ovirt.engine.core.common.action.VdcActionType.Unknown ; if ( parentHasCallback ( ) ) { if ( ( getTaskType ( ) ) == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.notSupported ) ) { parentCommand = getParameters ( ) . getParentCommand ( ) ; } } else { parentCommand = getParameters ( ) . getParentCommand ( ) ; } return parentCommand ; }

Target:
protected boolean isExecutedAsChildCommand ( ) { return ( getParameters ( ) . getParentCommand ( ) ) != ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ; }
Source:
public static 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.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.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 static void GetMinimalVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VMMinMemorySizeInMB , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
protected void updateAllInBatch ( java.lang.String procedureName , java.util.Collection < T > paramValues , org.ovirt.engine.core.dal.dbbroker.MapSqlParameterMapper < T > mapper ) { org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getCallsHandler ( ) . executeStoredProcAsBatch ( ( procedureName == null ? org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) : procedureName ) , paramValues , mapper ) ; }

Target:
protected void updateAllInBatch ( java.lang.String procedureName , java.util.Collection < T > paramValues , org.ovirt.engine.core.dal.dbbroker.MapSqlParameterMapper < T > mapper ) { java.util.List < T > sortedParamValues = new java.util.ArrayList < > ( paramValues ) ; java.util.Collections.sort ( sortedParamValues , org.ovirt.engine.core.common.businessentities.comparators.BusinessEntityComparator.< T , ID > newInstance ( ) ) ; org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getCallsHandler ( ) . executeStoredProcAsBatch ( ( procedureName == null ? org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) : procedureName ) , paramValues , mapper ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; try { resource.update ( getUpdate ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; try { resource.update ( getUpdate ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private void saveDefaultedStorageProperties ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model , org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomainStatic ) { storageDomainStatic.setWipeAfterDelete ( model.getWipeAfterDelete ( ) . getEntity ( ) ) ; storageDomainStatic.setWarningLowSpaceIndicator ( model.getWarningLowSpaceIndicator ( ) . getEntity ( ) ) ; storageDomainStatic.setCriticalSpaceActionBlocker ( model.getCriticalSpaceActionBlocker ( ) . getEntity ( ) ) ; }

Target:
private void saveDefaultedStorageProperties ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model , org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomainStatic ) { storageDomainStatic.setWipeAfterDelete ( model.getWipeAfterDelete ( ) . getEntity ( ) ) ; storageDomainStatic.setDiscardAfterDelete ( model.getDiscardAfterDelete ( ) . getEntity ( ) ) ; storageDomainStatic.setWarningLowSpaceIndicator ( model.getWarningLowSpaceIndicator ( ) . getEntity ( ) ) ; storageDomainStatic.setCriticalSpaceActionBlocker ( model.getCriticalSpaceActionBlocker ( ) . getEntity ( ) ) ; }
Source:
private org.ovirt.engine.core.compat.Guid addAsyncTaskStep ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask task , org.ovirt.engine.core.common.job.StepEnum step , org.ovirt.engine.core.compat.Guid execStepId ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result ; result = getBackend ( ) . runInternalAction ( VdcActionType.AddInternalStep , new org.ovirt.engine.core.common.action.AddStepParameters ( execStepId , org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJob.getTaskMessage ( cluster , step , task ) , step ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( result.getFault ( ) . getError ( ) ) ; } org.ovirt.engine.core.compat.Guid asyncStepId = ( ( org.ovirt.engine.core.compat.Guid ) ( result.getActionReturnValue ( ) ) ) ; return asyncStepId ; }

Target:
private org.ovirt.engine.core.compat.Guid addAsyncTaskStep ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask task , org.ovirt.engine.core.common.job.StepEnum step , org.ovirt.engine.core.compat.Guid execStepId ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result ; result = getBackend ( ) . runInternalAction ( VdcActionType.AddInternalStep , new org.ovirt.engine.core.common.action.AddStepParameters ( execStepId , getGlusterTaskUtils ( ) . getTaskMessage ( cluster , step , task ) , step ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( result.getFault ( ) . getError ( ) ) ; } org.ovirt.engine.core.compat.Guid asyncStepId = ( ( org.ovirt.engine.core.compat.Guid ) ( result.getActionReturnValue ( ) ) ) ; return asyncStepId ; }
Source:
public org.ovirt.engine.api.model.Label get ( ) { org.ovirt.engine.api.model.Labels labels = parent.list ( ) ; if ( labels != null ) { for ( org.ovirt.engine.api.model.Label label : labels.getLabels ( ) ) { if ( label.getId ( ) . equals ( id ) ) { label.setNetwork ( new org.ovirt.engine.api.model.Network ( ) ) ; label.getNetwork ( ) . setId ( parent.getNetworkId ( ) . toString ( ) ) ; return addLinks ( label ) ; } } } return notFound ( ) ; }

Target:
public org.ovirt.engine.api.model.NetworkLabel get ( ) { org.ovirt.engine.api.model.NetworkLabels labels = parent.list ( ) ; if ( labels != null ) { for ( org.ovirt.engine.api.model.NetworkLabel label : labels.getNetworkLabels ( ) ) { if ( label.getId ( ) . equals ( id ) ) { label.setNetwork ( new org.ovirt.engine.api.model.Network ( ) ) ; label.getNetwork ( ) . setId ( parent.getNetworkId ( ) . toString ( ) ) ; return addLinks ( label ) ; } } } return notFound ( ) ; }
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 countAllTemplates ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void setUp ( ) { parameters = new org.ovirt.engine.core.common.action.StorageDomainManagementParameter ( getStorageDomain ( ) ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommand ( parameters ) ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . addStorageDomainInDb ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateStorageDomainDynamicFromIrs ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . saveLUNsInDB ( org.mockito.Matchers.any ( java.util.List.class ) ) ; }

Target:
public void setUp ( ) { parameters = new org.ovirt.engine.core.common.action.StorageDomainManagementParameter ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getStorageDomain ( ) ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommand ( parameters ) ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . addStorageDomainInDb ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateStorageDomainDynamicFromIrs ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . saveLUNsInDB ( org.mockito.Matchers.any ( java.util.List.class ) ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) { return true ; } if ( ! ( o instanceof org.ovirt.engine.core.common.businessentities.network.ExternalVnicProfileMapping ) ) { return false ; } final org.ovirt.engine.core.common.businessentities.network.ExternalVnicProfileMapping that = ( ( org.ovirt.engine.core.common.businessentities.network.ExternalVnicProfileMapping ) ( o ) ) ; return ( java.util.Objects.equals ( externalNetworkName , that.externalNetworkName ) ) && ( java.util.Objects.equals ( externalNetworkProfileName , that.externalNetworkProfileName ) ) ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) { return true ; } if ( ! ( o instanceof org.ovirt.engine.core.common.businessentities.network.ExternalVnicProfileMapping ) ) { return false ; } final org.ovirt.engine.core.common.businessentities.network.ExternalVnicProfileMapping that = ( ( org.ovirt.engine.core.common.businessentities.network.ExternalVnicProfileMapping ) ( o ) ) ; return isSameSourceProfile ( that ) ; }
Source:
public void stopRefresh ( ) { super . stopRefresh ( ) ; if ( ( getDetailModels ( ) ) != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model : getDetailModels ( ) ) { if ( model instanceof org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel listModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; listModel.stopRefresh ( ) ; } } } }

Target:
public void stopRefresh ( ) { super . stopRefresh ( ) ; if ( ( getDetailModels ( ) ) != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.HasEntity < D > model : getDetailModels ( ) ) { if ( model instanceof org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel listModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; listModel.stopRefresh ( ) ; } } } }
Source:
static java.util.Date parse ( java.lang.String str ) { for ( java.text.DateFormat fmt : org.ovirt.engine.core.searchbackend.DateUtils.formats ( java.text.DateFormat.DEFAULT , java.text.DateFormat.FULL , java.text.DateFormat.LONG , java.text.DateFormat.MEDIUM , java.text.DateFormat.SHORT ) ) { try { return fmt.parse ( str ) ; } catch ( java.text.ParseException e ) { } } return null ; }

Target:
static java.util.Date parse ( java.lang.String str ) { for ( java.text.DateFormat fmt : org.ovirt.engine.core.searchbackend.DateUtils.formats ( java.text.DateFormat.DEFAULT , java.text.DateFormat.FULL , java.text.DateFormat.LONG , java.text.DateFormat.MEDIUM , java.text.DateFormat.SHORT ) ) { try { return fmt.parse ( str ) ; } catch ( java.text.ParseException ignore ) { } } return null ; }
Source:
public void setUp ( ) { vm = createVm ( ) ; validator = new org.ovirt.engine.core.bll.validator.VmValidator ( vm ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) ) . thenReturn ( vmNetworkInterfaceDao ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVnicProfileDao ( ) ) . thenReturn ( vnicProfileDao ) ; }

Target:
public void setUp ( ) throws org.ovirt.engine.core.common.utils.exceptions.InitializationException { vm = createVm ( ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.VmValidator ( vm ) ) ; mockVmPropertiesUtils ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) ) . thenReturn ( vmNetworkInterfaceDao ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVnicProfileDao ( ) ) . thenReturn ( vnicProfileDao ) ; }
Source:
public void Activate ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.ActivateVds , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
public void activate ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.ActivateVds , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
private void auditLogDiskFieldTruncatedAndOthersWereLost ( java.lang.String diskAlias , java.lang.String fieldName , java.lang.String diskFieldsNames ) { java.util.Map < java.lang.String , java.lang.String > customValues = new java.util.HashMap < > ( ) ; customValues.put ( "DiskAlias" , diskAlias ) ; customValues.put ( "DiskFieldName" , fieldName ) ; customValues.put ( "DiskFieldsNames" , diskFieldsNames ) ; auditLog ( customValues , AuditLogType.FAILED_TO_STORE_ENTIRE_DISK_FIELD_AND_REST_OF_FIELDS_IN_DISK_DESCRIPTION_METADATA ) ; }

Target:
private void auditLogDiskFieldTruncatedAndOthersWereLost ( java.lang.String diskAlias , java.lang.String fieldName , java.lang.String diskFieldsNames ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable logable = createDiskEvent ( diskAlias ) ; logable.addCustomValue ( "DiskFieldName" , fieldName ) ; logable.addCustomValue ( "DiskFieldsNames" , diskFieldsNames ) ; getAuditLogDirector ( ) . log ( logable , AuditLogType.FAILED_TO_STORE_ENTIRE_DISK_FIELD_AND_REST_OF_FIELDS_IN_DISK_DESCRIPTION_METADATA ) ; }
Source:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getVDSReturnValue ( ) . setSucceeded ( resourceManager.runVdsCommand ( VDSCommandType.ResetIrs , new org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getParameters ( ) . getPreferredSPMId ( ) ) ) . getSucceeded ( ) ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getVDSReturnValue ( ) . setSucceeded ( resourceManager.runVdsCommand ( VDSCommandType.ResetIrs , new org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getCurrentIrsProxy ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getParameters ( ) . getPreferredSPMId ( ) ) ) . getSucceeded ( ) ) ; }
Source:
public void testMacPoolGetByDataCenterIdExist ( ) throws java.lang.Exception { final org.ovirt.engine.core.common.businessentities.MacPool macPool = dao.getByDataCenterId ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER ) ; org.junit.Assert.assertThat ( macPool , org.hamcrest.CoreMatchers.notNullValue ( ) ) ; org.junit.Assert.assertThat ( macPool.getId ( ) , org.hamcrest.CoreMatchers.is ( FixturesTool.NON_DEFAULT_MAC_POOL ) ) ; }

Target:
public void testMacPoolGetByClusterIdExist ( ) throws java.lang.Exception { final org.ovirt.engine.core.common.businessentities.MacPool macPool = dao.getByClusterId ( FixturesTool.CLUSTER_RHEL6_ISCSI ) ; org.junit.Assert.assertThat ( macPool , org.hamcrest.CoreMatchers.notNullValue ( ) ) ; org.junit.Assert.assertThat ( macPool.getId ( ) , org.hamcrest.CoreMatchers.is ( FixturesTool.NON_DEFAULT_MAC_POOL ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , getEntity ( 0 ) ) ; setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , true , true ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkDao , vdsDao , hostSetupNetworksValidatorHelper , vmDao , networkExclusivenessValidatorResolver ) ; return validator.validate ( ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkDao , vdsDao , hostSetupNetworksValidatorHelper , vmDao , networkExclusivenessValidatorResolver , networkAttachmentIpConfigurationValidator ) ; return validator.validate ( ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( getGlusterVolume ( ) . getVolumeType ( ) . isDispersedType ( ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_REMOVE_BRICK_FROM_DISPERSE_VOLUME_NOT_SUPPORTED ) ; } org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator brickValidator = new org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator ( ) ; return validate ( brickValidator.canRemoveBrick ( getParameters ( ) . getBricks ( ) , getGlusterVolume ( ) , getParameters ( ) . getReplicaCount ( ) , true ) ) ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( getGlusterVolume ( ) . getVolumeType ( ) . isDispersedType ( ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_REMOVE_BRICK_FROM_DISPERSE_VOLUME_NOT_SUPPORTED ) ; } org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator brickValidator = new org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator ( ) ; return validate ( brickValidator.canRemoveBrick ( getParameters ( ) . getBricks ( ) , getGlusterVolume ( ) , getParameters ( ) . getReplicaCount ( ) , true ) ) ; }
Source:
public void canDoActionFailsForGlusterServerWhenNoUpServer ( ) throws java.lang.Exception { setupGlusterMock ( true , null , false ) ; org.junit.Assert.assertFalse ( commandMock.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( commandMock.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_NO_GLUSTER_HOST_TO_PEER_PROBE.toString ( ) ) ) ; }

Target:
public void validateFailsForGlusterServerWhenNoUpServer ( ) throws java.lang.Exception { setupGlusterMock ( true , null , false ) ; org.junit.Assert.assertFalse ( commandMock.validate ( ) ) ; org.junit.Assert.assertTrue ( commandMock.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_NO_GLUSTER_HOST_TO_PEER_PROBE.toString ( ) ) ) ; }
Source:
public void start ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.FenceActionType.Start ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.StartVds , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
public void start ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.pm.FenceActionType.START ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.StartVds , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
public boolean isVisible ( ) { return getDetailModel ( ) . getIsLocalS ( ) ; }

Target:
public boolean getIsAvailable ( ) { return ( ( getDetailModel ( ) . getIsPosix ( ) ) && ( ( getDetailModel ( ) . getVfsType ( ) ) != null ) ) && ( ! ( getDetailModel ( ) . getVfsType ( ) . isEmpty ( ) ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult vmNotRunningStateless ( ) { if ( getSnapshotDao ( ) . exists ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.dal.VdcBllMessages message = ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . isStatusUp ( ) ) ? org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS : org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VM_HAS_STATELESS_SNAPSHOT_LEFTOVER ; return new org.ovirt.engine.core.bll.ValidationResult ( message ) ; } return new org.ovirt.engine.core.bll.ValidationResult ( ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult vmNotRunningStateless ( ) { if ( getSnapshotDao ( ) . exists ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.dal.VdcBllMessages message = ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . isStatusUp ( ) ) ? org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS : org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VM_HAS_STATELESS_SNAPSHOT_LEFTOVER ; return new org.ovirt.engine.core.bll.ValidationResult ( message ) ; } return ValidationResult.VALID ; }
Source:
protected void SyncSearch ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetAllVmTemplates ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalTemplateListModel ) ( model ) ) . setItems ( ( ( java.lang.Iterable ) ( returnValue ) ) ) ; } } ) ) ; }

Target:
protected void syncSearch ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetAllVmTemplates ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalTemplateListModel ) ( model ) ) . setItems ( ( ( java.lang.Iterable ) ( returnValue ) ) ) ; } } ) ) ; }
Source:
public static 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 < org.ovirt.engine.core.compat.RpmVersion > ( ( ( 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.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public static void getRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static void RunAction ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , final org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback callback , final java.lang.Object state , final boolean showErrorDialog ) { org.ovirt.engine.ui.frontend.Frontend.runActionImpl ( actionType , parameters , ( callback != null ? callback : org.ovirt.engine.ui.frontend.Frontend.NULLABLE_ASYNC_CALLBACK ) , state , showErrorDialog ) ; }

Target:
public static void RunAction ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , final org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback callback , final java.lang.Object state , final boolean showErrorDialog ) { final org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync service = GenericApiGWTServiceAsync.Util.getInstance ( ) ; org.ovirt.engine.ui.frontend.Frontend.runActionImpl ( actionType , parameters , ( callback != null ? callback : org.ovirt.engine.ui.frontend.Frontend.NULLABLE_ASYNC_CALLBACK ) , state , showErrorDialog , service ) ; }
Source:
private void UpdateActionAvailability ( ) { getEditCommand ( ) . setIsExecutionAllowed ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) == 1 ) ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) > 0 ) ) ) ; }

Target:
private void updateActionAvailability ( ) { getEditCommand ( ) . setIsExecutionAllowed ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) == 1 ) ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) > 0 ) ) ) ; }