RFR: 8048190: NoClassDefFoundError omits original ExceptionInInitializerError [v5]
Coleen Phillimore
coleenp at openjdk.java.net
Tue Aug 10 02:22:34 UTC 2021
On Mon, 9 Aug 2021 23:41:01 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> I don't know. The worry was that the exception would be unloaded, which it won't if it's in the bootstrap class loader.
>
> There are multiple problems with instantiating an unknown instance of an exception type. The unloading aspect is only one of those problems. To be safe you really only want to instantiate a well-defined set of well-behaved exceptions types - and that would be those (or a subset thereof) in the base module.
>
> Maybe the safest thing is to always create an instance of EIIE to hold the original stacktrace and message. I actually find it semantically more appealing to have the NCDFE be caused by an EIIE.
That might make things really simple and nice! I like that idea.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4996
More information about the hotspot-dev
mailing list