clientloader: throw classnotfoundexception when trying to load classes from the closed jar

This allows showing the classname when an exception is thrown due to the
jar being closed
This commit is contained in:
Adam
2020-01-23 11:16:22 -05:00
parent 8f116f4164
commit 1779d83302

View File

@@ -451,7 +451,17 @@ public class ClientLoader implements Supplier<Applet>
protected Class<?> findClass(String name) throws ClassNotFoundException
{
String entryName = name.replace('.', '/').concat(".class");
JarEntry jarEntry = jarFile.getJarEntry(entryName);
JarEntry jarEntry;
try
{
jarEntry = jarFile.getJarEntry(entryName);
}
catch (IllegalStateException ex)
{
throw new ClassNotFoundException(name, ex);
}
if (jarEntry == null)
{
throw new ClassNotFoundException(name);