RFR: JDK-8310861: Improve location reporting for javac serial lint warnings

Joe Darcy darcy at openjdk.org
Mon Jun 26 01:32:03 UTC 2023


On Mon, 26 Jun 2023 00:54:32 GMT, Joe Darcy <darcy at openjdk.org> wrote:

> For a subset of the expanded serial lint warnings ([JDK-8202056](https://bugs.openjdk.org/browse/JDK-8202056), [JDK-8160675](https://bugs.openjdk.org/browse/JDK-8160675)), javac uses the location of the enclosing type rather than the method or field in question.
> 
> This PR addresses this by using the idiom of finding the method/field's tree within the type tree being checked.
> 
> All langtools regression tests pass when run locally; the intention is to backport this fix to JDK 21 as well.

PS To expand "negative" testing, I could add more `@compile` lines to verify no warnings are generated without serial warnings being enabled -- or revert the few such changes like that already added.

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

PR Comment: https://git.openjdk.org/jdk/pull/14644#issuecomment-1606399894


More information about the compiler-dev mailing list