]> source.dussan.org Git - aspectj.git/commitdiff
close streams
authoraclement <aclement>
Thu, 3 Sep 2009 23:02:17 +0000 (23:02 +0000)
committeraclement <aclement>
Thu, 3 Sep 2009 23:02:17 +0000 (23:02 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/Lint.java

index bc2b44ba40fdf64cbc145f55ee972f7f517e2a62..111b8a61d508dcf7e374bfaf304def7c14a538ee 100644 (file)
@@ -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");
        }