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

Vicente Romero vromero at openjdk.org
Thu Sep 12 16:21:09 UTC 2024


On Wed, 28 Aug 2024 09:33:18 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?

most tests for sealed classes are under:
`test/langtools/tools/javac/sealed/`

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

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


More information about the compiler-dev mailing list