RFR: 8271623: Omit enclosing instance fields from inner classes that don't use it [v4]

Liam Miller-Cushon cushon at openjdk.java.net
Mon Nov 22 22:33:49 UTC 2021


On Mon, 22 Nov 2021 21:47:28 GMT, Vicente Romero <vromero at openjdk.org> wrote:

> do you still need to force the access to the outer class in all the test cases or does it make sense to provide a new golden file for some of them when applicable?

Thanks @vicente-romero-oracle for taking a first pass! For the tests that are about details of inner and outer classes, I wanted to make sure I didn't regress coverage for anything that was specifically testing `this$`. Taking another pass over the tests, I think for most of the `attributes/Synthetic` tests it makes more sense to just update the assertions. Let me know if you see any others where there's a better fix than adding an explicit enclosing instance reference, and I'm happy to update them also.

> I think overall it seems sensible. Regarding compatibility impact, I'd suggest to make sure it is understood (e.g. in the release notes) the behavior may be altered by instances being GCed sooner. (While it typically may be desirable, it might cause issues for some.)

@lahodaj Thanks! I created the sub-task for the release notes and added a note there as a reminder to mention that: https://bugs.openjdk.java.net/browse/JDK-8277604

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

PR: https://git.openjdk.java.net/jdk/pull/4966


More information about the compiler-dev mailing list