You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by sh...@apache.org on 2001/09/20 06:31:49 UTC
cvs commit: jakarta-taglibs/jsptl/src/javax/servlet/jsptl IteratorTagSupport.java
shawn 01/09/19 21:31:49
Modified: jsptl/src/javax/servlet/jsptl IteratorTagSupport.java
Log:
Revision Changes Path
1.3 +12 -2 jakarta-taglibs/jsptl/src/javax/servlet/jsptl/IteratorTagSupport.java
Index: IteratorTagSupport.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jsptl/src/javax/servlet/jsptl/IteratorTagSupport.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- IteratorTagSupport.java 2001/07/08 17:52:57 1.2
+++ IteratorTagSupport.java 2001/09/20 04:31:49 1.3
@@ -250,7 +250,7 @@
last = false;
// throw away the first 'begin' items (if they exist)
- discard(begin);
+ discardIgnoreSubset(begin);
// get the item we're interested in
if (hasNext())
@@ -639,7 +639,17 @@
}
/*
- * returns true if the iteration has past the 'end' index (with
+ * Discards items ignoring subsetting rules. Useful for
+ * discarding items from the beginning (i.e., to implement 'begin')
+ * where we don't want factor in the 'begin' value already.
+ */
+ private void discardIgnoreSubset(int n) throws JspTagException {
+ while (n-- > 0 && hasNext())
+ next();
+ }
+
+ /*
+ * Returns true if the iteration has past the 'end' index (with
* respect to subsetting), false otherwise. ('end' must be set
* for atEnd() to return true; if 'end' is not set, atEnd()
* always returns false.)