xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mrgla...@apache.org
Subject svn commit: r581643 - /xerces/java/trunk/src/org/apache/xerces/impl/XMLEntityManager.java
Date Wed, 03 Oct 2007 16:07:30 GMT
Author: mrglavas
Date: Wed Oct  3 09:07:29 2007
New Revision: 581643

URL: http://svn.apache.org/viewvc?rev=581643&view=rev
Log:
Need to ensure that the buffer we're passing to the UTF-16 Reader is large enough.

Modified:
    xerces/java/trunk/src/org/apache/xerces/impl/XMLEntityManager.java

Modified: xerces/java/trunk/src/org/apache/xerces/impl/XMLEntityManager.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/XMLEntityManager.java?rev=581643&r1=581642&r2=581643&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/XMLEntityManager.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/XMLEntityManager.java Wed Oct  3 09:07:29
2007
@@ -2214,6 +2214,11 @@
         if (fTempByteBuffer == null) {
             fTempByteBuffer = fLargeByteBufferPool.getBuffer();
         }
+        // The cached buffer is too small, we need a larger one.
+        else if (fTempByteBuffer.length == fBufferSize) {
+            fSmallByteBufferPool.returnBuffer(fTempByteBuffer);
+            fTempByteBuffer = fLargeByteBufferPool.getBuffer();
+        }
         return new UTF16Reader(stream,
                 fTempByteBuffer, 
                 isBigEndian, 



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


Mime
View raw message