RFR: 8361424: Eliminate Log methods mandatoryWarning() and mandatoryNote()
Maurizio Cimadamore
mcimadamore at openjdk.org
Thu Jul 17 18:27:48 UTC 2025
On Fri, 4 Jul 2025 18:24:50 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:
> The fix for [JDK-8359493](https://bugs.openjdk.org/browse/JDK-8359493) added the ability to associate `DiagnosticFlag`'s to specific warnings at the point of definition in `compiler.properties`. In cases where the flag is an inherent property of the warning itself, `compiler.properties` is a more appropriate place to declare it, instead of having to add it at all the points in the codebase where that particular warning is used.
>
> In particular, the Log API methods `mandatoryWarning()` and `mandatoryNote()` can be removed, as they serve only to add the `MANDATORY` flag to warnings and notes for which "mandatoryness" is inherent. Doing so should help decomplexify the code a bit.
The change looks great -- but I don't buy the changes in `AbstractLog` -- don't we need methods that take a varargs of flags (instead of just one) ? It's ok if we want to special case for the common case where there's just one, but restricting the API to only take one seems limiting (when in fact we already use multiple flags in compiler properties)
-------------
PR Review: https://git.openjdk.org/jdk/pull/26138#pullrequestreview-3030571629
More information about the compiler-dev
mailing list