RFR: 8302491: NoClassDefFoundError omits the original cause of an error [v2]

Ilarion Nakonechnyy inakonechnyy at openjdk.org
Tue Feb 21 11:31:31 UTC 2023


On Mon, 20 Feb 2023 23:56:53 GMT, David Holmes <dholmes at openjdk.org> wrote:

>>>  Also I think your new method has to handle this case too
>>> / If new_exception returns a different exception while creating the exception, return null.
>> 
>> I'm afraid that in this case ( if I return null ), the original cause again will be missed from the stacktrace.
>
> If `new_exception` returns a different exception then you have already lost that. The `ExceptionInInitializerError` would have been replaced by some other exception object: most likely OOME or even another SOE?

Is it poor, to report OOME or SOE as the cause, instead of `ExceptionInInitializerError`?  
Especially when the first call to `get_cause_with_stack_trace` already has returned null.
Actually, this is the intention of the fix - to report the SOE as the cause of NCDFE.

-------------

PR: https://git.openjdk.org/jdk/pull/12566


More information about the hotspot-dev mailing list