RFR: 8373186: Improve readability of core reflection toString specifications

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


On Mon, 8 Dec 2025 22:28:19 GMT, Roger Riggs <rriggs 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 365:
> 
>> 363:      * Specific information about {@linkplain #getModifiers()
>> 364:      * modifiers} or other aspects of the field should be retrieved
>> 365:      * using methods for that purpose.
> 
> This is needlessly vague and gives an opportunity to reinforce the preferred order of modifiers.

I think you can probably refer to the JLS/JVMS difference, noting JVM (classfile) information may be missing from this string output, such as ACC_SYNTHETIC or future ACC_STRICT_INIT.

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

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


More information about the core-libs-dev mailing list