RFR: 8338981: Access to private classes should be permitted inside the permits clause of the enclosing top-level class [v2]

Evemose duke at openjdk.org
Wed Aug 28 09:36:22 UTC 2024


On Tue, 27 Aug 2024 10:10:31 GMT, Evemose <duke at openjdk.org> wrote:

> Others may have a different opinion, but this seems a bit too hacky to me (given we would need to maintain this for a long time).
> 
> I would suggest to try to add a new flag into `AttrContext`, along the lines of `permitPrivateAccessInHeader`, and set it while attributing the permitted types. Not sure how invasive that'd be, but hopefully not terribly much. And it should be clear (and documented) what's happening.

I have decided to write tests before reworking fix. Could you please suggest where could i put it? I have found tools/javac/diags/examples folder, but it seems to only contain negative tests, while I need positive ones. Is there any suitable place for this kind of thing?

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

PR Comment: https://git.openjdk.org/jdk/pull/20718#issuecomment-2314818883


More information about the compiler-dev mailing list