RFR: 8048190: NoClassDefFoundError omits original ExceptionInInitializerError [v3]

Coleen Phillimore coleenp at openjdk.java.net
Fri Aug 6 13:46:32 UTC 2021


On Fri, 6 Aug 2021 07:30:55 GMT, Doug Simon <dnsimon at openjdk.org> wrote:

>> Coleen Phillimore has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>> 
>>  - Merge branch 'master' into init-oom
>>  - David review comments.
>>  - Merge branch 'master' into init-oom
>>  - 8048190: NoClassDefFoundError omits original ExceptionInInitializerError
>>  - 8048190: NoClassDefFoundError omits original ExceptionInInitializerError
>
> src/hotspot/share/oops/instanceKlass.cpp line 1054:
> 
>> 1052: 
>> 1053: ResizeableResourceHashtable<const InstanceKlass*, InitErrorElement, ResourceObj::C_HEAP, mtClass>
>> 1054:       _initialization_error_table(20);
> 
> As I understand, the whole point of this table is to save space. Instead, you could repurpose `T[] Class.enumConstants` to be `Object Class.enumConstantsOrInitError`. For a non-enum classes, this field is never used (and thus already "wasted") and for enum classes it will never be successfully initialized if there's a clinit error.

It seems like if this field in Class is wasted, it should be used by something more frequent and at the Java level.  I don't want to add some internal implementation dependency to this.  It'll complicate any attempts to change it.
In short, I didn't know about it and in fact, I shouldn't know about it from inside the JVM.

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

PR: https://git.openjdk.java.net/jdk/pull/4996


More information about the hotspot-dev mailing list