RFR: 8345911: Enhance error message when IncompatibleClassChangeError is thrown for sealed class loading failures [v3]

Alan Bateman alanb at openjdk.org
Fri Dec 13 12:55:39 UTC 2024


On Fri, 13 Dec 2024 02:32:26 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/oops/instanceKlass.cpp line 234:
>> 
>>> 232:              "and sealed class %s is in module \"%s\" for loader %s",
>>> 233:              k->external_name(), k->module()->name_as_C_string(), k->module()->loader_data()->loader_name_and_id(),
>>> 234:              this->external_name(), this->module()->name_as_C_string(), this->module()->loader_data()->loader_name_and_id());
>> 
>> This looks quite good except that the word "for" in "for loader %s" looks a bit strange.  In API docs we speak of "the ClassLoader for a module", not the other way around. Class loaders optionally have a name so I suppose the "loader %s" should put quotes around the name like it does for the module name.
>
> I will change to "with loader %s".
> 
> Note that `loader_name_and_id()` already puts (single) quotes around the name of the loader. I will use single-quotes for the module name too.

This looks good, I hadn't spotted that loader_name_and_id() returns the quotes.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22703#discussion_r1883875589


More information about the hotspot-dev mailing list