mkwan       2002/12/11 08:18:03

  Modified:    java/src/org/apache/xpath/axes Tag: xslt20 AxesWalker.java
                        ChildTestIterator.java MatchPatternIterator.java
                        OneStepIterator.java ReverseAxesWalker.java
  Log:
  Propagate the memory leak fix (bugzilla 6075) to xslt20.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.24.2.1.2.1 +1 -0      
xml-xalan/java/src/org/apache/xpath/axes/AxesWalker.java
  
  Index: AxesWalker.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/axes/AxesWalker.java,v
  retrieving revision 1.24.2.1
  retrieving revision 1.24.2.1.2.1
  diff -u -r1.24.2.1 -r1.24.2.1.2.1
  --- AxesWalker.java   14 Aug 2002 20:06:57 -0000      1.24.2.1
  +++ AxesWalker.java   11 Dec 2002 16:18:02 -0000      1.24.2.1.2.1
  @@ -211,6 +211,7 @@
     { 
        m_currentNode = DTM.NULL;
        m_dtm = null;
  +     m_traverser = null;
        m_isFresh = true;
        m_root = DTM.NULL;
     }
  
  
  
  1.14.4.1.2.1 +17 -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.14.4.1
  retrieving revision 1.14.4.1.2.1
  diff -u -r1.14.4.1 -r1.14.4.1.2.1
  --- ChildTestIterator.java    14 Aug 2002 20:06:57 -0000      1.14.4.1
  +++ ChildTestIterator.java    11 Dec 2002 16:18:02 -0000      1.14.4.1.2.1
  @@ -206,5 +206,22 @@
       return org.apache.xml.dtm.Axis.CHILD;
     }
   
  +  /**
  +   *  Detaches the iterator from the set which it iterated over, releasing
  +   * any computational resources and placing the iterator in the INVALID
  +   * state. After<code>detach</code> has been invoked, calls to
  +   * <code>nextNode</code> or<code>previousNode</code> will raise the
  +   * exception INVALID_STATE_ERR.
  +   */
  +  public void detach()
  +  {   
  +    if(m_allowDetach)
  +    {
  +      m_traverser = null;
  +      
  +      // Always call the superclass detach last!
  +      super.detach();
  +    }
  +  }
   
   }
  
  
  
  1.4.4.1.2.1 +18 -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.4.4.1
  retrieving revision 1.4.4.1.2.1
  diff -u -r1.4.4.1 -r1.4.4.1.2.1
  --- MatchPatternIterator.java 14 Aug 2002 20:06:57 -0000      1.4.4.1
  +++ MatchPatternIterator.java 11 Dec 2002 16:18:02 -0000      1.4.4.1.2.1
  @@ -203,6 +203,24 @@
       super.setRoot(context, environment);
       m_traverser = m_cdtm.getAxisTraverser(m_superAxis);
     }
  +
  +  /**
  +   *  Detaches the iterator from the set which it iterated over, releasing
  +   * any computational resources and placing the iterator in the INVALID
  +   * state. After<code>detach</code> has been invoked, calls to
  +   * <code>nextNode</code> or<code>previousNode</code> will raise the
  +   * exception INVALID_STATE_ERR.
  +   */
  +  public void detach()
  +  {    
  +    if(m_allowDetach)
  +    {
  +      m_traverser = null;
  +      
  +      // Always call the superclass detach last!
  +      super.detach();
  +    }
  +  }
     
     /**
      * Get the next node via getNextXXX.  Bottlenecked for derived class 
override.
  
  
  
  1.8.4.1.2.2 +19 -0     
xml-xalan/java/src/org/apache/xpath/axes/OneStepIterator.java
  
  Index: OneStepIterator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xpath/axes/OneStepIterator.java,v
  retrieving revision 1.8.4.1.2.1
  retrieving revision 1.8.4.1.2.2
  diff -u -r1.8.4.1.2.1 -r1.8.4.1.2.2
  --- OneStepIterator.java      22 Nov 2002 17:30:51 -0000      1.8.4.1.2.1
  +++ OneStepIterator.java      11 Dec 2002 16:18:02 -0000      1.8.4.1.2.2
  @@ -74,6 +74,25 @@
         m_iterator = m_cdtm.getAxisIterator(m_axis);
       m_iterator.setStartNode(m_context);
     }
  +
  +  /**
  +   *  Detaches the iterator from the set which it iterated over, releasing
  +   * any computational resources and placing the iterator in the INVALID
  +   * state. After<code>detach</code> has been invoked, calls to
  +   * <code>nextNode</code> or<code>previousNode</code> will raise the
  +   * exception INVALID_STATE_ERR.
  +   */
  +  public void detach()
  +  {    
  +    if(m_allowDetach)
  +    {
  +      if(m_axis > -1)
  +        m_iterator = null;
  +      
  +      // Always call the superclass detach last!
  +      super.detach();
  +    }
  +  }
     
     /**
      * Get the next node via getFirstAttribute && getNextAttribute.
  
  
  
  1.10.4.1.2.1 +11 -0     
xml-xalan/java/src/org/apache/xpath/axes/ReverseAxesWalker.java
  
  Index: ReverseAxesWalker.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xpath/axes/ReverseAxesWalker.java,v
  retrieving revision 1.10.4.1
  retrieving revision 1.10.4.1.2.1
  diff -u -r1.10.4.1 -r1.10.4.1.2.1
  --- ReverseAxesWalker.java    14 Aug 2002 20:06:57 -0000      1.10.4.1
  +++ ReverseAxesWalker.java    11 Dec 2002 16:18:02 -0000      1.10.4.1.2.1
  @@ -99,6 +99,17 @@
       m_iterator = getDTM(root).getAxisIterator(m_axis);
       m_iterator.setStartNode(root);
     }
  +
  +  /**
  +   * Detaches the walker from the set which it iterated over, releasing
  +   * any computational resources and placing the iterator in the INVALID
  +   * state.
  +   */
  +  public void detach()
  +  {
  +    m_iterator = null;
  +    super.detach();
  +  }
     
     /**
      * Get the next node in document order on the axes.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to