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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Oct 9 11:26:02 EDT 2009


Author: alesj
Date: 2009-10-09 11:26:02 -0400 (Fri, 09 Oct 2009)
New Revision: 94607

Modified:
   projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/plugins/context/zip/ZipFileWrapper.java
Log:
Group update code under single if.

Modified: projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/plugins/context/zip/ZipFileWrapper.java
===================================================================
--- projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/plugins/context/zip/ZipFileWrapper.java	2009-10-09 15:21:10 UTC (rev 94606)
+++ projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/plugins/context/zip/ZipFileWrapper.java	2009-10-09 15:26:02 UTC (rev 94607)
@@ -210,25 +210,23 @@
 
       ensureZipFile();
 
-      EntryInfoAdapter adapter = null;
+      // make sure input stream and certs reader work on the same update
+      ZipEntry update = entry;
       if (entry instanceof EntryInfoAdapter)
-         adapter = EntryInfoAdapter.class.cast(entry);
+      {
+         EntryInfoAdapter adapter = EntryInfoAdapter.class.cast(entry);
+         if (adapter.requiresUpdate())
+         {
+            // we need to update entry, from the new zif file
+            update = zipFile.getEntry(entry.getName());
+            adapter.updateEntry(update);
+         }
+      }
 
-      // make sure input stream and certs reader work on the same update
-      ZipEntry update;
-      if (adapter != null && adapter.requiresUpdate())
-         update = zipFile.getEntry(entry.getName());
-      else
-         update = entry; // using the old one is good enough, as we're done reading certs
-
       InputStream is = zipFile.getInputStream(update);
       if (is == null)
          throw new IOException("Entry no longer available: " + entry.getName() + " in file " + file);
 
-      // we need to update entry, from the new zif file
-      if (adapter != null)
-         adapter.updateEntry(update);
-
       InputStream zis = new CertificateReaderInputStream(entry, this, is);
 
       incrementRef();




More information about the jboss-cvs-commits mailing list