--- a/jdk/test/java/io/DataInputStream/OpsAfterClose.java Fri Jun 18 20:59:13 2010 +0100
+++ b/jdk/test/java/io/DataInputStream/OpsAfterClose.java Sat Jun 19 15:17:36 2010 +0100
@@ -244,13 +244,19 @@
f.deleteOnExit();
FileInputStream fis = new FileInputStream(f);
-
- DataInputStream dis = new DataInputStream(
- new FileInputStream(f));
- if (testDataInputStream(dis)) {
- failed = true;
+ try {
+ DataInputStream dis = new DataInputStream(
+ new FileInputStream(f));
+ try {
+ if (testDataInputStream(dis)) {
+ failed = true;
+ }
+ } finally {
+ dis.close();
+ }
+ } finally {
+ fis.close();
}
-
}
private static boolean testDataInputStream(DataInputStream is)