RFR: 8015831: Add lint check for calling overridable methods from a constructor [v8]

Vicente Romero vromero at openjdk.org
Fri Jan 13 16:15:32 UTC 2023

On Fri, 13 Jan 2023 15:14:05 GMT, Archie L. Cobbs <duke at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java line 516:
>>> 514:         Name name = TreeInfo.name(invoke.meth);
>>> 515:         if (name == names._super) {
>>> 516:             scanInitializers();
>> it seems like the code scan initializers every time it finds a super() invocation, I guess that this scanning could be done once per class
> Yes... I did it that way is so that it doesn't require any adaptation if/when JDK-8194743 ever gets implemented. And it keeps the code a little simpler in exchange for a little redundancy.
> I'm happy to fix this if you think it is necessary though.

I'm OK either way we can revisit this later either as part of this PR or in a future one. I let it to your consideration


PR: https://git.openjdk.org/jdk/pull/11874

More information about the compiler-dev mailing list