BAT crashes when loading empty (0-byte) .jar files

Issue #20 resolved
Daniel Klauer created an issue

BAT currently uses java.util.zip.ZipFile(java.io.File) to load .jar files. This will throw a ZipException if the .jar file is empty (0 bytes) or broken, causing the class file loading process to abort completely, because the exception is not handled in BAT.

We have found that the Qualitas Corpus contains several empty 0-byte .jar files (for unknown purposes; perhaps even just packaging/unpackaging errors). Since BAT crashes when encountering them, it becomes impossible to use BAT to search a directory for .jar files if it also contains broken ones.

It would be nicer if BAT could show an error message if a specific .jar could not be loaded, and continue with others in any case. Similar behaviour already exists for class files: Problems when loading individual class files are reported on the console but don't abort the loading process.

Comments (3)

  1. Log in to comment