TeaVMTool: use a single try-with-resources

This commit is contained in:
Ulugbek 2022-07-09 15:50:29 +02:00 committed by Alexey Andreev
parent 0068198abd
commit 3ff1651184

View File

@ -460,12 +460,11 @@ public class TeaVMTool {
generatedFiles.add(outputFile); generatedFiles.add(outputFile);
if (targetType == TeaVMTargetType.JAVASCRIPT) { if (targetType == TeaVMTargetType.JAVASCRIPT) {
try (OutputStream output = new FileOutputStream(outputFile, true)) { try (OutputStream output = new FileOutputStream(outputFile, true);
try (Writer writer = new OutputStreamWriter(output, StandardCharsets.UTF_8)) { Writer writer = new OutputStreamWriter(output, StandardCharsets.UTF_8)) {
additionalJavaScriptOutput(writer); additionalJavaScriptOutput(writer);
} }
} }
}
if (incremental) { if (incremental) {
programCache.flush(); programCache.flush();