Source:
<code>public void handleOptions(RestRequest restRequest, RestResponseChannel restResponseChannel) { long processingStartTime = System.currentTimeMillis(); handlePrechecks(restRequest, restResponseChannel); RestRequestMetrics requestMetrics = restRequest.getSSLSession() != null ? frontendMetrics.optionsSSLMetrics : frontendMetrics.optionsMetrics; restRequest.getMetricsTracker().injectMetrics(requestMetrics); Exception exception = null; try { logger.trace("Handling OPTIONS request - {}", restRequest.getUri()); checkAvailable(); long preProcessingEndTime = System.currentTimeMillis(); frontendMetrics.optionsPreProcessingTimeInMs.update(preProcessingEndTime - processingStartTime); securityService.processRequest(restRequest).get(); long securityRequestProcessingEndTime = System.currentTimeMillis(); frontendMetrics.optionsSecurityRequestTimeInMs.update(securityRequestProcessingEndTime - preProcessingEndTime); restResponseChannel.setStatus(ResponseStatus.Ok); restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, 0); restResponseChannel.setHeader(Headers.ACCESS_CONTROL_ALLOW_METHODS, frontendConfig.frontendOptionsAllowMethods); restResponseChannel.setHeader(Headers.ACCESS_CONTROL_MAX_AGE, frontendConfig.frontendOptionsValiditySeconds); securityService.processResponse(restRequest, restResponseChannel, null).get(); long securityResponseProcessingEndTime = System.currentTimeMillis(); frontendMetrics.optionsSecurityResponseTimeInMs.update( securityResponseProcessingEndTime - securityRequestProcessingEndTime); } catch (Exception e) { <START> exception = e; <END> } submitResponse(restRequest, restResponseChannel, null, exception); }</code><technical_language>extractCause unbox RestServiceException future ExecutionExceptions? InboundIdConverterCallback</technical_language>

Target:
public void handleOptions(RestRequest restRequest, RestResponseChannel restResponseChannel) { long processingStartTime = System.currentTimeMillis(); handlePrechecks(restRequest, restResponseChannel); RestRequestMetrics requestMetrics = restRequest.getSSLSession() != null ? frontendMetrics.optionsSSLMetrics : frontendMetrics.optionsMetrics; restRequest.getMetricsTracker().injectMetrics(requestMetrics); Exception exception = null; try { logger.trace("Handling OPTIONS request - {}", restRequest.getUri()); checkAvailable(); long preProcessingEndTime = System.currentTimeMillis(); frontendMetrics.optionsPreProcessingTimeInMs.update(preProcessingEndTime - processingStartTime); securityService.processRequest(restRequest).get(); long securityRequestProcessingEndTime = System.currentTimeMillis(); frontendMetrics.optionsSecurityRequestTimeInMs.update(securityRequestProcessingEndTime - preProcessingEndTime); restResponseChannel.setStatus(ResponseStatus.Ok); restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, 0); restResponseChannel.setHeader(Headers.ACCESS_CONTROL_ALLOW_METHODS, frontendConfig.frontendOptionsAllowMethods); restResponseChannel.setHeader(Headers.ACCESS_CONTROL_MAX_AGE, frontendConfig.frontendOptionsValiditySeconds); securityService.processResponse(restRequest, restResponseChannel, null).get(); long securityResponseProcessingEndTime = System.currentTimeMillis(); frontendMetrics.optionsSecurityResponseTimeInMs.update( securityResponseProcessingEndTime - securityRequestProcessingEndTime); } catch (ExecutionException e) { exception = extractCause(e); } catch (Exception e) { exception = e; } submitResponse(restRequest, restResponseChannel, null, exception); }