Closed damir78 closed 9 months ago
You are incorrect. It is the responsibility of who creates the writer to close it. When handing off writers to other methods or classes they should never close the writer.
@samskivert
I'm fairly sure we can close this issue.
One tangental thing that we could add in something like 2.0 (or possibly in a minor version depending on semver semantics) is to make a new exception class:
MustacheUncheckedIOException extends java.io.UncheckedIOException {
...
}
As IO exceptions really have nothing to do with MustacheExceptions but probably not worth doing (since it technically breaks API if people are expecting MustacheException for io issues.).
Hi guys, I think the part try { out.write(data); } can be rewritten in autocloseable style or pls complete try/catch with closing Writer (out.close() /..flush, etc.) `
protected static abstract class Segment { abstract void execute (Template tmpl, Context ctx, Writer out);