Mon, 31 Aug 2009 19:43:06 -0700
6877759: test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java leaves open file
Reviewed-by: darcy
test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java | file | annotate | diff | comparison | revisions |
1.1 --- a/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java Mon Aug 31 18:25:00 2009 -0700 1.2 +++ b/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java Mon Aug 31 19:43:06 2009 -0700 1.3 @@ -188,14 +188,18 @@ 1.4 // Copy the bytes over 1.5 System.out.println((new File(".")).getAbsolutePath()); 1.6 InputStream io = new BufferedInputStream(new FileInputStream(new File(".", "Foo.class"))); 1.7 - int datum = io.read(); 1.8 - while(datum != -1) { 1.9 - os.write(datum); 1.10 - datum = io.read(); 1.11 + try { 1.12 + int datum = io.read(); 1.13 + while(datum != -1) { 1.14 + os.write(datum); 1.15 + datum = io.read(); 1.16 + } 1.17 + } finally { 1.18 + io.close(); 1.19 } 1.20 os.close(); 1.21 - } catch (IOException io) { 1.22 - throw new RuntimeException(io); 1.23 + } catch (IOException ioe) { 1.24 + throw new RuntimeException(ioe); 1.25 } 1.26 1.27