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

[error-prone] StreamResourceLeak in jdk.internal.ed module

    Details

    • Subcomponent:
    • Resolved In Build:
      b11

      Description

      error-prone has found StreamResourceLeak defect in jdk.internal.ed module:
      src/jdk.internal.ed/share/classes/jdk/internal/editor/external/ExternalEditor.java:192: warning: [StreamResourceLeak] Streams that encapsulate a closeable resource should be closed using try-with-resources
                  saveHandler.accept(Files.lines(tmpfile).collect(Collectors.joining("\n", "", "\n")));
                                                ^
          (see https://errorprone.info/bugpattern/StreamResourceLeak.md)
        Did you mean 'try (Stream<String> stream = Files.lines(tmpfile)) {'?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                iignatyev Igor Ignatyev
                Reporter:
                iignatyev Igor Ignatyev
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: