click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r922573 - in /click/trunk/click: documentation/docs/roadmap-changes.html documentation/docs/upgrade-path.html framework/src/org/apache/click/util/ClickUtils.java
Date Sat, 13 Mar 2010 14:05:09 GMT
Author: sabob
Date: Sat Mar 13 14:05:08 2010
New Revision: 922573

URL: http://svn.apache.org/viewvc?rev=922573&view=rev
Log:
replace multiple ClickUtils close methods with a single method accepting a Closeable object.
CLK-620

Modified:
    click/trunk/click/documentation/docs/roadmap-changes.html
    click/trunk/click/documentation/docs/upgrade-path.html
    click/trunk/click/framework/src/org/apache/click/util/ClickUtils.java

Modified: click/trunk/click/documentation/docs/roadmap-changes.html
URL: http://svn.apache.org/viewvc/click/trunk/click/documentation/docs/roadmap-changes.html?rev=922573&r1=922572&r2=922573&view=diff
==============================================================================
--- click/trunk/click/documentation/docs/roadmap-changes.html (original)
+++ click/trunk/click/documentation/docs/roadmap-changes.html Sat Mar 13 14:05:08 2010
@@ -135,6 +135,11 @@ includes improved Ajax support and @Bind
         Removed Click cores dependency on Velocity. This issue was raised by by Andrey Rybin
         [<a target="_blank" href="https://issues.apache.org/jira/browse/CLK-606">CLK-606</a>].
       </li>
+      <li class="change">
+        Replaced multiple ClickUtils close methods with a single method accepting
+        a <a href="click-api/org/apache/click/util/ClickUtils.html#close(java.io.Closeable)">Closeable</a>
+        [<a target="_blank" href="https://issues.apache.org/jira/browse/CLK-620">CLK-620</a>].
+      </li>
     </ul>
   </dd>
 

Modified: click/trunk/click/documentation/docs/upgrade-path.html
URL: http://svn.apache.org/viewvc/click/trunk/click/documentation/docs/upgrade-path.html?rev=922573&r1=922572&r2=922573&view=diff
==============================================================================
--- click/trunk/click/documentation/docs/upgrade-path.html (original)
+++ click/trunk/click/documentation/docs/upgrade-path.html Sat Mar 13 14:05:08 2010
@@ -78,6 +78,17 @@ versions please email the Click user gro
 <h2>Version Upgrades</h2>
 
 <dl>
+  <dt><a name="2.2.0"></a>
+  <div class="release-header">Version 2.2.0 Upgrade</div></dt>
+  <dd>
+    <ul style="padding: 0em; margin-left:0em;margin-bottom: 2em">
+      <li class="change">
+      	  Click 2.2.0 is backward compatible with Click 2.1.0, but it is
+          recommended to recompile your project against the new jars.
+      </li>
+    </ul>
+  </dd>
+
   <dt><a name="2.1.0"></a>
   <div class="release-header">Version 2.1.0 Upgrade</div></dt>
   <dd>

Modified: click/trunk/click/framework/src/org/apache/click/util/ClickUtils.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/util/ClickUtils.java?rev=922573&r1=922572&r2=922573&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/util/ClickUtils.java (original)
+++ click/trunk/click/framework/src/org/apache/click/util/ClickUtils.java Sat Mar 13 14:05:08
2010
@@ -20,6 +20,7 @@ package org.apache.click.util;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.Closeable;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -27,7 +28,6 @@ import java.io.InputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.OutputStream;
-import java.io.Reader;
 import java.io.Serializable;
 import java.io.UnsupportedEncodingException;
 import java.lang.reflect.InvocationTargetException;
@@ -807,44 +807,15 @@ public class ClickUtils {
     }
 
     /**
-     * Close the given input stream and ignore any exceptions thrown.
+     * Close the given closeable (Reader, Writer, Stream) and ignore any
+     * exceptions thrown.
      *
-     * @param stream the stream, reader or writer to close.
+     * @param closeable the closeable (Reader, Writer, Stream) to close.
      */
-    public static void close(InputStream  stream) {
-        if (stream != null) {
+    public static void close(Closeable closeable) {
+        if (closeable != null) {
             try {
-                stream.close();
-            } catch (IOException ex) {
-                // Ignore.
-            }
-        }
-    }
-
-    /**
-     * Close the given output stream and ignore any exceptions thrown.
-     *
-     * @param stream the output stream to close.
-     */
-    public static void close(OutputStream stream) {
-        if (stream != null) {
-            try {
-                stream.close();
-            } catch (IOException ex) {
-                // Ignore.
-            }
-        }
-    }
-
-    /**
-     * Close the given reader and ignore any exceptions thrown.
-     *
-     * @param reader the reader to close.
-     */
-    public static void close(Reader reader) {
-        if (reader != null) {
-            try {
-                reader.close();
+                closeable.close();
             } catch (IOException ioe) {
                 // Ignore
             }



Mime
View raw message