incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r939210 - in /sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl: ProcessorConfigurationImpl.java ProcessorManagerImpl.java RewriterResponse.java
Date Thu, 29 Apr 2010 06:30:47 GMT
Author: cziegeler
Date: Thu Apr 29 06:30:46 2010
New Revision: 939210

URL: http://svn.apache.org/viewvc?rev=939210&view=rev
Log:
Fix some NPEs

Modified:
    sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImpl.java
    sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java
    sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/RewriterResponse.java

Modified: sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImpl.java?rev=939210&r1=939209&r2=939210&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImpl.java
(original)
+++ sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImpl.java
Thu Apr 29 06:30:46 2010
@@ -264,11 +264,13 @@ public class ProcessorConfigurationImpl 
             sb.append(", pipeline=(generator=");
             sb.append(this.generatorConfiguration);
             sb.append(", transformers=(");
-            for(int i=0; i<this.transformerConfigurations.length; i++) {
-                if ( i > 0 ) {
-                    sb.append(", ");
+            if ( this.transformerConfigurations != null ) {
+                for(int i=0; i<this.transformerConfigurations.length; i++) {
+                    if ( i > 0 ) {
+                        sb.append(", ");
+                    }
+                    sb.append(this.transformerConfigurations[i]);
                 }
-                sb.append(this.transformerConfigurations[i]);
             }
             sb.append(", serializer=");
             sb.append(this.serializerConfiguration);

Modified: sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java?rev=939210&r1=939209&r2=939210&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java
(original)
+++ sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java
Thu Apr 29 06:30:46 2010
@@ -29,6 +29,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.SlingConstants;
 import org.apache.sling.api.resource.LoginException;
@@ -69,7 +70,7 @@ public class ProcessorManagerImpl
     /** The bundle context. */
     private BundleContext bundleContext;
 
-    /** @scr.reference */
+    @Reference
     private ResourceResolverFactory resourceResolverFactory;
 
     /** The resource resolver. */

Modified: sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/RewriterResponse.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/RewriterResponse.java?rev=939210&r1=939209&r2=939210&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/RewriterResponse.java
(original)
+++ sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/RewriterResponse.java
Thu Apr 29 06:30:46 2010
@@ -18,7 +18,6 @@ package org.apache.sling.rewriter.impl;
 
 import java.io.IOException;
 import java.io.PrintWriter;
-import java.io.Writer;
 import java.util.Iterator;
 import java.util.List;
 
@@ -80,26 +79,6 @@ class RewriterResponse
      * @see javax.servlet.ServletResponseWrapper#getWriter()
      */
     public PrintWriter getWriter() throws IOException {
-        if ( this.processor != null && this.writer == null ) {
-            return new PrintWriter(new Writer() {
-
-                @Override
-                public void close() throws IOException {
-                    // nothing to do
-                }
-
-                @Override
-                public void flush() throws IOException {
-                    // nothing to do
-                }
-
-                @Override
-                public void write(char[] cbuf, int off, int len)
-                throws IOException {
-                    // nothing to do
-                }
-             });
-        }
         if (writer == null) {
             this.processor = this.getProcessor();
             if ( this.processor != null ) {



Mime
View raw message