Skip to content
Permalink
Browse files
8250774: jextract does not close all files
Reviewed-by: sundar
  • Loading branch information
mcimadamore committed Jul 29, 2020
1 parent 623ef58 commit c1a2a00db479e6ca2ed30433565141b1b8ae9f5e
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/jdk.incubator.jextract/share/classes/jdk/internal/jextract/impl/Writer.java
@@ -28,6 +28,7 @@

import javax.tools.JavaFileObject;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -72,7 +73,9 @@ void writeClassFiles(List<JavaFileObject> files) throws IOException {
String path = entry.getName();
Path fullPath = destDir.resolve(path).normalize();
Files.createDirectories(fullPath.getParent());
Files.write(fullPath, entry.openInputStream().readAllBytes());
try (InputStream is = entry.openInputStream()) {
Files.write(fullPath, is.readAllBytes());
}
}
}

0 comments on commit c1a2a00

Please sign in to comment.