access control for withfield bytecode, compared to putfield

John Rose john.r.rose at oracle.com
Tue Jun 9 06:38:00 UTC 2020


+1

> On Jun 8, 2020, at 4:29 PM, Dan Smith <Daniel.Smith at oracle.com> wrote:
> 
> 
>> 
>> On Apr 8, 2020, at 11:29 PM, John Rose <john.r.rose at oracle.com> wrote:
>> 
>> To summarize:  The simplest rule for access checking a
>> withfield instruction is to say, “pretend the field was
>> declared private, and perform access checks”.  That’s
>> it; the rest follows from the rules we have already laid
>> down.
> 
> Just had a chance to read this old mail...
> 
> FWIW, this *is* the specified behavior in the most recent JVMS iteration:
> 
> http://cr.openjdk.java.net/~dlsmith/lw2/lw2-20190628/specs/inline-classes-jvms.html#jvms-6.5.withfield
> 
> I agree, private access seems to be the right model. (Plus, maybe at some point, giving the class file the ability to express a 'withfield' access restriction as one of { public, protected, package, private }.)



More information about the valhalla-spec-experts mailing list