RFR: 8302491: NoClassDefFoundError omits the original cause of an error [v2]
David Holmes
dholmes at openjdk.org
Mon Feb 20 22:20:27 UTC 2023
On Mon, 20 Feb 2023 12:10:57 GMT, Ilarion Nakonechnyy <inakonechnyy at openjdk.org> wrote:
>> src/hotspot/share/classfile/javaClasses.cpp line 2783:
>>
>>> 2781: }
>>> 2782:
>>> 2783: Handle java_lang_Throwable::get_cause_simple(JavaThread* current, Handle throwable) {
>>
>> How about `get_cause_without_stacktrace`?
>>
>> The two methods should be able to share a lot of code rather than duplicating most of it.
>
> So you propose reworking a `java_lang_Throwable::get_cause_with_stack_trace` - instead of implementing a separate function `get_cause_simple`: add a parameter "Bool stacktrace_required", and manage to call Java depending on that parameter?
That would be one option. There is a lot of overlap with these two methods. 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.
-------------
PR: https://git.openjdk.org/jdk/pull/12566
More information about the hotspot-dev
mailing list