Clarification on JDK-8038975

Alex Buckley alex.buckley at oracle.com
Tue Jun 3 22:57:44 UTC 2014


I believe the code should compile. The body of OuterImpl certainly has 
access to the protected member class Inner. Nothing is accessed via 
qualified names that would cause additional protected rules to kick in. 
The fact that 'Inner' is an accessible type for the formal parameter 
'inner' indicates everything should be well with 'inner.iterator()'.

Alex

On 6/3/2014 1:35 PM, Paul Govereau wrote:
> Hello,
>
> I have recently fixed
>
>    https://bugs.openjdk.java.net/browse/JDK-8038975 .
>
> Which is a difference in access enforcement for inner classes depending
> on if an enhanced-for is used or not.
>
> However, now the reviewers and I are having doubts that this is a bug.
> Perhaps javac is correctly handling the enhanced-for and the
> "diminished" for is not handled correctly.
>
> Can anyone help clarify the spec in regard to this issue?
>
> Thanks,
> Paul


More information about the compiler-dev mailing list