RFR: 8373186: Improve readability of core reflection toString specifications

Chen Liang liach at openjdk.org
Tue Jan 27 04:28:03 UTC 2026


On Sat, 6 Dec 2025 21:35:57 GMT, Joe Darcy <darcy at openjdk.org> wrote:

> Partial implementation of a spec refactoring to get some feedback before writing similar changes for other core reflection types.

src/java.base/share/classes/java/lang/reflect/Field.java line 352:

> 350:      *
> 351:      * The string includes information about access modifiers of the
> 352:      * field, the type of the field, the type declaring the field,

Suggestion:

     * field, the type of the field, the class or interface declaring the field,

We might also note that the access modifiers might not be comprehensive.
Since you link "modifiers" below, I wonder if it's better for us to link up here instead, where we can link to more proper getters like accessFlags, getType, getDeclaringClass, getName.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28688#discussion_r2730178443


More information about the core-libs-dev mailing list