changeset 18731:38dd7ede2dfb

8013638: Few policy tests are failing in Lambda nightly Summary: BridgeHarness test is leaving files open Reviewed-by: ksrini
author mcimadamore
date Wed, 17 Jul 2013 19:28:40 +0100
parents 95354d510139
children c1ee114d2736
files langtools/test/tools/javac/generics/bridges/BridgeHarness.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/langtools/test/tools/javac/generics/bridges/BridgeHarness.java	Thu Jul 11 14:07:39 2013 +0100
+++ b/langtools/test/tools/javac/generics/bridges/BridgeHarness.java	Wed Jul 17 19:28:40 2013 +0100
@@ -40,6 +40,7 @@
 import com.sun.tools.javac.util.List;
 
 import java.io.File;
+import java.io.InputStream;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
@@ -137,8 +138,8 @@
      * annotation in the bridge map
      */
     protected void checkBridges(JavaFileObject jfo) {
-        try {
-            ClassFile cf = ClassFile.read(jfo.openInputStream());
+        try (InputStream is = jfo.openInputStream()) {
+            ClassFile cf = ClassFile.read(is);
             System.err.println("checking: " + cf.getName());
 
             List<Bridge> bridgeList = bridgesMap.get(cf.getName());