On Mon, 16 Jan 2023 13:30:11 GMT, Jan Lahoda <jlah...@openjdk.org> wrote:
>> Archie L. Cobbs has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Fix bug where field initializer warnings could be incorrectly suppressed. >> - Consolidate all the unit tests that generate warnings into one. > > src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java > line 293: > >> 291: return !currentClass.sym.isFinal() && >> 292: !(currentClass.sym.isSealed() && >> currentClass.permitting.isEmpty()) && >> 293: !(currentClass.sym.owner.kind == MTH) && > > Maybe `isDirectlyOrIndirectlyLocal`? > Suggestion: > > !currentClass.sym.isDirectlyOrIndirectlyLocal() > > > (Or enhance the `privateOuter` flag to also handle local classes? something > like `tree.sym.kind.matches(Kinds.KindSelector.VAL_MTH)`.) Yes, that's better - thanks, will fix. ------------- PR: https://git.openjdk.org/jdk/pull/11874