mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +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
|
@ -429,11 +429,8 @@ class Example implements Comparable<Example> {
|
|||
*/
|
||||
private String read(File f) throws IOException {
|
||||
byte[] bytes = new byte[(int) f.length()];
|
||||
DataInputStream in = new DataInputStream(new FileInputStream(f));
|
||||
try {
|
||||
try (DataInputStream in = new DataInputStream(new FileInputStream(f))) {
|
||||
in.readFully(bytes);
|
||||
} finally {
|
||||
in.close();
|
||||
}
|
||||
return new String(bytes);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue