[jboss-cvs] JBossAS SVN: r90260 - projects/vfs/trunk/src/main/java/org/jboss/virtual.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 16 12:10:33 EDT 2009


Author: david.lloyd at jboss.com
Date: 2009-06-16 12:10:32 -0400 (Tue, 16 Jun 2009)
New Revision: 90260

Modified:
   projects/vfs/trunk/src/main/java/org/jboss/virtual/VFSUtils.java
Log:
finally blocks should never throw exceptions; there is no point in flushing if the copy failed anyway

Modified: projects/vfs/trunk/src/main/java/org/jboss/virtual/VFSUtils.java
===================================================================
--- projects/vfs/trunk/src/main/java/org/jboss/virtual/VFSUtils.java	2009-06-16 15:44:11 UTC (rev 90259)
+++ projects/vfs/trunk/src/main/java/org/jboss/virtual/VFSUtils.java	2009-06-16 16:10:32 UTC (rev 90260)
@@ -932,20 +932,14 @@
       if (os == null)
          throw new IllegalArgumentException("output stream is null");
 
-      try
+      byte [] buff = new byte[65536];
+      int rc = is.read(buff);
+      while (rc != -1)
       {
-         byte [] buff = new byte[65536];
-         int rc = is.read(buff);
-         while (rc != -1)
-         {
-            os.write(buff, 0, rc);
-            rc = is.read(buff);
-         }
+         os.write(buff, 0, rc);
+         rc = is.read(buff);
       }
-      finally
-      {
-         os.flush();
-      }
+      os.flush();
    }
 
    /**




More information about the jboss-cvs-commits mailing list