zongaro 2003/07/22 09:22:59
Modified: java/src/org/apache/xalan/xsltc/dom UnionIterator.java
Log:
Applying patch from Igor Hersht ([EMAIL PROTECTED]) for Bugzilla bug 18821.
Nested iterators in UnionIterator weren't correctly handling multiple calls to
setStartNode in generated code. Fixed by ignoring calls after the first.
Revision Changes Path
1.17 +7 -3
xml-xalan/java/src/org/apache/xalan/xsltc/dom/UnionIterator.java
Index: UnionIterator.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/UnionIterator.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- UnionIterator.java 26 Jun 2003 22:08:41 -0000 1.16
+++ UnionIterator.java 22 Jul 2003 16:22:59 -0000 1.17
@@ -83,6 +83,7 @@
private final static class LookAheadIterator {
public int node, markedNode;
public DTMAxisIterator iterator;
+ public boolean isStartSet = false;
public LookAheadIterator(DTMAxisIterator iterator) {
this.iterator = iterator;
@@ -197,8 +198,11 @@
if (_isRestartable) {
_startNode = node;
for (int i = 0; i < _free; i++) {
- _heap[i].iterator.setStartNode(node);
- _heap[i].step(); // to get the first node
+ if(!_heap[i].isStartSet){
+ _heap[i].iterator.setStartNode(node);
+ _heap[i].step(); // to get the first node
+ _heap[i].isStartSet = true;
+ }
}
// build heap
for (int i = (_heapSize = _free)/2; i >= 0; i--) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]