jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r355070 - in /incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit: core/state/db/SimpleDbPersistenceManager.java util/Text.java
Date Thu, 08 Dec 2005 11:07:00 GMT
Author: stefan
Date: Thu Dec  8 03:06:53 2005
New Revision: 355070

URL: http://svn.apache.org/viewcvs?rev=355070&view=rev
Log:
- fixed potential resource leak in SimpleDbPersistenceManager
- fixed typos in javadoc

Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/SimpleDbPersistenceManager.java
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/util/Text.java

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/SimpleDbPersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/SimpleDbPersistenceManager.java?rev=355070&r1=355069&r2=355070&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/SimpleDbPersistenceManager.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/db/SimpleDbPersistenceManager.java
Thu Dec  8 03:06:53 2005
@@ -1033,10 +1033,13 @@
                     stmt.execute();
                     final ResultSet rs = stmt.getResultSet();
                     if (!rs.next()) {
+                        closeResultSet(rs);
                         throw new Exception("no such BLOB: " + blobId);
                     }
                     InputStream in = rs.getBinaryStream(1);
                     if (in == null) {
+                        // some databases treat zero-length values as NULL;
+                        // return empty InputStream in such a case
                         closeResultSet(rs);
                         return new ByteArrayInputStream(new byte[0]);
                     }
@@ -1048,7 +1051,7 @@
                     return new FilterInputStream(in) {
                         public void close() throws IOException {
                             in.close();
-                            // close ResultSet
+                            // now it's safe to close ResultSet
                             closeResultSet(rs);
                         }
                     };

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/util/Text.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/util/Text.java?rev=355070&r1=355069&r2=355070&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/util/Text.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/util/Text.java
Thu Dec  8 03:06:53 2005
@@ -266,7 +266,7 @@
     /**
      * The list of characters that are not encoded by the <code>escape()</code>
      * and <code>unescape()</code> METHODS. They contains the characters as
-     * defined 'unreserved' in section 2.3 of the RFC 2396 'URI genric syntax':
+     * defined 'unreserved' in section 2.3 of the RFC 2396 'URI generic syntax':
      * <p/>
      * <pre>
      * unreserved  = alphanum | mark
@@ -309,7 +309,7 @@
     /**
      * Does an URL encoding of the <code>string</code> using the
      * <code>escape</code> character. The characters that don't need encoding
-     * are those defined 'unreserved' in section 2.3 of the 'URI genric syntax'
+     * are those defined 'unreserved' in section 2.3 of the 'URI generic syntax'
      * RFC 2396, but without the escape character.
      *
      * @param string the string to encode.
@@ -324,7 +324,7 @@
     /**
      * Does an URL encoding of the <code>string</code> using the
      * <code>escape</code> character. The characters that don't need encoding
-     * are those defined 'unreserved' in section 2.3 of the 'URI genric syntax'
+     * are those defined 'unreserved' in section 2.3 of the 'URI generic syntax'
      * RFC 2396, but without the escape character. If <code>isPath</code> is
      * <code>true</code>, additionally the slash '/' is ignored, too.
      *
@@ -358,7 +358,7 @@
     /**
      * Does a URL encoding of the <code>string</code>. The characters that
      * don't need encoding are those defined 'unreserved' in section 2.3 of
-     * the 'URI genric syntax' RFC 2396.
+     * the 'URI generic syntax' RFC 2396.
      *
      * @param string the string to encode
      * @return the escaped string
@@ -371,7 +371,7 @@
     /**
      * Does a URL encoding of the <code>path</code>. The characters that
      * don't need encoding are those defined 'unreserved' in section 2.3 of
-     * the 'URI genric syntax' RFC 2396. In contrast to the
+     * the 'URI generic syntax' RFC 2396. In contrast to the
      * {@link #escape(String)} method, not the entire path string is escaped,
      * but every individual part (i.e. the slashes are not escaped).
      *



Mime
View raw message