On Tue, 29 Nov 2022 17:44:18 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:
> It is a bit unusual to use a local class as a holder class (the typical > manner is to a have a private static final nested class) but we didn't have > local classes until recently - so maybe that's OK. I assume there's only one > version of that class and it is static? As I understand it, there are zero instances of the class as it is only declared. The class only contains a class variable. In a recent Java version, classes that are "effectively static" (my wording) (i.e. does not refernece the outer class) does not hold a reference to the outer class. So, it is not static but in this case, I believe it does not matter because 1) it is never instantiated and 2) if it was indeed instantiated, it is "effectively static". ------------- PR: https://git.openjdk.org/jdk/pull/11418