Integrated: 8349847: Support configuring individual lint categories as errors

Archie Cobbs acobbs at openjdk.org
Tue Oct 7 19:35:04 UTC 2025


On Thu, 13 Feb 2025 20:52:49 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:

> This PR enhances the `-Werror` flag to support lint categories just like `-Xlint` does. For example `-Werror:all,-preview` would cause an error if any warning not in the `preview` lint category occurred.
> 
> The existing `-Xlint` flag has a particular behavior when conflicting flags are combined (e.g., `-Xlint:all -Xlint:none -Xlint:foo -Xlint:-foo` is equivalent to `-Xlint:all`). This behavior has been factored out and Javadocumented so that both `-Xlint` and `-Werror` can have this same "parsing" logic.
> 
> See the CSR [JDK-8350044](https://bugs.openjdk.org/browse/JDK-8350044) for details on how the new flag behaves in certain corner cases.

This pull request has now been integrated.

Changeset: 910bb68e
Author:    Archie Cobbs <acobbs at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/910bb68e5191f830ff6f3dff5753e4e5f6214a7b
Stats:     241 lines in 13 files changed: 180 ins; 27 del; 34 mod

8349847: Support configuring individual lint categories as errors

Reviewed-by: vromero

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

PR: https://git.openjdk.org/jdk/pull/23622


More information about the compiler-dev mailing list