We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d53c941 commit 2061652Copy full SHA for 2061652
modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/HtmlStripProcessor.java
@@ -41,13 +41,11 @@ protected String process(String value) {
41
return value;
42
}
43
44
- HTMLStripCharFilter filter = new HTMLStripCharFilter(new StringReader(value));
45
-
46
StringBuilder builder = new StringBuilder();
47
- int ch;
48
- try {
+ try (HTMLStripCharFilter filter = new HTMLStripCharFilter(new StringReader(value))) {
+ int ch;
49
while ((ch = filter.read()) != -1) {
50
- builder.append((char)ch);
+ builder.append((char) ch);
51
52
} catch (IOException e) {
53
throw new ElasticsearchException(e);
0 commit comments