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 22:12:54 UTC 2025


On Fri, 28 Feb 2025 22:03:55 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> > I originally was handling things "as they come", based on the assumption that reports always occur prior to the completion of their containing declaration, but that's not true (`dangling-doc-comment` violates it).
> 
> Just one question: looking at your code, it seems that `saveDanglingDocComments` is always called _before_ `endDecl`. So I'm not sure how to read your comment. Perhaps you were hoping for all the warnings to be "contained" in the declaration body (and this would indeed be violated by comments, but also warnings on annotations).

Maybe you mean this:


class Test {
   /* one */
   void test(/** two */ int i, /** three */ int y) { }
}


The two dangling warnings would be reported before the start of the method body -- but if we just flush things when we get to the closest `endDecl`, we'd report them as part of the method parameter declarations. Is that what you mean?

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

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


More information about the compiler-dev mailing list