Source:
private boolean shouldProceed(RestRequest restRequest, RestResponseChannel restResponseChannel) { if (blocking) { try { blockLatch.await(); } catch (InterruptedException e) { throw new IllegalStateException(e); } } boolean shouldProceed = canHonorRequest(restRequest, restResponseChannel); if (shouldProceed) { String uri = restRequest.getUri(); ReadableStreamChannel response = null; Exception exception = null; if (uri.startsWith(ECHO_REST_METHOD)) { String responseStr = restRequest.getRestMethod().toString() + uri.substring(ECHO_REST_METHOD.length()); ByteBuffer buffer = ByteBuffer.wrap(responseStr.getBytes()); response = new ByteBufferRSC(buffer); shouldProceed = false; } else if (THROW_RUNTIME_EXCEPTION.equals(uri)) { throw new RuntimeException(THROW_RUNTIME_EXCEPTION); } else if (SEND_RESPONSE_RUNTIME_EXCEPTION.equals(uri)) { shouldProceed = false; exception = new RuntimeException(SEND_RESPONSE_RUNTIME_EXCEPTION); } else if (SEND_RESPONSE_REST_SERVICE_EXCEPTION.equals(uri)) { shouldProceed = false; RestServiceErrorCode errorCode = RestServiceErrorCode.InternalServerError; try { errorCode = RestServiceErrorCode.valueOf(verifiableProperties.getString(REST_ERROR_CODE)); } catch (IllegalArgumentException e) { } exception = new RestServiceException(SEND_RESPONSE_REST_SERVICE_EXCEPTION, errorCode); } if (!shouldProceed) { try { if (exception == null) { restResponseChannel.setStatus(ResponseStatus.Ok); } } catch (RestServiceException e) { throw new IllegalStateException(e); } finally { handleResponse(restRequest, restResponseChannel, response, exception); } } } return shouldProceed; }

Target:
private boolean shouldProceed(RestRequest restRequest, RestResponseChannel restResponseChannel) { if (blocking) { try { blockLatch.await(); } catch (InterruptedException e) { throw new IllegalStateException(e); } } boolean shouldProceed = canHonorRequest(restRequest, restResponseChannel); if (shouldProceed) { String uri = restRequest.getUri(); ReadableStreamChannel response = null; Exception exception = null; if (uri.startsWith(ECHO_REST_METHOD)) { String responseStr = restRequest.getRestMethod().toString() + uri.substring(ECHO_REST_METHOD.length()); ByteBuffer buffer = ByteBuffer.wrap(responseStr.getBytes()); response = new ByteBufferRSC(buffer); shouldProceed = false; } else if (THROW_RUNTIME_EXCEPTION.equals(uri)) { throw new RuntimeException(THROW_RUNTIME_EXCEPTION); } else if (SEND_RESPONSE_RUNTIME_EXCEPTION.equals(uri)) { shouldProceed = false; exception = new RuntimeException(SEND_RESPONSE_RUNTIME_EXCEPTION); } else if (SEND_RESPONSE_REST_SERVICE_EXCEPTION.equals(uri)) { shouldProceed = false; RestServiceErrorCode errorCode = RestServiceErrorCode.InternalServerError; try { errorCode = RestServiceErrorCode.valueOf(verifiableProperties.getString(REST_ERROR_CODE)); } catch (IllegalArgumentException e) { } exception = new RestServiceException(SEND_RESPONSE_REST_SERVICE_EXCEPTION, errorCode); } if (!shouldProceed) { try { if (exception == null) { restResponseChannel.setStatus(ResponseStatus.Ok); } } catch (RestServiceException e) { exception = e; } finally { handleResponse(restRequest, restResponseChannel, response, exception); } } } return shouldProceed; }