You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by tv...@apache.org on 2016/12/09 10:29:39 UTC

svn commit: r1773352 - in /turbine/core/trunk/src/java/org/apache/turbine: pipeline/package.html services/package.html util/ObjectUtils.java

Author: tv
Date: Fri Dec  9 10:29:39 2016
New Revision: 1773352

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

Modified:
    turbine/core/trunk/src/java/org/apache/turbine/pipeline/package.html
    turbine/core/trunk/src/java/org/apache/turbine/services/package.html
    turbine/core/trunk/src/java/org/apache/turbine/util/ObjectUtils.java

Modified: turbine/core/trunk/src/java/org/apache/turbine/pipeline/package.html
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/pipeline/package.html?rev=1773352&r1=1773351&r2=1773352&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/pipeline/package.html (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/pipeline/package.html Fri Dec  9 10:29:39 2016
@@ -25,9 +25,9 @@
 <body>
 
 <p>
-  The Turbine processing pipeline is modelled after the pipeline found
+  The Turbine processing pipeline is modeled after the pipeline found
   in Tomcat 4.0.1 (Catalina), and after the module architecture found
-  in Apache httpd.  It is extensionable both laterally and
+  in Apache httpd.  It is extensible both laterally and
   vertically via Valve additions and default Valve implementations
   (respectively).  Even the semantics of the default Turbine
   Pipeline (ClassicPipeline) can be changed by replacing or extending
@@ -38,24 +38,21 @@
   As with Catalina, Turbine's Pipeline and Valve configuration is
   setup via XML:
 
-  <blockquote><code><pre>
-
-  <pipeline>
-    <class>org.apache.turbine.pipeline.ClassicPipeline</class>
-    <valves>
-      <valve>
-        <class>org.apache.turbine.pipeline.Valve1</class>
-      </valve>
-      <valve>
-        <class>org.apache.turbine.pipeline.Valve2</class>
-      </valve>
-      <valve>
-        <class>org.apache.turbine.pipeline.Valve3</class>
-      </valve>
-    </valves>
-  </pipeline>
-
-  </pre></code></blockquote>
+  <code>
+	&lt;pipeline name="default"&gt;
+	  &lt;valves&gt;
+	    &lt;valve&gt;org.apache.turbine.pipeline.DetermineActionValve&lt;/valve&gt;
+	    &lt;valve&gt;org.apache.turbine.pipeline.DetermineTargetValve&lt;/valve&gt;
+	    &lt;valve&gt;org.apache.turbine.pipeline.DefaultSessionTimeoutValve&lt;/valve&gt;
+	    &lt;valve&gt;org.apache.turbine.pipeline.DefaultLoginValve&lt;/valve&gt;
+	    &lt;valve&gt;org.apache.turbine.pipeline.DefaultSessionValidationValve&lt;/valve&gt;
+	    &lt;valve&gt;org.apache.turbine.pipeline.DefaultACLCreationValve&lt;/valve&gt;
+	    &lt;valve&gt;org.apache.turbine.pipeline.ExecutePageValve&lt;/valve&gt;
+	    &lt;valve&gt;org.apache.turbine.pipeline.CleanUpValve&lt;/valve&gt;
+	    &lt;valve&gt;org.apache.turbine.pipeline.DetermineRedirectRequestedValve&lt;/valve&gt;
+	  &lt;/valves&gt;
+	&lt;/pipeline&gt;
+  </code>
 </p>
 
 <p>

Modified: turbine/core/trunk/src/java/org/apache/turbine/services/package.html
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/services/package.html?rev=1773352&r1=1773351&r2=1773352&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/services/package.html (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/services/package.html Fri Dec  9 10:29:39 2016
@@ -93,7 +93,7 @@ used in conjunction with a <i>properly c
 set of services to use in your application.  The following sample
 code performs such initialization:
 <p>
-<blockquote><code><pre>
+<code>
 String webAppRoot = "/var/httpd/webapps";
 String trProps = "/var/httpd/TurbineResources.properties";
 try
@@ -110,7 +110,7 @@ catch (Exception e)
     e.printStackTrace();
     throw new Error(msg);
 }
-</pre></code></blockquote>
+</code>
 </td></tr></table>
 <br>
 <font size="-2">$Id$</font>

Modified: turbine/core/trunk/src/java/org/apache/turbine/util/ObjectUtils.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/util/ObjectUtils.java?rev=1773352&r1=1773351&r2=1773352&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/util/ObjectUtils.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/util/ObjectUtils.java Fri Dec  9 10:29:39 2016
@@ -1,28 +1,6 @@
 package org.apache.turbine.util;
 
 
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  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.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -52,14 +30,10 @@ public abstract class ObjectUtils
 	public static byte[] serializeMap(Map<String, Object> map)
             throws Exception
     {
-        String key = null;
-        Object value = null;
         byte[] byteArray = null;
 
-        for (Map.Entry<String, Object> entry : map.entrySet())
+        for (Object value : map.values())
         {
-            key = entry.getKey();
-            value = entry.getValue();
             if (! (value instanceof Serializable))
             {
                 throw new Exception("Could not serialize, value is not serializable:" + value);
@@ -67,18 +41,15 @@ public abstract class ObjectUtils
         }
 
         ByteArrayOutputStream baos = null;
-        BufferedOutputStream bos = null;
         ObjectOutputStream out = null;
         try
         {
             // These objects are closed in the finally.
-            baos = new ByteArrayOutputStream();
-            bos  = new BufferedOutputStream(baos);
-            out  = new ObjectOutputStream(bos);
+            baos = new ByteArrayOutputStream(1024);
+            out  = new ObjectOutputStream(baos);
 
             out.writeObject(map);
             out.flush();
-            bos.flush();
 
             byteArray = baos.toByteArray();
         }
@@ -88,15 +59,12 @@ public abstract class ObjectUtils
             {
                 out.close();
             }
-            if (bos != null)
-            {
-                bos.close();
-            }
             if (baos != null)
             {
                 baos.close();
             }
         }
+
         return byteArray;
     }
 
@@ -117,11 +85,10 @@ public abstract class ObjectUtils
             // These streams are closed in finally.
             ObjectInputStream in = null;
             ByteArrayInputStream bin = new ByteArrayInputStream(objectData);
-            BufferedInputStream bufin = new BufferedInputStream(bin);
 
             try
             {
-                in = new ObjectInputStream(bufin);
+                in = new ObjectInputStream(bin);
 
                 // If objectData has not been initialized, an
                 // exception will occur.
@@ -139,8 +106,6 @@ public abstract class ObjectUtils
                     {
                         in.close();
                     }
-
-                    bufin.close();
                     bin.close();
                 }
                 catch (IOException e)