cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r509480 - in /cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main: java/org/apache/cocoon/portal/layout/renderer/aspect/impl/support/RendererAspectChain.java resources/org/apache/cocoon/portal/cocoon-portal-components.xml
Date Tue, 20 Feb 2007 09:26:40 GMT
Author: cziegeler
Date: Tue Feb 20 01:26:40 2007
New Revision: 509480

URL: http://svn.apache.org/viewvc?view=rev&rev=509480
Log:
Fix renderer configuration and NPE during initialization.

Modified:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/support/RendererAspectChain.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/cocoon-portal-components.xml

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/support/RendererAspectChain.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/support/RendererAspectChain.java?view=diff&rev=509480&r1=509479&r2=509480
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/support/RendererAspectChain.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/support/RendererAspectChain.java
Tue Feb 20 01:26:40 2007
@@ -44,13 +44,22 @@
 public final class RendererAspectChain extends AspectChain {
 
     /** The list of the configuration objects for each renderer aspects. */
-    protected final List configs = new ArrayList(3);
+    protected List configs;
 
     public RendererAspectChain(Class aClass, List aspects, List properties)
     throws PortalException {
+        // we can't initialize configs before we call super
+        // so we have to check in the addAspects method and here
+        // if configs is initialized!
         super(aClass, aspects, properties);
+        if ( this.configs == null ) {
+            this.configs = new ArrayList();            
+        }
     }
 
+    /**
+     * @return The iterator for the prepared configurations.
+     */
     public Iterator getConfigurationIterator() {
         return this.configs.iterator();
     }
@@ -59,6 +68,9 @@
      * @see org.apache.cocoon.portal.services.aspects.support.AspectChain#addAspect(java.lang.Object,
java.util.Properties, int)
      */
     public void addAspect(Object aspect, Properties config, int index) throws PortalException
{
+        if ( configs == null ) {
+            this.configs = new ArrayList();
+        }
         super.addAspect(aspect, config, index);
         final RendererAspect rendererAspect = (RendererAspect)aspect;
         final Properties props = (config == null ? EMPTY_PROPERTIES : config);

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/cocoon-portal-components.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/cocoon-portal-components.xml?view=diff&rev=509480&r1=509479&r2=509480
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/cocoon-portal-components.xml
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/cocoon-portal-components.xml
Tue Feb 20 01:26:40 2007
@@ -87,7 +87,7 @@
       <property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
     </bean>
 
-    <bean name="org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect-parameter"
+    <bean name="org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect.parameter"
           class="org.apache.cocoon.portal.layout.renderer.aspect.impl.ParameterAspect"
           parent="org.apache.cocoon.portal.util.AbstractBean" scope="singleton"/>
 



Mime
View raw message