shale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject svn commit: r474543 - /shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/config/ConfigurationParser.java
Date Mon, 13 Nov 2006 22:36:42 GMT
Author: craigmcc
Date: Mon Nov 13 14:36:41 2006
New Revision: 474543

URL: http://svn.apache.org/viewvc?view=rev&rev=474543
Log:
Further work on SHALE-274 ... close the input stream for each parsed
configuration resource.  This doesn't solve the locked JAR file problem,
but it is the right thing to do anyway.

Modified:
    shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/config/ConfigurationParser.java

Modified: shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/config/ConfigurationParser.java
URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/config/ConfigurationParser.java?view=diff&rev=474543&r1=474542&r2=474543
==============================================================================
--- shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/config/ConfigurationParser.java
(original)
+++ shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/config/ConfigurationParser.java
Mon Nov 13 14:36:41 2006
@@ -18,6 +18,7 @@
 package org.apache.shale.dialog.basic.config;
 
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.URL;
 import java.util.Map;
 
@@ -162,8 +163,24 @@
         digester.clear();
         digester.push(getDialogs());
         InputSource source = new InputSource(getResource().toExternalForm());
-        source.setByteStream(getResource().openStream());
-        digester.parse(source);
+        InputStream stream = null;
+        try {
+            stream = getResource().openStream();
+            source.setByteStream(stream);
+            digester.parse(source);
+        } catch (IOException e) {
+            throw e;
+        } catch (SAXException e) {
+            throw e;
+        } finally {
+            if (stream != null) {
+                try {
+                    stream.close();
+                } catch (IOException e) {
+                    ; // Fall through
+                }
+            }
+        }
 
     }
 



Mime
View raw message