RFR: 8224228: No way to locally suppress lint warnings in parser/tokenizer or preview features [v14]

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Feb 28 17:50:09 UTC 2025


On Fri, 28 Feb 2025 17:29:45 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:

> I've take a stab at the refactoring we discussed above. Now all of the work of mapping source code positions to `JCTree` declarations is handled entirely within the parser by a new class `LexicalLintManager`. Fire away :)

Thanks for giving a try. I have an initial question about the code. It seems like it stores all the "reports" and all the "declarations" in flat lists. Then we flush the reports once per compilation unit.

This means we still have to do a lot of work to associate reports with declarations.

What I had in mind was to basically do the association when `endDecl` is called. E.g. once you see a field declaration, at that point you can defer all the lint warnings that have been created for that field. This probably needs some `startDecl` (maybe). I'm sure you considered this alternative -- I'm curious as to why it was rejected?

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

PR Comment: https://git.openjdk.org/jdk/pull/23237#issuecomment-2691221832


More information about the compiler-dev mailing list