jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r585176 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
Date Tue, 16 Oct 2007 15:35:23 GMT
Author: jukka
Date: Tue Oct 16 08:35:11 2007
New Revision: 585176

URL: http://svn.apache.org/viewvc?rev=585176&view=rev
Log:
JCR-1164: Do not ignore exceptions from InputStream.close()

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java?rev=585176&r1=585175&r2=585176&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
Tue Oct 16 08:35:11 2007
@@ -866,17 +866,20 @@
      * Persists the custom node type definitions contained in the given
      * <code>store</code>.
      *
-     * @param store The {@link NodeTypeDefStore} containing the definitons to
+     * @param store The {@link NodeTypeDefStore} containing the definitions to
      *              be persisted.
-     * @throws RepositoryException If an error occurrs while persisting the
+     * @throws RepositoryException If an error occurs while persisting the
      *                             custom node type definitions.
      */
     protected void persistCustomNodeTypeDefs(NodeTypeDefStore store)
             throws RepositoryException {
-        OutputStream out = null;
         try {
-            out = customNodeTypesResource.getOutputStream();
-            store.store(out, nsReg);
+            OutputStream out = customNodeTypesResource.getOutputStream();
+            try {
+                store.store(out, nsReg);
+            } finally {
+                out.close();
+            }
         } catch (IOException ioe) {
             String error =
                     "internal error: failed to persist custom node type definitions to "
@@ -889,14 +892,6 @@
                     + customNodeTypesResource.getPath();
             log.debug(error);
             throw new RepositoryException(error, fse);
-        } finally {
-            if (out != null) {
-                try {
-                    out.close();
-                } catch (IOException ioe) {
-                    // ignore
-                }
-            }
         }
     }
 



Mime
View raw message