JDK-8373125 : Add defensive screening of modifiers for Field and Parameter toString() results
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 27
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-12-05
  • Updated: 2025-12-05
  • Resolved: 2025-12-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 27
27 masterFixed
Related Reports
Relates :  
Relates :  
Description
The modifiers in core reflection and just modeled using the bits of an int. For methods and constructors, there are collisions on the reuse of modifier bits on different kinds of constructs. Printing misleading information is avoid by masking out the modfiers using information from the Modifer class.

While Field and Parameter don't currently have such collisions, they may under Valhalla and adding defensive screenings now would add robustness.
Comments
Changeset: a20b7eb9 Branch: master Author: Joe Darcy <darcy@openjdk.org> Date: 2025-12-05 17:35:30 +0000 URL: https://git.openjdk.org/jdk/commit/a20b7eb943c19f9852bfaaec1fbbff647f1f5273
05-12-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/28672 Date: 2025-12-05 05:14:05 +0000
05-12-2025