Source:
public static <T> T extractResult(GenericType<T> responseType, Response response, Annotation[] annotations) { int status = response.getStatus(); if (status >= 200 && status < 300) { try { if (response.getMediaType() == null) { return null; } else { T rtn = response.readEntity(responseType, annotations); if (InputStream.class.isInstance(rtn) || Reader.class.isInstance(rtn) || EventInput.class.isInstance(rtn)) { if (response instanceof ClientResponse) { ClientResponse clientResponse = (ClientResponse) response; clientResponse.noReleaseConnection(); } } return rtn; } } catch (WebApplicationException wae) { try { response.close(); } catch (Exception e) { } throw wae; } catch (Throwable throwable) { try { response.close(); } catch (Exception e) { } throw new ResponseProcessingException(response, throwable); } finally { if (response.getMediaType() == null) response.close(); } } try { String s = String.class.cast(response.getHeaders().getFirst("resteasy.buffer.exception.entity")); if (s == null || Boolean.parseBoolean(s)) { response.bufferEntity(); } else { if (response instanceof ClientResponse) { try { ClientResponse.class.cast(response).releaseConnection(); } catch (IOException e) { } } } if (status >= 300 && status < 400) { Config config = ConfigProvider.getConfig(); boolean originalBehavior = config.getOptionalValue(ResteasyContextParameters.RESTEASY_ORIGINAL_WEBAPPLICATIONEXCEPTION_BEHAVIOR, boolean.class).orElse(false); boolean serverSide = ResteasyProviderFactory.searchContextData(Dispatcher.class) != null; if (!serverSide || originalBehavior) { throw new RedirectionException(response); } else { throw new ResteasyRedirectionException(response); } } return handleErrorStatus(response); } finally { if (response.getMediaType() == null) response.close(); } }

Target:
public static <T> T extractResult(GenericType<T> responseType, Response response, Annotation[] annotations) { int status = response.getStatus(); if (status >= 200 && status < 300) { try { if (response.getMediaType() == null) { return null; } else { T rtn = response.readEntity(responseType, annotations); if (InputStream.class.isInstance(rtn) || Reader.class.isInstance(rtn) || EventInput.class.isInstance(rtn)) { if (response instanceof ClientResponse) { ClientResponse clientResponse = (ClientResponse) response; clientResponse.noReleaseConnection(); } } return rtn; } } catch (WebApplicationException wae) { try { response.close(); } catch (Exception e) { } throw wae; } catch (Throwable throwable) { try { response.close(); } catch (Exception e) { } throw new ResponseProcessingException(response, throwable); } finally { if (response.getMediaType() == null) response.close(); } } try { String s = String.class.cast(response.getHeaders().getFirst("resteasy.buffer.exception.entity")); if (s == null || Boolean.parseBoolean(s)) { response.bufferEntity(); } else { if (response instanceof ClientResponse) { try { ClientResponse.class.cast(response).releaseConnection(); } catch (IOException e) { } } } if (status >= 300 && status < 400) { boolean serverSide = ResteasyProviderFactory.searchContextData(Dispatcher.class) != null; if (!serverSide || useOriginalBehavior()) { throw new RedirectionException(response); } else { throw new ResteasyRedirectionException(response); } } return handleErrorStatus(response); } finally { if (response.getMediaType() == null) response.close(); } }