On Thu, 25 Jan 2024 21:35:45 GMT, Sergey <d...@openjdk.org> wrote:

> The feature allows to extract a private field value in a single expression, 
> like so:
> 
> object.getClass().getDeclaredField().setAccessible().get(object)

First, usually to propose a patch to core libraries, we usually submit an issue 
or suggest an enhancement to https://bugs.java.com, or ask at 
`core-libs-dev@openjdk.org`.

A field that has been "set accessible" is supposed to be reused, as future 
`get` calls will bypass accessibility checks too. So adding a builder-style 
alias isn't that useful, especially that reflection Executable objects have no 
other setters, and the exceptions thrown by each method in the chain should be 
handled separately.

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

PR Comment: https://git.openjdk.org/jdk/pull/17578#issuecomment-1965852745

Reply via email to