[
https://issues.apache.org/jira/browse/NUTCH-3027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17825019#comment-17825019
]
ASF GitHub Bot commented on NUTCH-3027:
---------------------------------------
sebastian-nagel commented on PR #802:
URL: https://github.com/apache/nutch/pull/802#issuecomment-1987165751
Patch applied to master in d95e1a7, see comments on Jira in NUTCH-3027.
Thanks again @skehrli !
> Trivial resource leak patch in DomainSuffixes.java
> --------------------------------------------------
>
> Key: NUTCH-3027
> URL: https://issues.apache.org/jira/browse/NUTCH-3027
> Project: Nutch
> Issue Type: Bug
> Components: util
> Affects Versions: 1.20
> Reporter: Sascha Kehrli
> Assignee: Markus Jelsma
> Priority: Trivial
> Fix For: 1.20
>
> Original Estimate: 1m
> Remaining Estimate: 1m
>
> Found a trivial resource leak in .../util/DomainSuffixes.java, where an
> InputStream is not closed:
> {code:java}
> InputStream input =
> this.getClass().getClassLoader().getResourceAsStream(file);
> try {
> new DomainSuffixesReader().read(this, input);
> } catch (Exception ex) {
> LOG.warn(StringUtils.stringifyException(ex));
> } {code}
>
> instead of:
> {code:java}
> try (InputStream input =
> this.getClass().getClassLoader().getResourceAsStream(file)) {
> new DomainSuffixesReader().read(this, input);
> } catch (Exception ex) {
> LOG.warn(StringUtils.stringifyException(ex));
> } {code}
> Where the InputStream is automatically closed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)