mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8302685: Some javac unit tests aren't reliably closing open files
Reviewed-by: darcy, vromero
This commit is contained in:
parent
f5a12768fb
commit
55e6bb6b85
58 changed files with 240 additions and 391 deletions
|
@ -63,9 +63,9 @@ public class TestCompileJARInClassPath {
|
|||
}
|
||||
|
||||
void writeFile(String f, String contents) throws IOException {
|
||||
PrintStream s = new PrintStream(new FileOutputStream(f));
|
||||
s.println(contents);
|
||||
s.close();
|
||||
try (PrintStream s = new PrintStream(new FileOutputStream(f))) {
|
||||
s.println(contents);
|
||||
}
|
||||
}
|
||||
|
||||
void rm(String filename) throws Exception {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue