xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ce...@apache.org
Subject svn commit: r158152 - xmlbeans/branches/1.x/src/xmlstore/org/apache/xmlbeans/impl/store/Saver.java
Date Fri, 18 Mar 2005 22:42:17 GMT
Author: cezar
Date: Fri Mar 18 14:42:15 2005
New Revision: 158152

URL: http://svn.apache.org/viewcvs?view=rev&rev=158152
Log:
Yana Kadiyska. Checking in patch of Jira-115

Modified:
    xmlbeans/branches/1.x/src/xmlstore/org/apache/xmlbeans/impl/store/Saver.java

Modified: xmlbeans/branches/1.x/src/xmlstore/org/apache/xmlbeans/impl/store/Saver.java
URL: http://svn.apache.org/viewcvs/xmlbeans/branches/1.x/src/xmlstore/org/apache/xmlbeans/impl/store/Saver.java?view=diff&r1=158151&r2=158152
==============================================================================
--- xmlbeans/branches/1.x/src/xmlstore/org/apache/xmlbeans/impl/store/Saver.java (original)
+++ xmlbeans/branches/1.x/src/xmlstore/org/apache/xmlbeans/impl/store/Saver.java Fri Mar 18
14:42:15 2005
@@ -2030,14 +2030,14 @@
             if (dCch == 0)
             {
                 _buf[ i ] = replacement.charAt( 0 );
-                return i + 1;
+                return (i + 1) % _buf.length;
             }
 
             assert _free >= 0;
 
             if (dCch > _free)
                 i = resize( dCch, i );
-            
+
             assert _free >= 0;
 
             assert _free >= dCch;
@@ -2051,6 +2051,13 @@
             }
             else
             {
+                if (_in + dCch >= _buf.length) {
+                  System.arraycopy(_buf, _out, _buf, 0, _in - _out);
+                  i -= _out;
+                  _in -= _out;
+                  _out = 0;
+                }
+
                 assert i < _in;
                 System.arraycopy( _buf, i, _buf, i + dCch, _in - i );
                 _in += dCch;
@@ -2062,7 +2069,7 @@
             
             assert _free >= 0;
 
-            return i + dCch + 1;
+            return (i + dCch + 1) % _buf.length;
         }
 
         int getAvailable ( )



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org


Mime
View raw message