4523159: suggestion for a bugfix for 13 year old "jars in path with !"

Daniel Wilhlem wilhelm at appwork.org
Tue Sep 15 08:31:44 UTC 2015


Our download manager http://jdownloader.org/ has millions of customers.
Some of them also suffered from the 13 year old bug 
The issue happens because '!/' is used as seperator between a jar file 
and its content in URLStreamHandler and JarURLConnection.

I hereby want to suggest our bugfix.

It consists of a modified sun.net.www.protocol.jar.Handler and 
Instead of searching for '!/' and using the first hit, our customized 
sun.net.www.protocol.jar.Handler loops through URL.getFile()
via indexof and substring and tests if it specifies the actual jar file 
on disk.
In case the path contains '!/' we return a customized 
sun.net.www.protocol.jar.JarURLConnection that overrides
getJarFileURL(),getJarEntry(),getEntryName() to provide the correct 

The one disadvantage of this bugfix is the additional IO introduced by 
File.exits(), but that can be considered//neglectable/./

Please find attached our customized classes.

Best Regards
Daniel Wilhelm

PS: cc'ed to jdk9-dev

Daniel Wilhelm
CTO, Co-Founder
Appwork GmbH

T: +49 (911)97923112 (Mo-Fr 9:00 - 17:00 CET)

Schwabacherstraße 117,           90763 Fürth,          Germany

More information about the jdk9-dev mailing list