kwin commented on PR #29: URL: https://github.com/apache/sling-org-apache-sling-graphql-core/pull/29#issuecomment-1187888071
> First this does not work as it replaces the writer when closed is called I am not following here. You can just use `try (JsonWriter writer = Json.createWriter(CloseShieldWriter.wrap(response.getWriter())))` in https://github.com/apache/sling-org-apache-sling-graphql-core/blob/9989848de947bb4dc320b6b0f7cbcde810819728/src/main/java/org/apache/sling/graphql/core/servlet/GraphQLServlet.java#L318. > but I also think that we should make it explicit there as this is important. I think using `CloseShieldWriter` is way more explicit than just not closing. > Also SonarCloud is wrong here - I think. In this particular case maybe yes, but as stated above, it may be possible that in the future another implementation of JSONWriter may do necessary cleanup in its `close()` apart from just delegating to its underlying writer. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org