-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major
-
Component/s: sloccount-plugin
-
None
-
Environment: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();
}