Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21229

Possible resource leak in parser

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • sloccount-plugin
    • None
    • Bug in code logic

    Description

      If an exception occurs before the stream is closed there will be a resource leak since close() won't be called. Use try-finally pattern.

          private void parse(java.io.File file, SloccountReportInterface report) throws IOException {
              InputStreamReader in = new InputStreamReader(new FileInputStream(file), encoding);
              this.parse(in, report);
              in.close();
          }
      

      Attachments

        Activity

          mixalturek Michal Turek created issue -
          mixalturek Michal Turek made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          mixalturek Michal Turek made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          mixalturek Michal Turek made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 153092 ] JNJira + In-Review [ 207295 ]

          People

            mixalturek Michal Turek
            mixalturek Michal Turek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: