eclipse-aspectj / aspectj

Other
303 stars 86 forks source link

Set ClassNotFoundException root cause in ExtensibleURLClassLoader::findClass #266

Closed kriegaex closed 11 months ago

kriegaex commented 11 months ago

Detected by @euclio, currently ExtensibleURLClassLoader::findClass does not set the root cause of the exception thrown in the catch (IOException ex) block here:

https://github.com/eclipse-aspectj/aspectj/blob/8bed465e2629faf8180825d33a14ecfa3f2edb8d/weaver/src/main/java/org/aspectj/weaver/bcel/ExtensibleURLClassLoader.java#L49-L61

I.e., if an IOException occurs in the getBytes(name) call, e.g. in a "too many open files" situation or for any other reason, the user has no way of finding out why exactly the class was not found.