RFR: 8359596: Behavior change when both -Xlint:options and -Xlint:-options flags are given [v2]
Archie Cobbs
acobbs at openjdk.org
Mon Jun 23 13:30:29 UTC 2025
On Mon, 23 Jun 2025 10:46:57 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> So, the real fix of this PR is in using `isDisabled` instead of `isExplicitlyDisabled`. But I must notice that this carves out a special expection for `options` and `path` lint warnings -- whereas every other lint warning will not resolve "conflicts" in the same way.
Correct - because that "carve out" was already there in the previous behavior, and the whole point of this patch is to restore that previous behavior.
Some lint warnings simply don't follow the normal enable/disable logic (which you normally get by using `Lint.logIfEnabled()`) and this is one of them. It would be nice to eliminate these special exceptions over time, but (as revealed by the associated bug) doing so breaks expectations that are built into various folks' build processes. So it's a nice thought but obviously outside of the scope of this PR.
Instead, what I'm trying to do now (in upcoming PR #24584) is simply make these special cases more explicit in the code using new `DiagnosticFlag`'s; see for example [this change](https://github.com/archiecobbs/jdk/blob/982d2b8589a96f83507e7821caf177b0ce51c306/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java#L580-L585).
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25840#issuecomment-2996505310
More information about the compiler-dev
mailing list