[ 
https://issues.apache.org/jira/browse/NUTCH-3027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Markus Jelsma reassigned NUTCH-3027:
------------------------------------

    Assignee: Markus Jelsma

> 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
>   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)

Reply via email to