[jboss-cvs] JBossAS SVN: r77521 - projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/zip.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 27 04:20:40 EDT 2008


Author: alesj
Date: 2008-08-27 04:20:39 -0400 (Wed, 27 Aug 2008)
New Revision: 77521

Modified:
   projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryContext.java
Log:
Simple refactoring.

Modified: projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryContext.java
===================================================================
--- projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryContext.java	2008-08-27 08:15:47 UTC (rev 77520)
+++ projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryContext.java	2008-08-27 08:20:39 UTC (rev 77521)
@@ -222,9 +222,7 @@
       }
       
       setRootPeer(peer);
-
-      String name = getRootURI().getPath().toString();
-
+      String name = getRootURI().getPath();
       int toPos = name.length();
 
       // cut off any ending slash
@@ -490,8 +488,7 @@
       }
       catch (Exception ex)
       {
-         RuntimeException e = new RuntimeException("Failed to read zip file: " + zipSource, ex);
-         throw e;
+         throw new RuntimeException("Failed to read zip file: " + zipSource, ex);
       }
       finally
       {
@@ -645,7 +642,6 @@
     * Returns this context's root
     *
     * @return root handler
-    * @throws IOException for any error
     */
    public VirtualFileHandler getRoot()
    {
@@ -780,10 +776,7 @@
 
       checkIfModified();
       EntryInfo ei = entries.get(handler.getLocalPathName());
-      if(ei == null)
-         return false;
-
-      return true;
+      return ei != null;
    }
 
    /**
@@ -804,7 +797,7 @@
       if (ei == null || ei.entry == null)
          return false;
 
-      return !ei.entry.isDirectory();
+      return ei.entry.isDirectory() == false;
    }
 
    /**
@@ -1034,10 +1027,8 @@
          if (children != null)
          {
             int i = 0;
-            Iterator<AbstractVirtualFileHandler> it = children.iterator();
-            while(it.hasNext())
+            for (AbstractVirtualFileHandler child : children)
             {
-               AbstractVirtualFileHandler child = it.next();
                if (child.getName().equals(original.getName()))
                {
                   children.set(i, replacement);




More information about the jboss-cvs-commits mailing list