cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor TreeProcessor.java
Date Tue, 29 Jul 2003 07:41:27 GMT
cziegeler    2003/07/29 00:41:27

  Modified:    src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        ComponentsSelector.java
               src/java/org/apache/cocoon/components/treeprocessor
                        TreeProcessor.java
  Log:
  Fixing NPE in releasing components from a selector: 
  the components were released in the wrong order: first the selector and
  then the components from the selector...
  
  Revision  Changes    Path
  1.4       +5 -1      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ComponentsSelector.java
  
  Index: ComponentsSelector.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ComponentsSelector.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ComponentsSelector.java	18 Jun 2003 11:06:31 -0000	1.3
  +++ ComponentsSelector.java	29 Jul 2003 07:41:26 -0000	1.4
  @@ -343,6 +343,10 @@
           return pipelineHint;
       }
   
  +    public void dispose() {
  +        super.dispose();
  +        this.parentSitemapSelector = null;
  +    }
   }
   
   
  
  
  
  1.10      +10 -10    cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
  
  Index: TreeProcessor.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TreeProcessor.java	28 Jul 2003 18:09:48 -0000	1.9
  +++ TreeProcessor.java	29 Jul 2003 07:41:27 -0000	1.10
  @@ -50,6 +50,11 @@
   */
   package org.apache.cocoon.components.treeprocessor;
   
  +import java.util.Collections;
  +import java.util.HashMap;
  +import java.util.List;
  +import java.util.Map;
  +
   import org.apache.avalon.excalibur.component.RoleManageable;
   import org.apache.avalon.excalibur.component.RoleManager;
   import org.apache.avalon.excalibur.logger.LogKitManageable;
  @@ -79,12 +84,6 @@
   import org.apache.cocoon.environment.Environment;
   import org.apache.excalibur.source.Source;
   
  -import java.util.Collections;
  -import java.util.HashMap;
  -import java.util.Iterator;
  -import java.util.List;
  -import java.util.Map;
  -
   /**
    * Interpreted tree-traversal implementation of a pipeline assembly language.
    *
  @@ -470,9 +469,10 @@
        */
       protected void disposeTree() {
           if (this.disposableNodes != null) {
  -            Iterator iter = this.disposableNodes.iterator();
  -            while (iter.hasNext()) {
  -                ((Disposable)iter.next()).dispose();
  +            // we must dispose the nodes in reverse order
  +            // otherwise selector nodes are freed before the components node
  +            for(int i=this.disposableNodes.size()-1; i>-1; i--) {
  +                ((Disposable)disposableNodes.get(i)).dispose();
               }
               this.disposableNodes = null;
           }
  
  
  

Mime
View raw message