Uploaded image for project: 'Nutch'
  1. Nutch
  2. NUTCH-3027

Trivial resource leak patch in DomainSuffixes.java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.20
    • 1.20
    • util
    • None
    • Patch

    Description

      Found a trivial resource leak in .../util/DomainSuffixes.java, where an InputStream is not closed:

      InputStream input = this.getClass().getClassLoader().getResourceAsStream(file);
      try {
          new DomainSuffixesReader().read(this, input);
      } catch (Exception ex) {
          LOG.warn(StringUtils.stringifyException(ex));
      } 

       

      instead of:

      try (InputStream input = this.getClass().getClassLoader().getResourceAsStream(file)) {
          new DomainSuffixesReader().read(this, input);
      } catch (Exception ex) {
          LOG.warn(StringUtils.stringifyException(ex));
      } 

      Where the InputStream is automatically closed.

      Attachments

        Issue Links

          Activity

            People

              markus17 Markus Jelsma
              skehrli Sascha Kehrli
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1m
                  1m
                  Remaining:
                  Remaining Estimate - 1m
                  1m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified