jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r674028 - /jackrabbit/trunk/jackrabbit-jca/src/main/java/org/apache/jackrabbit/jca/JCARepositoryManager.java
Date Fri, 04 Jul 2008 12:20:52 GMT
Author: mreutegg
Date: Fri Jul  4 05:20:51 2008
New Revision: 674028

URL: http://svn.apache.org/viewvc?rev=674028&view=rev
Log:
JCR-1667: JCARepositoryManager does not close InputStream used to obtain repository config
from classpath

Modified:
    jackrabbit/trunk/jackrabbit-jca/src/main/java/org/apache/jackrabbit/jca/JCARepositoryManager.java

Modified: jackrabbit/trunk/jackrabbit-jca/src/main/java/org/apache/jackrabbit/jca/JCARepositoryManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jca/src/main/java/org/apache/jackrabbit/jca/JCARepositoryManager.java?rev=674028&r1=674027&r2=674028&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jca/src/main/java/org/apache/jackrabbit/jca/JCARepositoryManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-jca/src/main/java/org/apache/jackrabbit/jca/JCARepositoryManager.java
Fri Jul  4 05:20:51 2008
@@ -21,6 +21,7 @@
 
 import javax.jcr.RepositoryException;
 
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.Collection;
 import java.util.HashMap;
@@ -160,7 +161,17 @@
 
                     InputStream configInputStream = cl.getResourceAsStream(
                         configFile.substring(CLASSPATH_CONFIG_PREFIX.length()));
-                    config = RepositoryConfig.create(configInputStream, homeDir);
+                    try {
+                        config = RepositoryConfig.create(configInputStream, homeDir);
+                    } finally {
+                        if (configInputStream != null) {
+                            try {
+                                configInputStream.close();
+                            } catch (IOException e) {
+                                // ignore
+                            }
+                        }
+                    }
                 } else {
                     config = RepositoryConfig.create(configFile, homeDir);
                 }
@@ -247,3 +258,4 @@
 
 }
 
+



Mime
View raw message