Don't leak file managers
MOS_MIGRATED_REVID=148860690
@@ -83,7 +83,7 @@ public class BlazeJavacMain {
Listener diagnostics = new Listener(context);
BlazeJavaCompiler compiler;
- JavacFileManager fileManager = new ClassloaderMaskingFileManager();
+ try (JavacFileManager fileManager = new ClassloaderMaskingFileManager()) {
JavacTask task =
JavacTool.create()
.getTask(
@@ -99,7 +99,6 @@ public class BlazeJavacMain {
}
fileManager.setContext(context);
setLocations(fileManager, arguments);
- try {
try {
ok = task.call();
} catch (PropagatedException e) {
