xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mor...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/dom BitArray.java DupFilterIterator.java KeyIndex.java
Date Wed, 19 Sep 2001 15:53:42 GMT
morten      01/09/19 08:53:42

  Modified:    java/src/org/apache/xalan/xsltc/dom BitArray.java
                        DupFilterIterator.java KeyIndex.java
  Log:
  A fix in the duplicate filter iterator to ensure that the iterator can be
  reset properly. The iterator was using its own variable for tracking the
  current node (not the base class' _position variable) but did not
  implement the reset() method).
  PR:		bugzilla 1430
  Obtained from:	n/a
  Submitted by:	morten@xml.apache.org
  Reviewed by:	morten@xml.apache.org
  
  Revision  Changes    Path
  1.2       +11 -2     xml-xalan/java/src/org/apache/xalan/xsltc/dom/BitArray.java
  
  Index: BitArray.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/BitArray.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BitArray.java	2001/04/17 18:52:27	1.1
  +++ BitArray.java	2001/09/19 15:53:42	1.2
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: BitArray.java,v 1.1 2001/04/17 18:52:27 sboag Exp $
  + * @(#)$Id: BitArray.java,v 1.2 2001/09/19 15:53:42 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -95,6 +95,13 @@
   	_bits = new int[_intSize + 1];
       }
   
  +    public BitArray(int size, int[] bits) {
  +	if (size < 32) size = 32;
  +	_bitSize = size;
  +	_intSize = (_bitSize >>> 5) + 1;
  +	_bits = bits;
  +    }
  +
       /**
        * Set the mask for this bit array. The upper 8 bits of this mask
        * indicate the DOM in which the nodes in this array belong.
  @@ -246,8 +253,10 @@
   	    _bitSize = newSize;
   	}
       }
  -
   
  +    public BitArray cloneArray() {
  +	return(new BitArray(_intSize, _bits));
  +    }
   }
   
   
  
  
  
  1.7       +6 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/DupFilterIterator.java
  
  Index: DupFilterIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DupFilterIterator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DupFilterIterator.java	2001/08/28 13:23:30	1.6
  +++ DupFilterIterator.java	2001/09/19 15:53:42	1.7
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: DupFilterIterator.java,v 1.6 2001/08/28 13:23:30 morten Exp $
  + * @(#)$Id: DupFilterIterator.java,v 1.7 2001/09/19 15:53:42 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -181,6 +181,11 @@
       public void gotoMark() {
   	_source.gotoMark();
   	_current = _markedNode;
  +    }
  +
  +    public NodeIterator reset() {
  +	_current = 0;
  +	return(this);
       }
   
   }
  
  
  
  1.5       +10 -2     xml-xalan/java/src/org/apache/xalan/xsltc/dom/KeyIndex.java
  
  Index: KeyIndex.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/KeyIndex.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- KeyIndex.java	2001/08/17 13:17:45	1.4
  +++ KeyIndex.java	2001/09/19 15:53:42	1.5
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: KeyIndex.java,v 1.4 2001/08/17 13:17:45 morten Exp $
  + * @(#)$Id: KeyIndex.java,v 1.5 2001/09/19 15:53:42 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -259,7 +259,15 @@
        * Returns a deep copy of this iterator.
        */
       public NodeIterator cloneIterator() {
  -	return((NodeIterator)this);
  +	KeyIndex other = new KeyIndex(_arraySize);
  +
  +	other._index = _index;
  +	other._nodes = _nodes.cloneArray();
  +	other._pos   = _pos;
  +	other._start = _start;
  +	other._node  = _node;
  +
  +	return(other);
       }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message