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/06 15:21:11 UTC

cvs commit: xml-xalan/java/src/org/apache/xml/dtm/ref DTMDefaultBaseIterators.java

sboag       01/08/06 06:21:11

  Modified:    java/src/org/apache/xml/dtm/ref DTMDefaultBaseIterators.java
  Log:
  Addresses bug http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3001.
  In the cloneIterator function of PrecedingIterator, the cloned array
  was being sized for _maxAncestors, which defaults to 8.  But if the
  _stack was resized, it will copy more into the new stack than is
  allocated.  The solution is to allocate the new clone._stack array to
  _stack.length.
  
  Revision  Changes    Path
  1.6       +2 -5      xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
  
  Index: DTMDefaultBaseIterators.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DTMDefaultBaseIterators.java	2001/08/04 20:54:20	1.5
  +++ DTMDefaultBaseIterators.java	2001/08/06 13:21:11	1.6
  @@ -1121,7 +1121,7 @@
     {
   
       /** The max ancestors, but it can grow... */
  -    private final int _maxAncestors = 8;
  +    static private final int _maxAncestors = 8;
   
       /**
        * The stack of start node + ancestors up to ROOTNODE,
  @@ -1151,15 +1151,12 @@
        */
       public DTMAxisIterator cloneIterator()
       {
  -
         _isRestartable = false;
   
  -      final int[] stackCopy = new int[_maxAncestors];
  -
         try
         {
           final PrecedingIterator clone = (PrecedingIterator) super.clone();
  -
  +        final int[] stackCopy = new int[_stack.length];
           System.arraycopy(_stack, 0, stackCopy, 0, _stack.length);
   
           clone._stack = stackCopy;
  
  
  

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