cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r454150 - in /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor: ./ sitemap/
Date Sun, 08 Oct 2006 14:24:27 GMT
Author: vgritsenko
Date: Sun Oct  8 07:24:25 2006
New Revision: 454150

URL: http://svn.apache.org/viewvc?view=rev&rev=454150
Log:
improving cocoon stack traces

Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/CategoryNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ContainerNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ProcessingNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActSetNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActionSetNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/AggregateNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/CallFunctionNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/CallNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/GenerateNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/HandleErrorsNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MatchNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PreparableMatchNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ReadNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/RedirectToURINode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SelectNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/TransformNode.java

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,25 +22,24 @@
 import org.apache.cocoon.util.location.Location;
 
 /**
- *
  * @version $Id$
  */
-public abstract class AbstractProcessingNode 
-    extends AbstractLogEnabled 
-    implements ProcessingNode, ExecutionContext {
+public abstract class AbstractProcessingNode extends AbstractLogEnabled
+                                             implements ProcessingNode, ExecutionContext {
 
     protected Location location = Location.UNKNOWN;
 
     /** The type of the component */
     protected String componentName;
-    
+
     /** The sitemap executor */
     protected SitemapExecutor executor;
-    
+
+
     public AbstractProcessingNode(String type) {
         this.componentName = type;
     }
-    
+
     public AbstractProcessingNode() {
         this(null);
     }
@@ -58,15 +57,14 @@
     public void setLocation(Location location) {
         this.location = location;
     }
-    
+
     /**
      * Set the sitemap executor
      */
     public void setSitemapExecutor(SitemapExecutor executor) {
         this.executor = executor;
     }
-    
-    
+
     /* (non-Javadoc)
      * @see org.apache.cocoon.sitemap.ExecutionContext#getType()
      */

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/CategoryNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/CategoryNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/CategoryNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/CategoryNode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -29,38 +29,38 @@
  */
 public final class CategoryNode extends AbstractParentProcessingNode {
 
-    public CategoryNode(String type) {
-        super(type);
-    }
-    
     /** The name of this category */
     private String categoryName;
 
     /** The Map of named nodes in this category */
     private Map nodes;
 
+
+    public CategoryNode(String type) {
+        super(type);
+    }
+
     public void setCategory(String categoryName, Map nodes) {
         this.categoryName = categoryName;
-        this.nodes = (nodes != null) ? nodes : new HashMap(0);
+        this.nodes = nodes != null ? nodes : new HashMap(0);
     }
 
-    public final boolean invoke(Environment env, InvokeContext context) throws Exception {
-        String msg = "Cannot invoke " + this.categoryName + " at " + getLocation();
-        throw new ProcessingException(msg);
+    public boolean invoke(Environment env, InvokeContext context) throws Exception {
+        throw new ProcessingException("Cannot invoke " + this.categoryName, getLocation());
     }
 
-    public final ProcessingNode getNodeByName(String name) throws Exception {
+    public ProcessingNode getNodeByName(String name) throws Exception {
         ProcessingNode node = (ProcessingNode)nodes.get(name);
         if (node == null) {
-            String msg = "Unknown " + this.categoryName + " named '" + name + "' at " + getLocation();
-            throw new ProcessingException(msg);
+            throw new ProcessingException("Unknown " + this.categoryName + " named '" + name + "'",
+                                          getLocation());
         }
 
         return node;
     }
 
-    public final boolean invokeByName(String name, Environment env, InvokeContext context)
-      throws Exception {
+    public boolean invokeByName(String name, Environment env, InvokeContext context)
+    throws Exception {
 
         return getNodeByName(name).invoke(env, context);
     }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java Sun Oct  8 07:24:25 2006
@@ -72,7 +72,10 @@
     /** Root node of the processing tree */
     private ProcessingNode rootNode;
 
-    /** Number of simultaneous uses of this processor (either by concurrent request or by internal requests) */
+    /**
+     * Number of simultaneous uses of this processor (either by concurrent
+     * request or by internal requests)
+     */
     private int requestCount;
 
     /** The sitemap executor */
@@ -233,8 +236,7 @@
             context.setLastProcessor(this);
 
             try {
-                final boolean success = this.rootNode.invoke(environment, context);
-                return success;
+                return this.rootNode.invoke(environment, context);
             } finally {
                 EnvironmentHelper.leaveProcessor();
                 // Restore old redirector

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ContainerNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ContainerNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ContainerNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ContainerNode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,9 +28,9 @@
     public ContainerNode(String type) {
         super(type);
     }
-    
+
     /* (non-Javadoc)
-     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(org.apache.cocoon.environment.Environment, org.apache.cocoon.components.treeprocessor.InvokeContext)
+     * @see ProcessingNode#invoke(Environment, InvokeContext)
      */
     public final boolean invoke(Environment env, InvokeContext context) throws Exception {
 

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ProcessingNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ProcessingNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ProcessingNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ProcessingNode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,7 +23,6 @@
 import org.apache.cocoon.util.location.Location;
 
 /**
- *
  * @version $Id$
  */
 public interface ProcessingNode extends ThreadSafe, Locatable {

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActSetNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActSetNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActSetNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActSetNode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,6 +22,7 @@
 import org.apache.cocoon.components.treeprocessor.SimpleParentProcessingNode;
 import org.apache.cocoon.components.treeprocessor.variables.VariableResolver;
 import org.apache.cocoon.environment.Environment;
+import org.apache.cocoon.ProcessingException;
 
 import java.util.Map;
 
@@ -31,7 +32,7 @@
  * @version $Id$
  */
 public class ActSetNode extends SimpleParentProcessingNode
-  implements ParameterizableProcessingNode {
+                        implements ParameterizableProcessingNode {
 
     /** The parameters of this node */
     private Map parameters;
@@ -39,10 +40,11 @@
     /** The action set to call */
     private ActionSetNode actionSet;
 
+
     public ActSetNode() {
         super(null);
     }
-    
+
     public void setParameters(Map parameterMap) {
         this.parameters = parameterMap;
     }
@@ -52,9 +54,9 @@
     }
 
     public final boolean invoke(Environment env, InvokeContext context)
-      throws Exception {
+    throws Exception {
 
-        // Perform any common invoke functionality 
+        // Perform any common invoke functionality
         super.invoke(env, context);
 
         Parameters resolvedParams = VariableResolver.buildParameters(
@@ -63,19 +65,23 @@
             env.getObjectModel()
         );
 
-        Map result = this.actionSet.call(env, context, resolvedParams);
-
-        if (context.getRedirector().hasRedirected()) {
-            return true;
+        try {
+            Map result = this.actionSet.call(env, context, resolvedParams);
 
-        } else if (result == null) {
-            return false;
+            if (context.getRedirector().hasRedirected()) {
+                return true;
 
-        } else if (this.children == null) {
-            return true;
+            } else if (result == null) {
+                return false;
 
-        } else {
-            return this.invokeNodes(this.children, env, context, null, result);
+            } else if (this.children == null) {
+                return true;
+
+            } else {
+                return this.invokeNodes(this.children, env, context, null, result);
+            }
+        } catch (Exception e) {
+            throw ProcessingException.throwLocated("Sitemap: error invoking action set", e, getLocation());
         }
     }
 }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,6 +20,8 @@
 import java.util.Map;
 
 import org.apache.avalon.framework.parameters.Parameters;
+
+import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.acting.Action;
 import org.apache.cocoon.components.treeprocessor.InvokeContext;
 import org.apache.cocoon.components.treeprocessor.ParameterizableProcessingNode;
@@ -36,7 +38,7 @@
  * @version $Id$
  */
 public class ActTypeNode extends SimpleSelectorProcessingNode
-  implements ParameterizableProcessingNode {
+                         implements ParameterizableProcessingNode {
 
     /** The parameters of this node */
     private Map parameters;
@@ -49,8 +51,9 @@
 
     protected boolean inActionSet;
 
-    public ActTypeNode(String type, 
-                       VariableResolver source, 
+
+    public ActTypeNode(String type,
+                       VariableResolver source,
                        String name,
                        boolean inActionSet)  {
         super(Action.ROLE + "Selector", type);
@@ -64,26 +67,21 @@
     }
 
     public final boolean invoke(Environment env, InvokeContext context)
-          throws Exception {
+    throws Exception {
 
-        // Perform any common invoke functionality 
+        // Perform any common invoke functionality
         super.invoke(env, context);
 
         // Prepare data needed by the action
         Map objectModel = env.getObjectModel();
-        Redirector redirector = context.getRedirector();
-        SourceResolver resolver = EnvironmentHelper.getCurrentProcessor().getSourceResolver();
         String resolvedSource = source.resolve(context, objectModel);
         Parameters resolvedParams =
-            VariableResolver.buildParameters(this.parameters,
-                    context, objectModel);
-
-        Map actionResult;
+            VariableResolver.buildParameters(this.parameters, context, objectModel);
 
         // If in action set, merge parameters
         if (inActionSet) {
             Parameters callerParams =
-                (Parameters)env.getAttribute(ActionSetNode.CALLER_PARAMETERS);
+                (Parameters) env.getAttribute(ActionSetNode.CALLER_PARAMETERS);
             if (resolvedParams == Parameters.EMPTY_PARAMETERS) {
                 // Just swap
                 resolvedParams = callerParams;
@@ -97,46 +95,52 @@
             }
         }
 
-        Action action = (Action)getComponent();
+        Redirector redirector = context.getRedirector();
+        SourceResolver resolver = EnvironmentHelper.getCurrentProcessor().getSourceResolver();
+
         try {
-            actionResult = this.executor.invokeAction(this,
-                                             objectModel, 
-                                             action, 
-                                             redirector, 
-                                             resolver, 
-                                             resolvedSource, 
-                                             resolvedParams);
-        } finally {
-            releaseComponent(action);
-        }
+            Action action = (Action) getComponent();
+            Map actionResult;
+            try {
+                actionResult = this.executor.invokeAction(this,
+                                                          objectModel,
+                                                          action,
+                                                          redirector,
+                                                          resolver,
+                                                          resolvedSource,
+                                                          resolvedParams);
+            } finally {
+                releaseComponent(action);
+            }
 
-        if (redirector.hasRedirected()) {
-            return true;
-        }
+            if (redirector.hasRedirected()) {
+                return true;
+            }
 
-        if (actionResult != null) {
-            // Action succeeded : process children if there are some, with the action result
-            if (this.children != null) {
-                boolean result = this.invokeNodes(this.children, env, context, name, actionResult);
-
-                if (inActionSet) {
-                    // Merge child action results, if any
-                    Map childMap = (Map)env.getAttribute(ActionSetNode.ACTION_RESULTS);
-                    if (childMap != null) {
-                        Map newResults = new HashMap(childMap);
-                        newResults.putAll(actionResult);
-                        env.setAttribute(ActionSetNode.ACTION_RESULTS, newResults);
-                    } else {
-                        // No previous results
-                        env.setAttribute(ActionSetNode.ACTION_RESULTS, actionResult);
+            if (actionResult != null) {
+                // Action succeeded : process children if there are some, with the action result
+                if (this.children != null) {
+                    boolean result = invokeNodes(this.children, env, context, name, actionResult);
+
+                    if (inActionSet) {
+                        // Merge child action results, if any
+                        Map childMap = (Map) env.getAttribute(ActionSetNode.ACTION_RESULTS);
+                        if (childMap != null) {
+                            Map newResults = new HashMap(childMap);
+                            newResults.putAll(actionResult);
+                            env.setAttribute(ActionSetNode.ACTION_RESULTS, newResults);
+                        } else {
+                            // No previous results
+                            env.setAttribute(ActionSetNode.ACTION_RESULTS, actionResult);
+                        }
                     }
+                    return result;
                 }
-                return result;
-            }// else {
-               // return false; // Return false to continue sitemap invocation
-            //}
-        }// else {
-            return false;   // Action failed
-        //}
+            }
+        } catch (Exception e) {
+            throw ProcessingException.throwLocated("Sitemap: error invoking action", e, getLocation());
+        }
+
+        return false;   // Action failed
     }
 }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActionSetNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActionSetNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActionSetNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ActionSetNode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,6 +20,8 @@
 import java.util.Map;
 
 import org.apache.avalon.framework.parameters.Parameters;
+
+import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.components.treeprocessor.AbstractProcessingNode;
 import org.apache.cocoon.components.treeprocessor.InvokeContext;
 import org.apache.cocoon.components.treeprocessor.NamedProcessingNode;
@@ -27,14 +29,13 @@
 import org.apache.cocoon.environment.Environment;
 
 /**
- *
  * @version $Id$
  */
 public class ActionSetNode extends AbstractProcessingNode
-  implements NamedProcessingNode {
-      
+                           implements NamedProcessingNode {
+
     public static final String CALLER_PARAMETERS = ActionSetNode.class.getName() + "/CallerParameters";
-    public static final String ACTION_RESULTS = ActionSetNode.class.getName() + "/ActionResults";
+    public static final String ACTION_RESULTS    = ActionSetNode.class.getName() + "/ActionResults";
 
     /** The action nodes */
     private ProcessingNode[] nodes;
@@ -42,65 +43,62 @@
     /** The 'action' attribute for each action */
     private String[] actionNames;
 
-    public ActionSetNode(
-      String name, ProcessingNode[] nodes, String[] actionNames) {
+
+    public ActionSetNode(String name, ProcessingNode[] nodes, String[] actionNames) {
         super(name);
         this.nodes = nodes;
         this.actionNames = actionNames;
     }
 
     public final boolean invoke(Environment env, InvokeContext context)
-      throws Exception {
-	
-        // Perform any common invoke functionalty 
-        // super.invoke(env, context);
-        String msg = "An action-set cannot be invoked, at " + this.getLocation();
-        throw new UnsupportedOperationException(msg);
+    throws Exception {
+        throw new ProcessingException("An action-set cannot be invoked", getLocation());
     }
 
     /**
      * Call the actions composing the action-set and return the combined result of
      * these actions.
      */
-    public final Map call(Environment env, InvokeContext context, Parameters params) throws Exception {
+    public final Map call(Environment env, InvokeContext context, Parameters params)
+    throws Exception {
 
         String cocoonAction = env.getAction();
 
         // Store the parameters from the caller into the environment so that they can be merged with
         // each action's parameters.
-        
-
-        Map result = null;
-
-        // Call each action that either has no cocoonAction, or whose cocoonAction equals
-        // the one from the environment.
         env.setAttribute(CALLER_PARAMETERS, params);
 
-        for (int i = 0; i < nodes.length; i++) {
-
+        Map result = null;
 
-            String actionName = actionNames[i];
-            if (actionName == null || actionName.equals(cocoonAction)) {
-                
-                this.nodes[i].invoke(env, context);
-                
-                // Get action results. They're passed back through the environment since action-sets
-                // "violate" the tree hierarchy (the returned Map is visible outside of the node)
-                Map actionResult = (Map)env.getAttribute(ACTION_RESULTS);
-                // Don't forget to clear it
-                env.removeAttribute(ACTION_RESULTS);
-                
-                if (actionResult != null) {
-                    // Merge the result in the global result, creating it if necessary.
-                    if (result == null) {
-                        result = new HashMap(actionResult);
-                    } else {
-                        result.putAll(actionResult);
+        try {
+            // Call each action that either has no cocoonAction, or whose cocoonAction equals
+            // the one from the environment.
+            for (int i = 0; i < nodes.length; i++) {
+
+                String actionName = actionNames[i];
+                if (actionName == null || actionName.equals(cocoonAction)) {
+
+                    this.nodes[i].invoke(env, context);
+
+                    // Get action results. They're passed back through the environment since action-sets
+                    // "violate" the tree hierarchy (the returned Map is visible outside of the node)
+                    Map actionResult = (Map) env.getAttribute(ACTION_RESULTS);
+                    // Don't forget to clear it
+                    env.removeAttribute(ACTION_RESULTS);
+
+                    if (actionResult != null) {
+                        // Merge the result in the global result, creating it if necessary.
+                        if (result == null) {
+                            result = new HashMap(actionResult);
+                        } else {
+                            result.putAll(actionResult);
+                        }
                     }
                 }
-                
-            } // if (actionName...
-        } // for (int i...
+            }
+        } catch (Exception e) {
+            throw ProcessingException.throwLocated("Sitemap: error invoking action set", e, getLocation());
+        }
 
         return result;
     }
@@ -108,7 +106,6 @@
     /**
      * Implementation of <code>NamedProcessingNode</code>.
      */
-
     public String getName() {
         return this.componentName;
     }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/AggregateNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/AggregateNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/AggregateNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/AggregateNode.java Sun Oct  8 07:24:25 2006
@@ -62,6 +62,7 @@
     /** View nodes to jump to */
     private Map viewNodes;
 
+
     public AggregateNode(VariableResolver element, VariableResolver nsURI, VariableResolver nsPrefix) {
         super(null);
         this.element = element;
@@ -103,7 +104,7 @@
 
         } else {
             // Are there some parts that match this view ?
-            actualParts = (Part[])this.viewParts.get(cocoonView);
+            actualParts = (Part[]) this.viewParts.get(cocoonView);
 
             // If not, keep all parts
             if (actualParts == null) {
@@ -138,7 +139,7 @@
 
         // Check aggregate-level view
         if (cocoonView != null && this.viewNodes != null) {
-            ProcessingNode viewNode = (ProcessingNode)this.viewNodes.get(cocoonView);
+            ProcessingNode viewNode = (ProcessingNode) this.viewNodes.get(cocoonView);
             if (viewNode != null) {
                 if (infoEnabled) {
                     getLogger().info("Jumping to view '" + cocoonView + "' from aggregate at " + this.getLocation());

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/CallFunctionNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/CallFunctionNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/CallFunctionNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/CallFunctionNode.java Sun Oct  8 07:24:25 2006
@@ -68,17 +68,12 @@
 
         Map objectModel = env.getObjectModel();
 
-        // Resolve parameters
-        Parameters params = VariableResolver.buildParameters(this.parameters, context, objectModel);
-
-        // Build the list of positional arguments
-        //TODO (SW): Deprecate this in the future.
-        // It has be found to be bad practice to pass sitemap parameters
-        // as function arguments, as these are name-value pairs in the sitemap
-        // and positional arguments in the flowscript. If the user doesn't respect
-        // the argument order, this leads to difficult to solve bugs.
+        // Build the list of arguments
         List args;
         if (argumentNames.length != 0) {
+            // Resolve parameters
+            Parameters params = VariableResolver.buildParameters(this.parameters, context, objectModel);
+
             args = new ArrayList(argumentNames.length);
             for (int i = 0; i < argumentNames.length; i++) {
                 String name = argumentNames[i];
@@ -97,11 +92,11 @@
         if (continuation != null && continuation.length() > 0) {
             try {
                 interpreter.handleContinuation(continuation, args, redirector);
-            } catch(Exception e) {
+            } catch (Exception e) {
                 throw ProcessingException.throwLocated("Sitemap: error calling continuation", e, getLocation());
             }
             if (!redirector.hasRedirected()) {
-                throw new ProcessingException("Sitemap: <map:call continuation> did not send a response", getLocation());
+                throw new ProcessingException("Sitemap: continuation did not send a response", getLocation());
             }
             return true;
         }
@@ -112,11 +107,11 @@
         if (name != null && name.length() > 0) {
             try {
                 interpreter.callFunction(name, args, redirector);
-            } catch(Exception e) {
+            } catch (Exception e) {
                 throw ProcessingException.throwLocated("Sitemap: error calling function '" + name + "'", e, getLocation());
             }
             if (!redirector.hasRedirected()) {
-                throw new ProcessingException("Sitemap: <map:call function> did not send a response", getLocation());
+                throw new ProcessingException("Sitemap: function '" + name + "' did not send a response", getLocation());
             }
             return true;
         }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/CallNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/CallNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/CallNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/CallNode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,13 +24,14 @@
 import org.apache.cocoon.components.treeprocessor.ParameterizableProcessingNode;
 import org.apache.cocoon.components.treeprocessor.variables.VariableResolver;
 import org.apache.cocoon.environment.Environment;
+import org.apache.cocoon.ProcessingException;
 
 /**
  *
  * @version $Id$
  */
 public class CallNode extends AbstractProcessingNode
-    implements ParameterizableProcessingNode {
+                      implements ParameterizableProcessingNode {
 
     /** The parameters of this node */
     private Map parameters;
@@ -41,13 +42,14 @@
     /** The category node */
     private CategoryNode resources;
 
+
     public CallNode() {
         super(null);
     }
-    
+
     /* (non-Javadoc)
-     * @see org.apache.cocoon.components.treeprocessor.ParameterizableProcessingNode#setParameters(java.util.Map)
-     */
+    * @see ParameterizableProcessingNode#setParameters(java.util.Map)
+    */
     public void setParameters(Map parameterMap) {
         this.parameters = parameterMap;
     }
@@ -58,28 +60,29 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(org.apache.cocoon.environment.Environment, org.apache.cocoon.components.treeprocessor.InvokeContext)
+     * @see ProcessingNode#invoke(Environment, InvokeContext)
      */
     public final boolean invoke(Environment env, InvokeContext context)
-      throws Exception {
+    throws Exception {
 
         Map objectModel = env.getObjectModel();
-        // Resolve parameters, but push them only once the resource name has been
-        // resolved, otherwise it adds an unwanted nesting level
-        Map params = VariableResolver.buildMap(this.parameters, context, objectModel);
 
         // Resolved resource name
         String name = this.resourceName.resolve(context, objectModel);
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Calling resource " + name);
+            getLogger().debug("Calling resource '" + name + "'");
         }
-        
-        // and only now push the parameters
+
+        // Resolve and push parameters after resource name has been
+        // resolved, otherwise it adds an unwanted nesting level
+        Map params = VariableResolver.buildMap(this.parameters, context, objectModel);
         params = this.executor.pushVariables(this, objectModel, null, params);
-        context.pushMap(null,params);
-        
+        context.pushMap(null, params);
+
         try {
             return this.resources.invokeByName(name, env, context);
+        } catch (Exception e) {
+            throw ProcessingException.throwLocated("Sitemap: error calling resource '" + name + "'", e, getLocation());
         } finally {
             this.executor.popVariables(this, objectModel);
             context.popMap();

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNode.java Sun Oct  8 07:24:25 2006
@@ -39,6 +39,7 @@
     private ServiceManager manager;
     private Interpreter interpreter;
 
+
     public FlowNode(String language) {
         this.language = language;
     }
@@ -51,8 +52,8 @@
      * @param manager a <code>ServiceManager</code> value
      * @exception ServiceException if no flow interpreter could be obtained
      */
-    public void service(ServiceManager aManager) throws ServiceException {
-        this.manager = aManager;
+    public void service(ServiceManager manager) throws ServiceException {
+        this.manager = manager;
 
         try {
             // Obtain the Interpreter instance for this language

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/GenerateNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/GenerateNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/GenerateNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/GenerateNode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,10 +28,10 @@
 import org.apache.cocoon.sitemap.SitemapExecutor;
 
 /**
- *
  * @version $Id$
  */
-public class GenerateNode extends PipelineEventComponentProcessingNode implements ParameterizableProcessingNode {
+public class GenerateNode extends PipelineEventComponentProcessingNode
+                          implements ParameterizableProcessingNode {
 
     private String generatorName;
 
@@ -50,13 +50,13 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(org.apache.cocoon.environment.Environment, org.apache.cocoon.components.treeprocessor.InvokeContext)
+     * @see ProcessingNode#invoke(Environment, InvokeContext)
      */
     public final boolean invoke(Environment env, InvokeContext context)
     throws Exception {
 
         final Map objectModel = env.getObjectModel();
-        
+
         SitemapExecutor.PipelineComponentDescription desc = new SitemapExecutor.PipelineComponentDescription();
         desc.type = this.generatorName;
         desc.source = source.resolve(context, objectModel);
@@ -64,20 +64,16 @@
         desc.hintParameters = this.pipelineHints == null
                 ? Parameters.EMPTY_PARAMETERS
                 : VariableResolver.buildParameters(this.pipelineHints, context, objectModel);
-        
+
         desc = this.executor.addGenerator(this, objectModel, desc);
-        
-        context.getProcessingPipeline().setGenerator(
-            desc.type,
-            desc.source,
-            desc.parameters,
-            desc.hintParameters
-        );
 
+        context.getProcessingPipeline().setGenerator(desc.type,
+                                                     desc.source,
+                                                     desc.parameters,
+                                                     desc.hintParameters);
 
         // Check view
         if (this.views != null) {
-	 
             //inform the pipeline that we have a branch point
             context.getProcessingPipeline().informBranchPoint();
 
@@ -85,7 +81,7 @@
             if (cocoonView != null) {
 
                 // Get view node
-                ProcessingNode viewNode = (ProcessingNode)this.views.get(cocoonView);
+                ProcessingNode viewNode = (ProcessingNode) this.views.get(cocoonView);
 
                 if (viewNode != null) {
                     if (getLogger().isInfoEnabled()) {

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/HandleErrorsNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/HandleErrorsNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/HandleErrorsNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/HandleErrorsNode.java Sun Oct  8 07:24:25 2006
@@ -94,9 +94,9 @@
 
                     env.getObjectModel().remove(Constants.NOTIFYING_OBJECT);
                     throw new ProcessingException(
-                        "Incomplete pipeline: 'handle-error' without a 'type' must include a generator, at " +
-                        getLocation() + SystemUtils.LINE_SEPARATOR +
-                        "Either add a generator (preferred) or a type='500' attribute (deprecated) on 'handle-errors'");
+                        "Incomplete pipeline: 'handle-error' without a 'type' must include a generator." +
+                        SystemUtils.LINE_SEPARATOR +
+                        "Either add a generator (preferred) or a type='500' attribute (deprecated) on 'handle-errors'", getLocation());
                 }
 
                 // Rethrow the exception
@@ -113,9 +113,9 @@
 
                 env.getObjectModel().remove(Constants.NOTIFYING_OBJECT);
                 throw new ProcessingException(
-                        "Error: 'handle-error' with a 'type' attribute has an implicit generator, at " +
-                        getLocation() + SystemUtils.LINE_SEPARATOR +
-                        "Please remove the 'type' attribute on 'handle-error'");
+                        "Error: 'handle-error' with a 'type' attribute has an implicit generator." +
+                        SystemUtils.LINE_SEPARATOR +
+                        "Please remove the 'type' attribute on 'handle-error'", getLocation());
             }
             // Rethrow the exception
             throw e;

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MatchNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MatchNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MatchNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MatchNode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,6 +19,8 @@
 import java.util.Map;
 
 import org.apache.avalon.framework.parameters.Parameters;
+
+import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.components.treeprocessor.InvokeContext;
 import org.apache.cocoon.components.treeprocessor.ParameterizableProcessingNode;
 import org.apache.cocoon.components.treeprocessor.SimpleSelectorProcessingNode;
@@ -27,11 +29,10 @@
 import org.apache.cocoon.matching.Matcher;
 
 /**
- *
  * @version $Id$
  */
 public class MatchNode extends SimpleSelectorProcessingNode
-        implements ParameterizableProcessingNode {
+                       implements ParameterizableProcessingNode {
 
     /** The 'pattern' attribute */
     private VariableResolver pattern;
@@ -41,6 +42,7 @@
 
     private Map parameters;
 
+
     public MatchNode(String type, VariableResolver pattern, String name) {
         super(Matcher.ROLE + "Selector", type);
         this.pattern = pattern;
@@ -52,9 +54,9 @@
     }
 
     public final boolean invoke(Environment env, InvokeContext context)
-      throws Exception {
-	
-        // Perform any common invoke functionality 
+    throws Exception {
+
+        // Perform any common invoke functionality
         super.invoke(env, context);
 
         Map objectModel = env.getObjectModel();
@@ -62,28 +64,32 @@
         String resolvedPattern = pattern.resolve(context, objectModel);
         Parameters resolvedParams = VariableResolver.buildParameters(this.parameters, context, objectModel);
 
-        Map result = null;
-
-        Matcher matcher = (Matcher)getComponent();
         try {
-            result = this.executor.invokeMatcher(this, 
-                    objectModel, 
-                    matcher, 
-                    resolvedPattern, 
-                    resolvedParams);
-        } finally {
-            releaseComponent(matcher);
-        }
-
-        if (result != null) {
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("Matcher '" + this.componentName + "' matched pattern '" + this.pattern +
-                    "' at " + this.getLocation());
+            Map result = null;
+            Matcher matcher = (Matcher) getComponent();
+            try {
+                result = this.executor.invokeMatcher(this,
+                                                     objectModel,
+                                                     matcher,
+                                                     resolvedPattern,
+                                                     resolvedParams);
+            } finally {
+                releaseComponent(matcher);
             }
 
-            // Invoke children with the matcher results
-            return this.invokeNodes(children, env, context, name, result);
+            if (result != null) {
+                if (getLogger().isDebugEnabled()) {
+                    getLogger().debug("Matcher '" + this.componentName + "' matched pattern '" + this.pattern +
+                                      "' at " + getLocation());
+                }
+
+                // Invoke children with the matcher results
+                return invokeNodes(children, env, context, name, result);
+            }
+        } catch (Exception e) {
+            throw ProcessingException.throwLocated("Sitemap: error invoking matcher", e, getLocation());
         }
+
         // Matcher failed
         return false;
     }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java Sun Oct  8 07:24:25 2006
@@ -32,7 +32,6 @@
 import org.apache.commons.lang.BooleanUtils;
 
 /**
- *
  * @version $Id$
  */
 public class MountNode extends AbstractProcessingNode
@@ -60,6 +59,7 @@
     /** The value of the 'pass-through' attribute */
     private final Boolean passThrough;
 
+
     public MountNode(VariableResolver prefix,
                      VariableResolver source,
                      TreeProcessor parentProcessor,
@@ -73,7 +73,7 @@
     }
 
     /**
-     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(org.apache.cocoon.environment.Environment, org.apache.cocoon.components.treeprocessor.InvokeContext)
+     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(Environment, InvokeContext)
      */
     public final boolean invoke(Environment env, InvokeContext context)
     throws Exception {
@@ -85,6 +85,7 @@
         if (resolvedSource.length() == 0) {
             throw new ProcessingException("Source of mount statement is empty");
         }
+
         // Handle directory mounts
         if (resolvedSource.charAt(resolvedSource.length() - 1) == '/') {
             resolvedSource = resolvedSource + "sitemap.xmap";
@@ -137,7 +138,6 @@
 
         TreeProcessor processor = (TreeProcessor) processors.get(source);
         if (processor == null) {
-
             processor = this.parentProcessor.createChildProcessor(source, this.checkReload, prefix);
 
             // Associate to the original source

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java Sun Oct  8 07:24:25 2006
@@ -60,6 +60,7 @@
     /** Optional sitemap parameters */
     protected Map parameters;
 
+
     /**
      * A constructor to receive the optional expires parameter
      * and optional parameters for the processing pipeline
@@ -107,6 +108,7 @@
 
     public final boolean invoke(Environment env, InvokeContext context)
     throws Exception {
+
         boolean passThrough;
         Object passThroughRaw = env.getAttribute(MountNode.COCOON_PASS_THROUGH);
         if (passThroughRaw == null) {
@@ -128,13 +130,12 @@
         }
 
         Parameters params = VariableResolver.buildParameters(this.parameters,
-                context,
-                env.getObjectModel());
+                                                             context,
+                                                             env.getObjectModel());
 
         SitemapExecutor.PipelineComponentDescription desc = new SitemapExecutor.PipelineComponentDescription();
         desc.type = this.processingPipeline;
         desc.parameters = params;
-
         desc = this.executor.enteringPipeline(this, env.getObjectModel(), desc);
         context.inform(desc.type, desc.parameters, env.getObjectModel());
 
@@ -144,7 +145,7 @@
                 context.setErrorHandler(
                         new SitemapErrorHandler(this.errorHandlerHelper, env, context));
             } else {
-                // Reset internal error handler (previous pipeline might had set it) 
+                // Reset internal error handler (previous pipeline might had set it)
                 context.setErrorHandler(null);
             }
 

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java Sun Oct  8 07:24:25 2006
@@ -39,6 +39,7 @@
 
     private ErrorHandlerHelper errorHandlerHelper;
 
+
     /**
      * Constructor
      */

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PreparableMatchNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PreparableMatchNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PreparableMatchNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PreparableMatchNode.java Sun Oct  8 07:24:25 2006
@@ -29,13 +29,13 @@
 import org.apache.cocoon.matching.Matcher;
 import org.apache.cocoon.matching.PreparableMatcher;
 import org.apache.cocoon.sitemap.PatternException;
+import org.apache.cocoon.ProcessingException;
 
 /**
- *
  * @version $Id$
  */
 public class PreparableMatchNode extends SimpleSelectorProcessingNode
-    implements ParameterizableProcessingNode, Initializable {
+                                 implements ParameterizableProcessingNode, Initializable {
 
     /** The 'pattern' attribute */
     private String pattern;
@@ -43,9 +43,10 @@
     /** The 'name' for the variable anchor */
     private String name;
 
+    private Map parameters;
+
     private Object preparedPattern;
 
-    private Map parameters;
 
     public PreparableMatchNode(String type, String pattern, String name) {
         super(Matcher.ROLE + "Selector", type);
@@ -54,7 +55,7 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.cocoon.components.treeprocessor.ParameterizableProcessingNode#setParameters(java.util.Map)
+     * @see ParameterizableProcessingNode#setParameters(java.util.Map)
      */
     public void setParameters(Map parameterMap) {
         this.parameters = parameterMap;
@@ -71,7 +72,7 @@
         try {
             this.preparedPattern = matcher.preparePattern(this.pattern);
         } catch(PatternException pe) {
-            String msg = "Invalid pattern '" + this.pattern + "' for matcher at " + this.getLocation();
+            String msg = "Invalid pattern '" + this.pattern + "' for matcher at " + getLocation();
             throw new ConfigurationException(msg, pe);
         } finally {
             releaseComponent(matcher);
@@ -84,8 +85,8 @@
     public final boolean invoke(Environment env, InvokeContext context)
     throws Exception {
 
-      	// Perform any common invoke functionality
-      	super.invoke(env, context);
+          // Perform any common invoke functionality
+          super.invoke(env, context);
 
         Map objectModel = env.getObjectModel();
         Parameters resolvedParams = VariableResolver.buildParameters(
@@ -94,28 +95,33 @@
 
         Map result = null;
 
-        PreparableMatcher matcher = (PreparableMatcher)getComponent();
         try {
-            result = this.executor.invokePreparableMatcher(this,
-                                                           objectModel,
-                                                           matcher,
-                                                           this.pattern,
-                                                           preparedPattern,
-                                                           resolvedParams);
-        } finally {
-            releaseComponent(matcher);
-        }
-
-        if (result != null) {
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("Matcher '" + this.componentName + "' matched prepared pattern '" +
-                                  this.pattern + "' at " + this.getLocation());
+            PreparableMatcher matcher = (PreparableMatcher)getComponent();
+            try {
+                result = this.executor.invokePreparableMatcher(this,
+                                                               objectModel,
+                                                               matcher,
+                                                               this.pattern,
+                                                               preparedPattern,
+                                                               resolvedParams);
+            } finally {
+                releaseComponent(matcher);
             }
 
-            // Invoke children with the matcher results
-            return this.invokeNodes(children, env, context, name, result);
+            if (result != null) {
+                if (getLogger().isDebugEnabled()) {
+                    getLogger().debug("Matcher '" + this.componentName + "' matched prepared pattern '" +
+                                      this.pattern + "' at " + this.getLocation());
+                }
+
+                // Invoke children with the matcher results
+                return this.invokeNodes(children, env, context, name, result);
 
+            }
+        } catch (Exception e) {
+            throw ProcessingException.throwLocated("Sitemap: error invoking matcher", e, getLocation());
         }
+
         // Matcher failed
         return false;
     }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ReadNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ReadNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ReadNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ReadNode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,14 +23,15 @@
 import org.apache.cocoon.components.treeprocessor.variables.VariableResolver;
 import org.apache.cocoon.environment.Environment;
 import org.apache.cocoon.sitemap.SitemapExecutor;
+import org.apache.cocoon.ProcessingException;
 
 import java.util.Map;
 
 /**
- *
  * @version $Id$
  */
-public class ReadNode extends AbstractProcessingNode implements ParameterizableProcessingNode {
+public class ReadNode extends AbstractProcessingNode
+                      implements ParameterizableProcessingNode {
 
     private String readerName;
 
@@ -42,6 +43,7 @@
 
     private Map parameters;
 
+
     /**
      * Build a <code>SerializerNode</code> having a name, a mime-type and a status code (HTTP codes).
      *
@@ -61,7 +63,7 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(org.apache.cocoon.environment.Environment, org.apache.cocoon.components.treeprocessor.InvokeContext)
+     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(Environment, InvokeContext)
      */
     public final boolean invoke(Environment env,  InvokeContext context)
     throws Exception {
@@ -75,26 +77,24 @@
         desc.source = source.resolve(context, objectModel);
         desc.parameters = VariableResolver.buildParameters(this.parameters, context, objectModel);
         desc.mimeType = this.mimeType.resolve(context, objectModel);
-        
+
         desc = this.executor.addReader(this, objectModel, desc);
 
-        pipeline.setReader(
-            desc.type,
-            desc.source,
-            desc.parameters,
-            desc.mimeType
-        );
+        pipeline.setReader(desc.type,
+                           desc.source,
+                           desc.parameters,
+                           desc.mimeType);
 
         // Set status code if there is one
         if (this.statusCode >= 0) {
             env.setStatus(this.statusCode);
         }
 
-        if (! context.isBuildingPipelineOnly()) {
+        if (!context.isBuildingPipelineOnly()) {
             // Process pipeline
             return pipeline.process(env);
-
         }
+
         // Return true : pipeline is finished.
         return true;
     }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/RedirectToURINode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/RedirectToURINode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/RedirectToURINode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/RedirectToURINode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@
 
     // TODO: It can implement ParameterizableProcessingNode to pass redirect parameters
     //       Those parameters will be URL-encoded and appended to the redirect URI
-    
+
     /** The 'uri' attribute */
     private VariableResolver uri;
 
@@ -41,9 +41,10 @@
 
     private boolean permanent;
 
-    public RedirectToURINode(VariableResolver uri, 
-                             boolean createSession, 
-                             boolean global, 
+
+    public RedirectToURINode(VariableResolver uri,
+                             boolean createSession,
+                             boolean global,
                              boolean permanent ) {
         this.global = global;
         this.uri = uri;
@@ -52,7 +53,7 @@
     }
 
     public final boolean invoke(Environment env, InvokeContext context)
-      throws Exception {
+    throws Exception {
         String resolvedURI = uri.resolve(context, env.getObjectModel());
 
         if (getLogger().isInfoEnabled()) {
@@ -67,10 +68,10 @@
                                                this.permanent);
         final Redirector redirector = context.getRedirector();
 
-        if( this.global ) {
+        if (this.global) {
             redirector.globalRedirect(this.createSession, resolvedURI);
         } else if (this.permanent && redirector instanceof PermanentRedirector) {
-            ((PermanentRedirector)redirector).permanentRedirect(this.createSession, resolvedURI);
+            ((PermanentRedirector) redirector).permanentRedirect(this.createSession, resolvedURI);
         } else {
             redirector.redirect(this.createSession, resolvedURI);
         }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SelectNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SelectNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SelectNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SelectNode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,6 +19,8 @@
 import java.util.Map;
 
 import org.apache.avalon.framework.parameters.Parameters;
+
+import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.components.treeprocessor.InvokeContext;
 import org.apache.cocoon.components.treeprocessor.ParameterizableProcessingNode;
 import org.apache.cocoon.components.treeprocessor.ProcessingNode;
@@ -28,11 +30,10 @@
 import org.apache.cocoon.selection.Selector;
 
 /**
- *
  * @version $Id$
  */
 public class SelectNode extends SimpleSelectorProcessingNode
-    implements ParameterizableProcessingNode {
+                        implements ParameterizableProcessingNode {
 
     /** The parameters of this node */
     private Map parameters;
@@ -43,6 +44,7 @@
 
     private ProcessingNode[] otherwhiseNodes;
 
+
     public SelectNode(String name) {
         super(Selector.ROLE + "Selector", name);
     }
@@ -58,12 +60,12 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(org.apache.cocoon.environment.Environment, org.apache.cocoon.components.treeprocessor.InvokeContext)
+     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(Environment, InvokeContext)
      */
     public final boolean invoke(Environment env, InvokeContext context)
     throws Exception {
 
-      	// Perform any common invoke functionality 
+          // Perform any common invoke functionality
         super.invoke(env, context);
 
         // Prepare data needed by the action
@@ -72,9 +74,8 @@
 
         final Selector selector = (Selector)getComponent();
         try {
-
             for (int i = 0; i < this.whenTests.length; i++) {
-                if ( this.executor.invokeSelector(this, objectModel,
+                if (this.executor.invokeSelector(this, objectModel,
                         selector,
                         whenTests[i].resolve(context, objectModel),
                         resolvedParams)) {
@@ -87,6 +88,8 @@
             }
 
             return false;
+        } catch (Exception e) {
+            throw ProcessingException.throwLocated("Sitemap: error processing select", e, getLocation());
         } finally {
             releaseComponent(selector);
         }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,10 +30,10 @@
 import org.apache.cocoon.sitemap.SitemapExecutor;
 
 /**
- *
  * @version $Id$
  */
-public class SerializeNode extends PipelineEventComponentProcessingNode implements ParameterizableProcessingNode {
+public class SerializeNode extends PipelineEventComponentProcessingNode
+                           implements ParameterizableProcessingNode {
 
     private String serializerName;
 
@@ -54,8 +54,8 @@
      * @param statusCode the HTTP response status code, or <code>-1</code> if not specified.
      */
     public SerializeNode(String name,
-                         VariableResolver source, 
-                         VariableResolver mimeType, 
+                         VariableResolver source,
+                         VariableResolver mimeType,
                          int statusCode) {
         this.serializerName = name;
         this.source = source;
@@ -75,7 +75,7 @@
 
         // Check view
         if (this.views != null) {
-	   
+
             //inform the pipeline that we have a branch point
             context.getProcessingPipeline().informBranchPoint();
 
@@ -93,7 +93,7 @@
                 }
             }
         }
-        
+
         final Map objectModel = env.getObjectModel();
         final ProcessingPipeline pipeline = context.getProcessingPipeline();
 
@@ -101,7 +101,7 @@
         if (objectModel.containsKey(Constants.LINK_OBJECT)) {
             pipeline.addTransformer("<translator>", null, Parameters.EMPTY_PARAMETERS, Parameters.EMPTY_PARAMETERS);
         }
-        
+
         if (objectModel.containsKey(Constants.LINK_COLLECTION_OBJECT) && env.isExternal()) {
             pipeline.addTransformer("<gatherer>", null, Parameters.EMPTY_PARAMETERS, Parameters.EMPTY_PARAMETERS);
         }
@@ -117,21 +117,19 @@
 
         // inform executor
         desc = this.executor.addSerializer(this, objectModel, desc);
-        
-        pipeline.setSerializer(
-                desc.type,
-                desc.source,
-                desc.parameters,
-                desc.hintParameters,
-                desc.mimeType
-        );
+
+        pipeline.setSerializer(desc.type,
+                               desc.source,
+                               desc.parameters,
+                               desc.hintParameters,
+                               desc.mimeType);
 
         // Set status code if there is one
         if (this.statusCode >= 0) {
             env.setStatus(this.statusCode);
         }
 
-        if (! context.isBuildingPipelineOnly()) {
+        if (!context.isBuildingPipelineOnly()) {
             // Process pipeline
             return pipeline.process(env);
         }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java Sun Oct  8 07:24:25 2006
@@ -80,7 +80,7 @@
 
 /**
  * The tree builder for the sitemap language.
- * 
+ *
  * @version $Id$
  */
 public class SitemapLanguage
@@ -119,8 +119,7 @@
     protected String itsNamespace;
 
     /**
-     * The service manager for the processor that we are building. It is created
-     * by {@link #createServiceManager(ClassLoader, Context, Configuration)}.
+     * The service manager for the processor that we are building.
      */
     private ServiceManager itsManager;
 
@@ -186,7 +185,7 @@
     /**
      * Get the location of the treebuilder config file. Can be overridden for
      * other versions.
-     * 
+     *
      * @return The location of the treebuilder config file
      */
     protected String getBuilderConfigURL() {
@@ -460,7 +459,7 @@
             // public
             String namespace = null;
             try {
-                namespace = ((AbstractConfiguration) config).getNamespace();
+                namespace = config.getNamespace();
             } catch (ConfigurationException e) {
                 // ignore
             }
@@ -475,6 +474,7 @@
         } else {
             desc.append(config.getName());
         }
+
         String type = config.getAttribute("type", null);
         if (type != null) {
             desc.append(" type=\"").append(type).append('"');
@@ -482,14 +482,16 @@
         desc.append('>');
 
         Location rawLoc = LocationUtils.getLocation(config);
-        return new LocationImpl(desc.toString(), rawLoc.getURI(), rawLoc.getLineNumber(), rawLoc
-                .getColumnNumber());
+        return new LocationImpl(desc.toString(),
+                                rawLoc.getURI(),
+                                rawLoc.getLineNumber(),
+                                rawLoc.getColumnNumber());
     }
 
     /**
      * Get &lt;xxx:parameter&gt; elements as a <code>Map</code> of </code>ListOfMapResolver</code>s,
      * that can be turned into parameters using <code>ListOfMapResolver.buildParameters()</code>.
-     * 
+     *
      * @return the Map of ListOfMapResolver, or <code>null</code> if there are
      *         no parameters.
      */
@@ -526,7 +528,7 @@
      * Get the type for a statement : it returns the 'type' attribute if
      * present, and otherwhise the default type defined for this role in the
      * components declarations.
-     * 
+     *
      * @throws ConfigurationException
      *             if the type could not be found.
      */
@@ -603,7 +605,7 @@
             if ( beans != null ) {
                 final Iterator i = beans.values().iterator();
                 while ( i.hasNext() ) {
-                    this.enterSitemapEventListeners.add(i.next());                    
+                    this.enterSitemapEventListeners.add(i.next());
                 }
             }
             beans = listableFactory.getBeansOfType(LeaveSitemapEventListener.class);
@@ -675,7 +677,7 @@
     /**
      * Add a view for a label. This is used to register all views that start
      * from a given label.
-     * 
+     *
      * @param label
      *            the label (or pseudo-label) for the view
      * @param view
@@ -698,7 +700,7 @@
      * Get the names of views for a given statement. If the cocoon view exists
      * in the returned collection, the statement can directly branch to the
      * view-handling node.
-     * 
+     *
      * @param role
      *            the component role (e.g. <code>Generator.ROLE</code>)
      * @param hint
@@ -725,7 +727,7 @@
         }
 
         // Compute the views attached to this component
-        Set views = null;
+        Set views;
 
         // Build the set for all labels for this statement
         Set labels = new HashSet();
@@ -799,7 +801,7 @@
     /**
      * Get the {view name, view node} map for a collection of view names. This
      * allows to resolve view nodes at build time, thus avoiding runtime lookup.
-     * 
+     *
      * @param viewNames
      *            the view names
      * @return association of names to views
@@ -826,7 +828,7 @@
 
     /**
      * Extract pipeline-hints from the given statement (if any exist)
-     * 
+     *
      * @param role
      *            the component role (e.g. <code>Generator.ROLE</code>)
      * @param hint
@@ -851,15 +853,14 @@
         // the hint.
 
         String statementHintParams = statement.getAttribute("pipeline-hints", null);
-        String componentHintParams = null;
-        String hintParams = null;
 
         // firstly, determine if any pipeline-hints are defined at the component
         // level
         // if so, inherit these pipeline-hints (these hints can be overriden by
         // local pipeline-hints)
-        componentHintParams = this.itsComponentInfo.getPipelineHint(role, hint);
+        String componentHintParams = this.itsComponentInfo.getPipelineHint(role, hint);
 
+        String hintParams;
         if (componentHintParams != null) {
             hintParams = componentHintParams;
 
@@ -934,7 +935,7 @@
      *
      * @return the collection of labels (may be empty, nut never null)
      */
-    private static final Collection splitLabels(String labels) {
+    private static Collection splitLabels(String labels) {
         if (labels == null) {
             return Collections.EMPTY_SET;
         }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/TransformNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/TransformNode.java?view=diff&rev=454150&r1=454149&r2=454150
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/TransformNode.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/TransformNode.java Sun Oct  8 07:24:25 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -29,10 +29,10 @@
 import java.util.Map;
 
 /**
- *
  * @version $Id$
  */
-public class TransformNode extends PipelineEventComponentProcessingNode implements ParameterizableProcessingNode {
+public class TransformNode extends PipelineEventComponentProcessingNode
+                           implements ParameterizableProcessingNode {
 
     private String transformerName;
 
@@ -50,9 +50,8 @@
         this.parameters = parameterMap;
     }
 
-
     /* (non-Javadoc)
-     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(org.apache.cocoon.environment.Environment, org.apache.cocoon.components.treeprocessor.InvokeContext)
+     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(Environment, InvokeContext)
      */
     public final boolean invoke(Environment env, InvokeContext context)
     throws Exception {
@@ -60,7 +59,7 @@
         final Map objectModel = env.getObjectModel();
 
         final ProcessingPipeline pipeline = context.getProcessingPipeline();
-        
+
         SitemapExecutor.PipelineComponentDescription desc = new SitemapExecutor.PipelineComponentDescription();
         desc.type = this.transformerName;
         desc.source = source.resolve(context, objectModel);
@@ -72,19 +71,17 @@
         // inform executor
         desc = this.executor.addTransformer(this, objectModel, desc);
 
-        pipeline.addTransformer(
-            desc.type,
-            desc.source,
-            desc.parameters,
-            desc.hintParameters
-        );
+        pipeline.addTransformer(desc.type,
+                                desc.source,
+                                desc.parameters,
+                                desc.hintParameters);
 
         // Check view
         if (this.views != null) {
-	   
+
             //inform the pipeline that we have a branch point
             pipeline.informBranchPoint();
-	    
+
             String cocoonView = env.getView();
             if (cocoonView != null) {
 



Mime
View raw message