On 12.12.2016 20:56, Alex Buckley wrote: [...]
The ability of protected members to be accessed from outside their package means they are essentially public members for the purposes of inheritance and reflection. So, setAccessible should work for protected members of exported packages. I know what you mean about the receiver object being of the correct class, but that's outside the capability of setAccessible to check, so I don't believe it is checked.
why does it have to be checked? why not just allow it? I mean that is why I use setAccessible in the first place. I have much less use of making something accessible for which I already have access rights
bye Jochen