scijava / script-editor-jython

Jython plugin for the SciJava Script Editor
BSD 2-Clause "Simplified" License
2 stars 2 forks source link

ZipException in ClassUtil #15

Closed tferr closed 2 years ago

tferr commented 2 years ago

Just got this exception while fiddling with the editor. Unfortunately, I don't have a step-by-step procedure to reproduce it.

java.util.zip.ZipException: zip file is empty
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:225)
    at java.util.zip.ZipFile.<init>(ZipFile.java:155)
    at java.util.jar.JarFile.<init>(JarFile.java:166)
    at java.util.jar.JarFile.<init>(JarFile.java:103)
    at org.scijava.ui.swing.script.autocompletion.ClassUtil.findAllClasses(ClassUtil.java:249)
    at org.scijava.ui.swing.script.autocompletion.ClassUtil.ensureCache(ClassUtil.java:77)
    at java.lang.Thread.run(Thread.java:748)

(pinging @acardona)

acardona commented 2 years ago

The error is innocuous in that the try/catch is inside the for loop, therefore, it tests each jar file (aka a zip file) independently. Regardless of a jar file being invalid, the method ClassUtil.findAllClasses will succeed.

Most likely what happened: you were still running a mvn build and one jar file was a .part file or something, still empty.