juanpablo-santos commented on code in PR #207:
URL: https://github.com/apache/jspwiki/pull/207#discussion_r925934918
##########
jspwiki-main/src/main/java/org/apache/wiki/tags/AttachmentsIteratorTag.java:
##########
@@ -108,8 +108,9 @@ public final int doStartTag() {
public final int doAfterBody() {
if( bodyContent != null ) {
try {
- final JspWriter out = getPreviousOut();
- out.print(bodyContent.getString());
+ try (JspWriter out = getPreviousOut()) {
Review Comment:
as per
[JSPWriter#close](https://docs.oracle.com/javaee/7/api/javax/servlet/jsp/JspWriter.html#close--),
this method shouldn't be invoked directly.
Furthermore,
[JSPWriter#flush](https://docs.oracle.com/javaee/7/api/javax/servlet/jsp/JspWriter.html#flush--)
states `[...] Once a stream has been closed, further write() or flush()
invocations will cause an IOException to be thrown.`, so once this stream is
closed, after the custom tags is rendered, the rest of the JSP wouldn't be
rendered and will yield an exception? Would you mind verifying if this is the
case?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]