You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by jk...@apache.org on 2001/04/27 23:11:38 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/stree DocImpl.java
jkesselm 01/04/27 14:11:38
Modified: java/src/org/apache/xalan/stree DocImpl.java
Log:
Fix for #1561
Revision Changes Path
1.7 +22 -1 xml-xalan/java/src/org/apache/xalan/stree/DocImpl.java
Index: DocImpl.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/stree/DocImpl.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DocImpl.java 2001/03/05 19:54:47 1.6
+++ DocImpl.java 2001/04/27 21:11:37 1.7
@@ -106,7 +106,28 @@
public DocImpl(int charBufSize)
{
super(null);
- m_chars = new FastStringBuffer(charBufSize);
+
+ /*
+ * (Note that this takes an initial text buffer size, in characters,
+ * as its input parameter. FastStringBuffer's constructor expects the
+ * number of bits (power of two) needed to span that size. We need to
+ * convert.)
+ */
+
+ // Find highest bit
+ int bitCheck=charBufSize, bitCount=0;
+ while(bitCheck!=0)
+ {
+ ++bitCount;
+ bitCheck>>>=1;
+ }
+ //If any lower bits are set, bump bitCount up one
+ int mask=( 1<<(bitCount-1) -1 );
+ if ((charBufSize & mask) != 0)
+ ++bitCount;
+
+ m_chars = new FastStringBuffer(bitCount);
+
// m_id = m_idCount++;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org