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

Ilarion Nakonechnyy inakonechnyy at openjdk.org
Mon Feb 20 12:13:29 UTC 2023


On Wed, 15 Feb 2023 03:13:08 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Ilarion Nakonechnyy has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Address review notes
>>  - Correct the jtreg test -
>>    check stacktrace only for NoClassDefFoundError
>
> 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?

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

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


More information about the hotspot-dev mailing list