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)

I'm sorry to hear this. It's done all the time in tests, by third-party 
libraries. I figured it'd be better if such a common procedure was more 
convenient

As a side note, encouraging the use of switch by adding more features to it 
(`when`, etc.) is more questionable than accessing private fields, in my view

Anyway, thanks for your feedback

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

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

Reply via email to