RFR: 8307512: Provide more information in message of NoSuchFieldException thrown by Class

Daohan Qu dqu at openjdk.org
Fri Jun 23 10:56:16 UTC 2023


On Fri, 23 Jun 2023 09:30:43 GMT, Chen Liang <liach at openjdk.org> wrote:

> I think a message like 'Class.field' is better, more consistent with methodToString's behavior.

Hi, @liach, thanks for your suggestions, this `Class.field` format is indeed more succinct. But I'm following this format (`NoSuchFieldError` thrown in `linkResolver.cpp`).

https://github.com/openjdk/jdk/blob/d1d2b55ce0b950e07f6e3761983f73fd58079627/src/hotspot/share/interpreter/linkResolver.cpp#L976-L984

Anyway, the point here is that the name of the class should be added to the message. So maybe both are acceptable. Let's wait for some others' opinions :D

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

PR Comment: https://git.openjdk.org/jdk/pull/14624#issuecomment-1604104282


More information about the core-libs-dev mailing list