You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sb...@apache.org on 2001/08/21 05:06:46 UTC
cvs commit: xml-xalan/java/src/org/apache/xpath/axes ChildIterator.java ChildTestIterator.java DescendantIterator.java MatchPatternIterator.java SelfIteratorNoPredicate.java UnionPathIterator.java
sboag 01/08/20 20:06:46
Modified: java/src/org/apache/xalan/transformer KeyRefIterator.java
java/src/org/apache/xpath/axes ChildIterator.java
ChildTestIterator.java DescendantIterator.java
MatchPatternIterator.java
SelfIteratorNoPredicate.java UnionPathIterator.java
Log:
Fix for problem reported by Mike Starr <mi...@air2web.com>,
where the transformation hangs for "foo[2] | bang"
patters, i.e. unions with positional predicates. The fix
is to have the iterators#nextNode() set m_lastFetched to DTM.NULL
when m_foundLast is found to be true on function entry
(after the cache check). This allows getCurrentNode() to
fullfill it's contract of returning null if the last fetch was
null. The bug occured after an optimization for positional
predicates to have them not continue searching once
the positional node was found, by setting m_foundLast
to true.
Revision Changes Path
1.11 +3 -0 xml-xalan/java/src/org/apache/xalan/transformer/KeyRefIterator.java
Index: KeyRefIterator.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/KeyRefIterator.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- KeyRefIterator.java 2001/07/17 18:17:39 1.10
+++ KeyRefIterator.java 2001/08/21 03:06:45 1.11
@@ -135,7 +135,10 @@
{
if (m_foundLast)
+ {
+ m_lastFetched = DTM.NULL;
return DTM.NULL;
+ }
// If the cache is on, and the node has already been found, then
// just return from the list.
1.9 +3 -0 xml-xalan/java/src/org/apache/xpath/axes/ChildIterator.java
Index: ChildIterator.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/axes/ChildIterator.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ChildIterator.java 2001/08/07 19:16:43 1.8
+++ ChildIterator.java 2001/08/21 03:06:45 1.9
@@ -139,7 +139,10 @@
}
if (m_foundLast)
+ {
+ m_lastFetched = DTM.NULL;
return DTM.NULL;
+ }
int next;
1.13 +3 -0 xml-xalan/java/src/org/apache/xpath/axes/ChildTestIterator.java
Index: ChildTestIterator.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/axes/ChildTestIterator.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ChildTestIterator.java 2001/08/07 19:16:43 1.12
+++ ChildTestIterator.java 2001/08/21 03:06:45 1.13
@@ -202,7 +202,10 @@
}
if (m_foundLast)
+ {
+ m_lastFetched = DTM.NULL;
return DTM.NULL;
+ }
if(DTM.NULL == m_lastFetched)
{
1.14 +3 -0 xml-xalan/java/src/org/apache/xpath/axes/DescendantIterator.java
Index: DescendantIterator.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/axes/DescendantIterator.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- DescendantIterator.java 2001/08/07 19:16:43 1.13
+++ DescendantIterator.java 2001/08/21 03:06:45 1.14
@@ -229,7 +229,10 @@
}
if (m_foundLast)
+ {
+ m_lastFetched = DTM.NULL;
return DTM.NULL;
+ }
if(DTM.NULL == m_lastFetched)
{
1.3 +3 -0 xml-xalan/java/src/org/apache/xpath/axes/MatchPatternIterator.java
Index: MatchPatternIterator.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/axes/MatchPatternIterator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MatchPatternIterator.java 2001/06/12 19:16:18 1.2
+++ MatchPatternIterator.java 2001/08/21 03:06:45 1.3
@@ -243,7 +243,10 @@
}
if (m_foundLast)
+ {
+ m_lastFetched = DTM.NULL;
return DTM.NULL;
+ }
int next;
1.5 +3 -0 xml-xalan/java/src/org/apache/xpath/axes/SelfIteratorNoPredicate.java
Index: SelfIteratorNoPredicate.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/axes/SelfIteratorNoPredicate.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SelfIteratorNoPredicate.java 2001/06/20 20:42:07 1.4
+++ SelfIteratorNoPredicate.java 2001/08/21 03:06:45 1.5
@@ -80,7 +80,10 @@
}
if (m_foundLast)
+ {
+ m_lastFetched = DTM.NULL;
return DTM.NULL;
+ }
int next;
DTM dtm = m_cdtm;
1.24 +3 -0 xml-xalan/java/src/org/apache/xpath/axes/UnionPathIterator.java
Index: UnionPathIterator.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/axes/UnionPathIterator.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- UnionPathIterator.java 2001/08/07 19:16:43 1.23
+++ UnionPathIterator.java 2001/08/21 03:06:45 1.24
@@ -638,7 +638,10 @@
}
if (m_foundLast)
+ {
+ m_lastFetched = DTM.NULL;
return DTM.NULL;
+ }
// Loop through the iterators getting the current fetched
// node, and get the earliest occuring in document order
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org