On Thu, 28 Aug 2025 16:21:43 GMT, Maurizio Cimadamore <[email protected]>
wrote:
>> Vicente Romero has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> minor diff
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 1261:
>
>> 1259: for (JCTree stat : tree.body.stats) {
>> 1260: prologueCode.add(stat);
>> 1261: /* gather all the stats in the body until a
>> `super` or `this` constructor invocation is found,
>
> I understand that you wanted to simplify the visitor -- but doing a linear
> pass on the constructor and creating a new list of statements is also kind of
> expensive -- maybe when we're done with this change we can see if there's a
> way to set a flag on the visitor to shortcircuit the analysis after the super
> call is found.
I think I like the trade-off, we could try to infer if a constructor invocation
corresponds to the class we are interested in. Like for example analyzing the
symbol associated to a `super` or `this` invocation. But for erroneous
invocations the symbol could be null. So what to do when we find a null symbol?
We would have no clues I think.
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/1523#discussion_r2308478876