jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1100242 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/CheckSchemaOperation.java
Date Fri, 06 May 2011 14:50:58 GMT
Author: stefan
Date: Fri May  6 14:50:58 2011
New Revision: 1100242

URL: http://svn.apache.org/viewvc?rev=1100242&view=rev
Log:
JCR-2962: InputStream not being explicitly closed

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/CheckSchemaOperation.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/CheckSchemaOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/CheckSchemaOperation.java?rev=1100242&r1=1100241&r2=1100242&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/CheckSchemaOperation.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/CheckSchemaOperation.java
Fri May  6 14:50:58 2011
@@ -76,9 +76,9 @@ public class CheckSchemaOperation {
      * @throws IOException if an error occurs
      */
     public void run() throws SQLException, IOException {
-        if (!conHelper.tableExists(table)) {
-            BufferedReader reader = new BufferedReader(new InputStreamReader(ddl));
-            try {
+        try {
+            if (!conHelper.tableExists(table)) {
+                BufferedReader reader = new BufferedReader(new InputStreamReader(ddl));
                 String sql = reader.readLine();
                 while (sql != null) {
                     // Skip comments and empty lines
@@ -91,9 +91,9 @@ public class CheckSchemaOperation {
                     // read next sql stmt
                     sql = reader.readLine();
                 }
-            } finally {
-                IOUtils.closeQuietly(ddl);
             }
+        } finally {
+            IOUtils.closeQuietly(ddl);
         }
     }
 



Mime
View raw message