# HG changeset patch # User jjg # Date 1251772986 25200 # Node ID 9d8c7669df64ce4fa59f9a43a15afd3094996674 # Parent c516c9b3fb729c28765b2af788efc444cd72fd48 6877759: test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java leaves open file Reviewed-by: darcy diff -r c516c9b3fb72 -r 9d8c7669df64 langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java --- a/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java Mon Aug 31 18:25:00 2009 -0700 +++ b/langtools/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); }