cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r388998 - in /cocoon/branches/BRANCH_2_1_X: ./ src/java/org/apache/cocoon/environment/ src/java/org/apache/cocoon/environment/commandline/ src/java/org/apache/cocoon/environment/http/ src/java/org/apache/cocoon/environment/wrapper/ src/test...
Date Mon, 27 Mar 2006 01:18:27 GMT
Author: antonio
Date: Sun Mar 26 17:18:24 2006
New Revision: 388998

URL: http://svn.apache.org/viewcvs?rev=388998&view=rev
Log:

<action dev="AG" type="fix" fixes-bug="COCOON-1814" due-to="Mark Lundquist" due-to-email="mlundquist2@comcast.net">
  Deprecated method o.a.c.environment.Environment.getOutputStream() still used internally.
</action>

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/AbstractEnvironment.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/Environment.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/AbstractCommandLineEnvironment.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/FileSavingEnvironment.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/LinkSamplingEnvironment.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/http/HttpEnvironment.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/MutableEnvironmentFacade.java
    cocoon/branches/BRANCH_2_1_X/src/test/org/apache/cocoon/environment/mock/MockEnvironment.java
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/AbstractEnvironment.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/AbstractEnvironment.java?rev=388998&r1=388997&r2=388998&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/AbstractEnvironment.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/AbstractEnvironment.java
Sun Mar 26 17:18:24 2006
@@ -45,7 +45,7 @@
  * @author <a href="mailto:bluetkemeier@s-und-n.de">Bj&ouml;rn L&uuml;tkemeier</a>
  * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
- * @version CVS $Id$
+ * @version $Id$
  */
 public abstract class AbstractEnvironment extends AbstractLogEnabled implements Environment
{
 
@@ -466,7 +466,7 @@
         Deprecation.logger.warn("The method Environment.getOutputStream() " +
                               "is deprecated. Use getOutputStream(-1) instead.");
         // by default we use the complete buffering output stream
-        return this.getOutputStream(-1);
+        return getOutputStream(-1);
     }
 
     /**

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/Environment.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/Environment.java?rev=388998&r1=388997&r2=388998&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/Environment.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/Environment.java Sun
Mar 26 17:18:24 2006
@@ -26,7 +26,7 @@
  * @author <a href="mailto:bluetkemeier@s-und-n.de">Bj&ouml;rn L&uuml;tkemeier</a>
  * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
- * @version CVS $Id$
+ * @version $Id$
  */
 public interface Environment
     extends SourceResolver {
@@ -214,4 +214,3 @@
      */
     boolean isInternalRedirect();
 }
-

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/AbstractCommandLineEnvironment.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/AbstractCommandLineEnvironment.java?rev=388998&r1=388997&r2=388998&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/AbstractCommandLineEnvironment.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/AbstractCommandLineEnvironment.java
Sun Mar 26 17:18:24 2006
@@ -36,7 +36,7 @@
  * This environment is used to save the requested file to disk.
  *
  * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
- * @version CVS $Id$
+ * @version $Id$
  */
 
 public abstract class AbstractCommandLineEnvironment

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/FileSavingEnvironment.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/FileSavingEnvironment.java?rev=388998&r1=388997&r2=388998&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/FileSavingEnvironment.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/FileSavingEnvironment.java
Sun Mar 26 17:18:24 2006
@@ -31,7 +31,7 @@
  *
  * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  * @author <a href="mailto:uv@upaya.co.uk">Upayavira</a>
- * @version CVS $Id: FileSavingEnvironment.java,v 1.6 2004/03/05 13:02:54 bdelacretaz Exp
$
+ * @version $Id$
  */
 public class FileSavingEnvironment extends AbstractCommandLineEnvironment {
 

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/LinkSamplingEnvironment.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/LinkSamplingEnvironment.java?rev=388998&r1=388997&r2=388998&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/LinkSamplingEnvironment.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/commandline/LinkSamplingEnvironment.java
Sun Mar 26 17:18:24 2006
@@ -34,7 +34,7 @@
  * This environment is sample the links of the resource.
  *
  * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
- * @version CVS $Id: LinkSamplingEnvironment.java,v 1.7 2004/03/05 13:02:54 bdelacretaz Exp
$
+ * @version $Id$
  */
 
 public class LinkSamplingEnvironment extends AbstractCommandLineEnvironment {

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/http/HttpEnvironment.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/http/HttpEnvironment.java?rev=388998&r1=388997&r2=388998&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/http/HttpEnvironment.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/http/HttpEnvironment.java
Sun Mar 26 17:18:24 2006
@@ -34,7 +34,7 @@
  * HTTP Servlet environment.
  *
  * @author <a herf="mailto:dev@cocoon.apache.org">Apache Cocoon Team</a>
- * @version CVS $Id$
+ * @version $Id$
  */
 public class HttpEnvironment extends AbstractEnvironment
                              implements Redirector, PermanentRedirector {

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java?rev=388998&r1=388997&r2=388998&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
Sun Mar 26 17:18:24 2006
@@ -41,7 +41,7 @@
  *
  * @author <a href="mailto:bluetkemeier@s-und-n.de">Bj&ouml;rn L&uuml;tkemeier</a>
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
- * @version CVS $Id$
+ * @version $Id$
  */
 public class EnvironmentWrapper extends AbstractEnvironment {
 
@@ -298,9 +298,8 @@
     throws IOException {
         Deprecation.logger.warn("The method Environment.getOutputStream() " +
         "is deprecated. Use getOutputStream(-1) instead.");
-        return this.outputStream == null
-            ? this.environment.getOutputStream()
-            : this.outputStream;
+        // by default we use the complete buffering output stream
+        return getOutputStream(-1);
     }
 
     /**
@@ -328,28 +327,26 @@
      *
      * @return true if the response was successfully reset
     */
-    public boolean tryResetResponse()
-    throws IOException {
-        if (getOutputStream() != null
-            && getOutputStream() instanceof BufferedOutputStream) {
-            ((BufferedOutputStream)getOutputStream()).clearBuffer();
+    public boolean tryResetResponse() throws IOException {
+        final OutputStream outputStream = getOutputStream(-1);
+        if (outputStream != null && outputStream instanceof BufferedOutputStream)
{
+            ((BufferedOutputStream)outputStream).clearBuffer();
             return true;
-        }
-        else
+        } else {
           return super.tryResetResponse();
+        }
     }
 
     /**
      * Commit the response
      */
-    public void commitResponse() 
-    throws IOException {
-        if (getOutputStream() != null
-            && getOutputStream() instanceof BufferedOutputStream) {
-            ((BufferedOutputStream)getOutputStream()).realFlush();
-        }
-        else
+    public void commitResponse() throws IOException {
+        final OutputStream outputStream = getOutputStream(-1);
+        if (outputStream != null && outputStream instanceof BufferedOutputStream)
{
+            ((BufferedOutputStream)outputStream).realFlush();
+        } else {
           super.commitResponse();
+        }
     }
 
     /**

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/MutableEnvironmentFacade.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/MutableEnvironmentFacade.java?rev=388998&r1=388997&r2=388998&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/MutableEnvironmentFacade.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/MutableEnvironmentFacade.java
Sun Mar 26 17:18:24 2006
@@ -25,6 +25,7 @@
 import org.apache.cocoon.components.treeprocessor.sitemap.MountNode;
 import org.apache.cocoon.environment.Environment;
 import org.apache.cocoon.environment.Source;
+import org.apache.cocoon.util.Deprecation;
 import org.xml.sax.SAXException;
 
 /**
@@ -39,7 +40,7 @@
  *
  * @see org.apache.cocoon.components.source.impl.SitemapSource
  * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
- * @version CVS $Id$
+ * @version $Id$
  */
 public class MutableEnvironmentFacade implements Environment {
 
@@ -172,11 +173,15 @@
         env.setStatus(statusCode);
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.cocoon.environment.Environment#getOutputStream()
+     * @deprecated Use {@link #getOutputStream(int)} instead.
      */
     public OutputStream getOutputStream() throws IOException {
-        return env.getOutputStream();
+        Deprecation.logger.warn("The method Environment.getOutputStream() " +
+        "is deprecated. Use getOutputStream(-1) instead.");
+        // by default we use the complete buffering output stream
+        return getOutputStream(-1);
     }
 
     /* (non-Javadoc)

Modified: cocoon/branches/BRANCH_2_1_X/src/test/org/apache/cocoon/environment/mock/MockEnvironment.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/test/org/apache/cocoon/environment/mock/MockEnvironment.java?rev=388998&r1=388997&r2=388998&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/test/org/apache/cocoon/environment/mock/MockEnvironment.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/test/org/apache/cocoon/environment/mock/MockEnvironment.java
Sun Mar 26 17:18:24 2006
@@ -33,6 +33,7 @@
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 
+/* @version $Id$ */
 public class MockEnvironment implements Environment {
 
     private SourceResolver resolver;
@@ -114,9 +115,12 @@
         return status;
     }
 
+    /**
+     * Get the output stream where to write the generated resource.
+     * @deprecated Use {@link #getOutputStream(int)} instead.
+     */
     public OutputStream getOutputStream() throws IOException {
-        outputstream = new ByteArrayOutputStream();
-        return outputstream;
+        return getOutputStream(-1);
     }
 
     public OutputStream getOutputStream(int bufferSize) throws IOException {
@@ -229,4 +233,3 @@
         return false;
     }
 }
-

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?rev=388998&r1=388997&r2=388998&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Sun Mar 26 17:18:24 2006
@@ -180,6 +180,9 @@
   <release version="@version@" date="@date@">
 -->
   <release version="2.1.9" date="TBD">
+    <action dev="AG" type="fix" fixes-bug="COCOON-1814" due-to="Mark Lundquist" due-to-email="mlundquist2@comcast.net">
+      Deprecated method o.a.c.environment.Environment.getOutputStream() still used internally.
+    </action>
     <action dev="JBQ" type="add" fixes-bug="COCOON-1639" due-to="Andrew Stevens" due-to-email="ats37@hotmail.com">
       Added the NekoHTMLTransformer.  Updated the NekoHTMLGenerator's setup bits to allow
for setting parser features as
       well as properties, and provided a sample neko.properties configuration file.



Mime
View raw message