RFR: 8344079: Minor fixes and cleanups to compiler lint-related code [v2]
Maurizio Cimadamore
mcimadamore at openjdk.org
Tue Dec 3 13:13:40 UTC 2024
On Mon, 2 Dec 2024 18:35:44 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:
> See the first suggestion in this comment... would that work?
I like that idea. So, one concrete proposal might be:
1. have LintWarning as a subclass of Warning
2. have CompilerProperties reflect the lint categories, by having different nested classes where LintWarnings factories and fields would appear (one nested class per lint category)
3. don't change `AbstractLog` - that will still offer a `log` method that takes a `Warning` that can be used for both regular warning and lint warnings (in case the lint warning is not really suppressible)
4. Add a method in `lint` to "logIfEnabled". This method accepts a `LintWarning`, not a warning. So we get some static type checking.
(That said, if lint warnings are to be reported using (4), what would be the added benefit of (2) ? )
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22056#discussion_r1867697913
More information about the compiler-dev
mailing list