# HG changeset patch # User jjg # Date 1251772986 25200 # Node ID 5a72ba18c471337f07801bef9a6316f39572f9d4 # Parent 45301370bc5adc09d2afd021c9a1d2f78fa6a61b 6877759: test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java leaves open file Reviewed-by: darcy diff -r 45301370bc5a -r 5a72ba18c471 test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java --- a/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java Mon Aug 31 18:25:00 2009 -0700 +++ b/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java Mon Aug 31 19:43:06 2009 -0700 @@ -188,14 +188,18 @@ // Copy the bytes over System.out.println((new File(".")).getAbsolutePath()); InputStream io = new BufferedInputStream(new FileInputStream(new File(".", "Foo.class"))); - int datum = io.read(); - while(datum != -1) { - os.write(datum); - datum = io.read(); + try { + int datum = io.read(); + while(datum != -1) { + os.write(datum); + datum = io.read(); + } + } finally { + io.close(); } os.close(); - } catch (IOException io) { - throw new RuntimeException(io); + } catch (IOException ioe) { + throw new RuntimeException(ioe); }