8156911: JShell: file manager should be closed

Properly closing the file manager when it is being thrown away on error.

Reviewed-by: rfield
This commit is contained in:
Jan Lahoda 2016-08-22 18:19:31 +02:00
parent f03ea9c497
commit 1aab3cd562

View File

@ -1196,6 +1196,11 @@ class SourceCodeAnalysisImpl extends SourceCodeAnalysis {
fm.setLocationFromPaths(StandardLocation.SOURCE_PATH, sources);
} catch (IOException ex) {
proc.debug(ex, "SourceCodeAnalysisImpl.SourceCache.<init>(...)");
try {
fm.close();
} catch (IOException closeEx) {
proc.debug(closeEx, "SourceCodeAnalysisImpl.SourceCache.close()");
}
fm = null;
}
this.fm = fm;