jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r239383 - /incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java
Date Tue, 23 Aug 2005 09:38:33 GMT
Author: stefan
Date: Tue Aug 23 02:38:30 2005
New Revision: 239383

URL: http://svn.apache.org/viewcvs?rev=239383&view=rev
Log:
JCR-195: ArrayIndexOutOfBounds thrown on re-index of repository

Modified:
    incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java

Modified: incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java?rev=239383&r1=239382&r2=239383&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java
(original)
+++ incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java
Tue Aug 23 02:38:30 2005
@@ -291,12 +291,18 @@
             while (walker.iterateElements(VALUE_ELEMENT)) {
                 // read serialized value
                 String content = walker.getContent();
-                if (content.length() > 0) {
+                if (PropertyType.STRING == type) {
+                    // STRING value can be empty; ignore length
+                    values.add(InternalValue.valueOf(content, type));
+                } else if (content.length() > 0) {
+                    // non-empty non-STRING value
                     if (type == PropertyType.BINARY) {
                         // special handling required for binary value:
-                        // the value stores the path to the actual binary file in the blob
store
+                        // the value stores the path to the actual binary file
+                        // in the blob store
                         try {
-                            values.add(InternalValue.create(new FileSystemResource(blobStore,
content)));
+                            values.add(InternalValue.create(
+                                    new FileSystemResource(blobStore, content)));
                         } catch (IOException ioe) {
                             String msg = "error while reading serialized binary value";
                             log.debug(msg);
@@ -305,6 +311,10 @@
                     } else {
                         values.add(InternalValue.valueOf(content, type));
                     }
+                } else {
+                    // empty non-STRING value
+                    log.warn(state.getId() + ": ignoring empty value of type "
+                            + PropertyType.nameFromValue(type));
                 }
             }
             walker.leaveElement();



Mime
View raw message