mmidy 01/11/08 14:44:42
Modified: java/src/org/apache/xpath NodeSetDTM.java
Log:
Bugzilla 4158: Make sure we get the current, not the node pointed to by
m_next, which has been already incremented.
Revision Changes Path
1.9 +5 -1 xml-xalan/java/src/org/apache/xpath/NodeSetDTM.java
Index: NodeSetDTM.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/NodeSetDTM.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- NodeSetDTM.java 2001/09/28 20:09:52 1.8
+++ NodeSetDTM.java 2001/11/08 22:44:42 1.9
@@ -1194,7 +1194,11 @@
"This NodeSetDTM can not do indexing or counting functions!");
int saved = m_next;
- int n = (m_next < m_firstFree) ? elementAt(m_next) : DTM.NULL;
+ // because nextNode always increments
+ // But watch out for copy29, where the root iterator didn't
+ // have nextNode called on it.
+ int current = (m_next > 0) ? m_next-1 : m_next;
+ int n = (current < m_firstFree) ? elementAt(current) : DTM.NULL;
m_next = saved; // HACK: I think this is a bit of a hack. -sb
return n;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]