Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8232280

close() is not called on return value of Files.walk()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: internal
    • Fix Version/s: internal
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      Files.walk() is misused. It is used just as `Files.walk(...)`, however to avoid resource leak it should be used as:
      try (var paths = Files.walk()) {
          paths...
      }

      Need to wrap all Files.walk() calls in try-with-resource statements.

        Attachments

          Activity

            People

            Assignee:
            herrick Andy Herrick
            Reporter:
            asemenyuk Alexey Semenyuk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: