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

Possible resource leak in parser

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • sloccount-plugin
    • None
    • Bug in code logic

      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();
          }
      

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

              Created:
              Updated:
              Resolved: