Release Notes for TrueZIP 6.1

(July 10th, 2006)

Introduction

This is a bug fix and minor feature release. The primary focus has been to fix multithreading issues and enhance the Javadoc. The new feature is the extension of the ZIP archive driver family with CRC-32 checked versions for optional usage. Updating is considered critical for multithreaded environments such as application servers.

New CRC-32 checked ZIP archive drivers

TrueZIP now supports checking of the CRC-32 value in existing ZIP archive files. While this feature has been available for a while in the class de.schlichtherle.util.zip.ZipFile (as opposed to java.util.zip.ZipFile), it wasn't used by the ZIP archive driver family in the package de.schlichtherle.io.archive.zip. With TrueZIP 6.1. a number of new drivers have been introduced to support this feature:

Default Driver Optional driver
Does not check the CRC-32 value in existing archives Does check the CRC-32 value in existing archives
JarDriver CheckedJarDriver
ReadOnlySfxDriver CheckedReadOnlySfxDriver
Zip32Driver CheckedZip32Driver

Because CRC-32 checking comes at a notable performance penalty, the checked archive drivers are just optional and hence are not used by default. If you think that this is an issue, please bear in mind that any application based on the class java.util.zip.ZipFile currently does not support CRC-32.

 If you want to use these optional drivers for increased safety, you either (1) have to create a custom instance of the class de.schlichtherle.io.DefaultArchiveDetector or (2) provide a custom version of the configuration file META-INF/service/de.schlichtherle.io.archive.spi.ArchiveDetector.properties on your classpath. For the first approach, please refer to the Javadoc and have a look at the source code for the nzip utility in the default package. For the second approach, please have a look at the default configuration file within truezip-6.jar.

If you are using the checked ZIP archive drivers, the CRC-32 value of any input stream referring to an archive entry is calculated and compared to the CRC-32 value provided in the archive file as soon as you call the close() method of the input stream. If there is a mismatch, the close() method throws a de.schlichtherle.util.zip.CRC32Exception.

More unit tests

Some more JUnit tests have been added to the test directory in order to test multithreading and the GUI of the Swing based implementation of the Key Manager in the package de.schlichtherle.key.passwd.swing. All tests have been run on the following combinations of JDKs and platforms and should be running on all other platforms with the same JDK as well:

  • Sun's JDK 1.4.2-b28 for Windows1
  • Sun's JDK 1.4.2_12-b03 for Windows
  • Sun's JDK 1.5.0-b64 for Windows12
  • Sun's JDK 1.5.0_07-b03 for Windows2
  • Sun's JDK 1.6.0-beta2-b86 for Windows
  1. The tests de.schlichtherle.io.FileTestBase.testMultithreading1() and de.schlichtherle.util.zip.ZipTestBase.testMultithreading() may or may not fail with an OutOfMemoryException. This does not constitute an issue with TrueZIP. If this happens, simply try to increase the maximum memory available to the JVM using the -Xmx switch (-Xmx100m for example). Later versions of the JDK do not show this issue, so I guess this is because of a change in the garbage collection algorithm.
  2. The test de.schlichtherle.key.passwd.swing.PromptingKeyManagerTest.testMultithreadedKeyMgmtLifeCycle() will most likely fail on this combination of JDK/platform. Again, this does not constitute an issue with TrueZIP. This is because the Jemmy library calls Thread.sleep(10), which actually sleeps much longer for an arbitrary amount of time and hence causes Jemmy to timeout.

For the GUI tests to run you now need to have Jemmy 2.2.6 or later in your class path. You can download Jemmy at http://jemmy.netbeans.org. Please note that the test de.schlichtherle.key.passwd.swing.PromptingKeyManagerTest.testMultihreadedKeyMgmtLifeCycle() runs in Robot mode and hence will hijack your mouse and keyboard for the duration of the test (aprox. 2 minutes). Do not change the window during this test, or you will get a bad surprise from all the input that would then be received by the other window!

Legend
New Introduces a new feature.
Fixed Introduces a bug fix of an existing feature.
Enhanced Introduces the enhancement of an existing feature. This update is fully backwards compatible.
Changed Introduces the change of an existing feature. This update may cause backwards incompatibilities .
Deprecated Introduces the deprecation of an existing feature.

List of Updates (Change Log)

Following is an overview of all updates in this release which affect the public API. Please note that internal refactorings are not listed. For a full list of updates, please refer to the CVS repository and diff to the tag TrueZIP-6_0.

Multithreading

  1. Fixed: The classes de.schlichtherle.util.zip.ZipOutputStream and de.schlichtherle.io.OutputArchiveMetaData dead locked each other if used in multithreading environments. This affected the public File* classes in the package de.schlichtherle.io.
  2. Fixed: de.schlichtherle.io.archive.spi.AbstractArchiveDriver.ensureEncodable() threw a RuntimeException if used in multithreading environments. This affected most classes in the package de.schlichtherle.io.
  3. Fixed: de.schlichtherle.io.ArchiveEntryMetaData.list*() threw an AssertionError if used in multithreading environments and assertions were enabled. If assertions were disabled, wrong results may have been produced. This affected the methods de.schlichtherle.io.File.list*().
  4. Fixed: de.schlichtherle.util.zip.ZipFile.getInputStream() threw a ZipException if used in multithreading environments. This affected the class de.schlichtherle.io.FileInputStream.

Key Manager

The Key Manager in the package de.schlichtherle.key has undergone some changes/enhancements:

  1. Fixed: KeyManager.setInstance() was always ignored.
  2. Fixed: KeyManager.resetAndClearKeyProviders() always threw a ConcurrentModificationException.
  3. Enhanced: The method KeyManager.getKeyProvider(String, Class) can now determine a more suitable class substitute for the second parameter, e.g. if the second parameter is AesKeyProvider.class. This provides better support for loose coupling between client applications and key provider implementations.
  4. Changed: The Swing based implementation of the Key Manager, which is located in the package de.schlichtherle.key.passwd.swing, has been more or less rewritten in order to fix some bugs (including multithreading issues) and provide a more maintainable and extensible code base. The impact of this change should be minor because these classes were a specific implementation of the Key Manager service and were not for public use anyway unless a client application needed to customize this implementation.

Miscellaneous

  1. Fixed: de.schlichtherle.util.zip.ZipFile.getCheckedInputStream() returned a buggy input stream: The CRC32 was only correctly computed (and hence the check in the close() method run successfully) if the input stream was read until the end of file using either read(byte[]) or read(byte[], int, int) and neither read() nor skip() were used.
  2. Enhanced: On a CRC32 mismatch in a ZIP file, the close() method of the input stream returned by de.schlichtherle.util.zip.ZipFile.getCheckedInputStream() now throws a de.schlichtherle.util.zip.CRC32Exception, which is a new subclass of de.schlichtherle.util.zip.ZipException, which was thrown instead before. In case the configured ZIP driver supports this feature (see next section), the close() method of the class de.schlichtherle.io.FileInputStream throws this exception, too.
  3. Fixed: Depending on the use case, the private event listener code in de.schlichtherle.swing.EnhancedPanel threw a NullPointerException from the AWT event dispatch thread.
  4. Fixed: Removed obsolete get/setDosTime() methods from de.schlichtherle.io.archive.zip.Zip32Entry class.
  5. Enhanced: PanelEvents fired by de.schlichtherle.swing.EnhancedPanel are now coalesced, so that for each event cause only one event is generated, no matter how the Swing API is utilized by the client application to show or hide an ancestor window.
  6. Enhanced: The logging in de.schlichtherle.io.DefaultArchiveDetector has been refined in order to provide more suitable messages for tracking down class loader issues.
  7. Enhanced: The Javadoc for many classes has been reviewed and fixed or enhanced.