garyp 01/07/24 23:22:41 Modified: java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM.java Log: Fix bug 2727 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2727). Attributes which contain a namespace prefix are indicated by placing a negative number in the appropriate entry in the m_dataOrQName array. The absolute value of this number is an entry in m_data. However, in this example, there were no text nodes before the first namespaced attribute so the entry in m_data had an array index of 0. This resulted in an entry of zero, not a negative number, in m_dataOrQName. This situation got several routines which tested for < 0 confused. I looked at several ways of fixing this but decided to just always allocate m_data.elementAt(0) entry to a dummy entry. The other solutions involved runtime checking which could slow down this piece of code and I felt that wasting one entry was worth it to not slow down the run time. Revision Changes Path 1.13 +1 -0 xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java Index: SAX2DTM.java =================================================================== RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- SAX2DTM.java 2001/07/20 18:48:11 1.12 +++ SAX2DTM.java 2001/07/25 06:22:40 1.13 @@ -229,6 +229,7 @@ xstringfactory, doIndexing); m_data = new SuballocatedIntVector(doIndexing ? (1024*2) : 512, 1024); + m_data.addElement(0); // Need placeholder in case index into here must be <0. m_dataOrQName = new SuballocatedIntVector(m_initialblocksize); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
