Ensure auto close of HTMLStripCharFilter in HtmlStripProcessor
The HtmlStripProcessor did not use a try-with resources block to ensure that the used HTMLStripCharFilter is closed.
This commit is contained in:
parent
d53c941c41
commit
2061652988
|
@ -41,11 +41,9 @@ public final class HtmlStripProcessor extends AbstractStringProcessor<String> {
|
|||
return value;
|
||||
}
|
||||
|
||||
HTMLStripCharFilter filter = new HTMLStripCharFilter(new StringReader(value));
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
try (HTMLStripCharFilter filter = new HTMLStripCharFilter(new StringReader(value))) {
|
||||
int ch;
|
||||
try {
|
||||
while ((ch = filter.read()) != -1) {
|
||||
builder.append((char) ch);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue