From 4743c19a8c481e7ff769b9daba83a4529fe3b9ab Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Wed, 19 Aug 2015 11:12:40 +1000 Subject: [PATCH] 474961 Close input stream for classes in AnnotationParser after scanning --- .../java/org/eclipse/jetty/annotations/AnnotationParser.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationParser.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationParser.java index 8ce1d7dc169..587743cc341 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationParser.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationParser.java @@ -701,7 +701,10 @@ public class AnnotationParser { Resource r = Resource.newResource(res.getURL()); if (LOG.isDebugEnabled()) {LOG.debug("Scanning class {}", r);}; - scanClass(handlers, dir, r.getInputStream()); + try (InputStream is=r.getInputStream()) + { + scanClass(handlers, dir, is); + } } } catch (Exception ex)