[jsword-svn] jsword/java/jsword/org/crosswire/jsword/book/install/sword s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Sun May 8 18:29:11 MST 2005


Update of /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/install/sword
In directory www.crosswire.org:/tmp/cvs-serv6194/java/jsword/org/crosswire/jsword/book/install/sword

Modified Files:
	AbstractSwordInstaller.java 
Log Message:
Moved unused code to limbo.
Upgraded support-tools: checkstyle, pmd and findbugs to most recent.
Addressed over 100 issues reported by findbugs and checkstyle.
Resulted in major refactoring of GBFFilter.
Net result is that code size is significantly smaller.

Index: AbstractSwordInstaller.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/install/sword/AbstractSwordInstaller.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** AbstractSwordInstaller.java	23 Mar 2005 02:05:38 -0000	1.11
--- AbstractSwordInstaller.java	9 May 2005 01:29:07 -0000	1.12
***************
*** 256,266 ****
          }
  
          try
          {
              ConfigEntry.resetStatistics();
  
!             InputStream in = cache.openStream();
!             GZIPInputStream gin = new GZIPInputStream(in);
!             TarInputStream tin = new TarInputStream(gin);
              while (true)
              {
--- 256,269 ----
          }
  
+         InputStream in = null;
+         GZIPInputStream gin = null;
+         TarInputStream tin = null;
          try
          {
              ConfigEntry.resetStatistics();
  
!             in = cache.openStream();
!             gin = new GZIPInputStream(in);
!             tin = new TarInputStream(gin);
              while (true)
              {
***************
*** 278,282 ****
                          int size = (int) entry.getSize();
                          byte[] buffer = new byte[size];
!                         tin.read(buffer);
  
                          if (internal.endsWith(SwordConstants.EXTENSION_CONF))
--- 281,288 ----
                          int size = (int) entry.getSize();
                          byte[] buffer = new byte[size];
!                         if (tin.read(buffer) != size)
!                         {
!                             log.warn("Did not read all that was expected " + internal); //$NON-NLS-1$
!                         }
  
                          if (internal.endsWith(SwordConstants.EXTENSION_CONF))
***************
*** 306,312 ****
                  }
              }
-             IOUtil.close(tin);
-             IOUtil.close(gin);
-             IOUtil.close(in);
  
              loaded = true;
--- 312,315 ----
***************
*** 318,321 ****
--- 321,330 ----
              throw new InstallException(Msg.CACHE_ERROR, ex);
          }
+         finally
+         {
+             IOUtil.close(tin);
+             IOUtil.close(gin);
+             IOUtil.close(in);
+         }
      }
  



More information about the jsword-svn mailing list