jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r562403 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java
Date Fri, 03 Aug 2007 10:32:07 GMT
Author: stefan
Date: Fri Aug  3 03:32:05 2007
New Revision: 562403

URL: http://svn.apache.org/viewvc?view=rev&rev=562403
Log:
JCR-1038: java.lang.ArrayIndexOutOfBoundsException while importXML in Java 6

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java?view=diff&rev=562403&r1=562402&r2=562403
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java
Fri Aug  3 03:32:05 2007
@@ -194,7 +194,9 @@
             } else {
                 if (bufferPos + length > buffer.length) {
                     // reallocate new buffer and spool old buffer contents
-                    char[] newBuffer = new char[buffer.length + BUFFER_INCREMENT];
+                    int bufferSize =
+                            BUFFER_INCREMENT * (((bufferPos + length) / BUFFER_INCREMENT)
+ 1);
+                    char[] newBuffer = new char[bufferSize];
                     System.arraycopy(buffer, 0, newBuffer, 0, bufferPos);
                     buffer = newBuffer;
                 }



Mime
View raw message