--- a/jdk/test/java/io/Reader/Skip.java Fri Jun 18 20:59:13 2010 +0100
+++ b/jdk/test/java/io/Reader/Skip.java Sat Jun 19 15:17:36 2010 +0100
@@ -35,12 +35,16 @@
File f = new File(System.getProperty("test.src", "."),
"SkipInput.txt");
FileReader fr = new FileReader(f);
- long nchars = 8200;
- long actual = fr.skip(nchars);
+ try {
+ long nchars = 8200;
+ long actual = fr.skip(nchars);
- if (actual > nchars) {
- throw new Exception
- ("Should skip " + nchars + ", but skipped " +actual+" chars");
+ if (actual > nchars) {
+ throw new Exception
+ ("Should skip " + nchars + ", but skipped " +actual+" chars");
+ }
+ } finally {
+ fr.close();
}
}
}