From 9c0f19aded36e6ac1778aade1624fce7ead02e9c Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 3 Sep 2009 23:02:17 +0000 Subject: [PATCH] close streams --- org.aspectj.matcher/src/org/aspectj/weaver/Lint.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/Lint.java b/org.aspectj.matcher/src/org/aspectj/weaver/Lint.java index bc2b44ba4..111b8a61d 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/Lint.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/Lint.java @@ -164,13 +164,23 @@ public class Lint { public void setFromProperties(File file) { if (trace.isTraceEnabled()) trace.enter("setFromProperties", this, file); + InputStream s = null; try { - InputStream s = new FileInputStream(file); + s = new FileInputStream(file); setFromProperties(s); } catch (IOException ioe) { MessageUtil.error(world.getMessageHandler(), WeaverMessages.format(WeaverMessages.XLINT_LOAD_ERROR, file.getPath(), ioe .getMessage())); + } finally { + if (s != null) { + try { + s.close(); + } catch (IOException e) { + // ignore + } + } } + if (trace.isTraceEnabled()) trace.exit("setFromProperties"); } -- 2.39.5