Question ad #AwkwardStrongEncapsulation (Re: Moving the changes in jake to jdk9/dev

Peter Levart peter.levart at gmail.com
Tue Dec 13 21:33:02 UTC 2016


Hi Rony,


On 12/13/2016 07:07 PM, Rony G. Flatscher wrote:
> To make a long story short: I have always adhered to the Java rules for the Rexx users, in that they
> are only allowed to access public Java classes, public fields and public methods ("there must be a
> reason why the Java language has defined these rules":)  ). The exception are protected members of a
> Java class that are accessed via instances of subclasses (maybe even created for ooRexx on the fly
> at runtime) in order to adhere to the Java model as close as possible. So the classic Java
> reflection (BSF4Rexx the initial Rexx-Java bridge worked even with Java 1.1.8, sic!, on OS/2)
> mechanism is really at the heart of this implementation, hence the question.


You still haven't explained in detail why you have to invoke 
.setAccessible(true) on a Method object to invoke a protected method 
from a subclass. This should not be needed.

Regards, Peter



More information about the jigsaw-dev mailing list