From 21ea200c4eb4d3b902e456baaf7dd56def215ad8 Mon Sep 17 00:00:00 2001 From: mcimadamore Date: Wed, 17 Jul 2013 19:28:40 +0100 Subject: [PATCH] 8013638: Few policy tests are failing in Lambda nightly Summary: BridgeHarness test is leaving files open Reviewed-by: ksrini --- test/tools/javac/generics/bridges/BridgeHarness.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/tools/javac/generics/bridges/BridgeHarness.java b/test/tools/javac/generics/bridges/BridgeHarness.java index bc4c7129..b4199cf8 100644 --- a/test/tools/javac/generics/bridges/BridgeHarness.java +++ b/test/tools/javac/generics/bridges/BridgeHarness.java @@ -40,6 +40,7 @@ import com.sun.tools.javac.code.Symbol.ClassSymbol; 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 @@ public class BridgeHarness { * 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 bridgeList = bridgesMap.get(cf.getName()); -- GitLab