[v2.37.0] Disabled checks are executed when XepPatchChecks: is empty (original) (raw)

While upgrading ErrorProne from 2.36 to 2.37 we observed checks defined in

com.google.errorprone.scanner.BuiltInCheckerSuppliers.DISABLED_CHECKS

are surprisingly fired.
Our maven-compiler-plugin has config:

<arg>
    -Xplugin:ErrorProne \
    -XepPatchLocation:IN_PLACE \
    -XepPatchChecks:${errorprone.patchChecks} \
    -XepDisableAllChecks \
    -Xep:NullAway:ERROR \
    <!-- and our custom checkers: -->

where errorprone.patchChecks is a dynamically-provided Maven param.
When it's empty we have effectively:

    -XepPatchLocation:IN_PLACE \
    -XepPatchChecks: \
   ...

and tons of unwanted checks are executed, e.g. BooleanParameter or UnnecessarilyFullyQualified.

When we remove these two lines it's fine.

The issue does NOT exist in 2.36.


It might be added by #4699.
In ErrorProneAnalyzer a few suspicious changes were made, especially around emptiness of namedCheckers variable.