RFR: 8348611: Eliminate DeferredLintHandler and emit warnings after attribution [v3]

Archie Cobbs acobbs at openjdk.org
Mon Jul 28 22:05:45 UTC 2025


On Mon, 28 Jul 2025 21:23:33 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> One thing that might help would be to maybe use the name `rootLint` for all lint variables we use to shortcircuit -- to make it clear that these checks are not really... 100% correct.

Not sure I'm understanding you... the remaining short-circuit checks are using "local" `Lint` instances, not the root `Lint` instance; for example `checkPotentiallyAmbiguousOverloads()`...

> Another possibility would be to have a centralized check in LintMapper which, if the tree has been attributed does a check similar to what `ThisEscapeAnalyzer` does, otherwise we just look at the root lint (as a stop gap).

Continuing the above comment, wouldn't that cause `checkPotentiallyAmbiguousOverloads()` to start ignoring any enclosing `@SuppressWarnings("overrides")` annotations?

> At least all clients that need shortcircuiting would use same logic, and the impl could do the best it can to support that (and maybe in the future we can see if we can improve on that front).

Other ideas:
* Add a method that basically says "Call me back when my `Lint` is ready". Echoes of `DeferredLintHandler` :)
* Get rid of as much short-circuiting as we possible (i.e., where the performance impact is negligible, we can simply not short-circuit)
* Move the short-circuited warnings to the `WARN` phase

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24584#discussion_r2237935426


More information about the kulla-dev mailing list