Skip to content

Compiler does not warn about invalid check names when using -XepPatchChecks #1092

@not-an-aardvark

Description

@not-an-aardvark

What version of Error Prone are you using?

2.3.1

Does this issue reproduce with the latest release?

Yes

What did you do?

I ran Errorprone and passed an invalid check name to the -XepPatchChecks option.

$ echo 'public class Foo {}' > Foo.java
$ java -Xbootclasspath/p:error_prone_ant-2.3.1.jar \
    com.google.errorprone.ErrorProneCompiler \
    -XepPatchChecks:NotAValidCheck \
    -XepPatchLocation:`pwd` \
    Foo.java

What did you expect to see?

I expected the compiler to report an error, since an invalid check name was used and the -XepIgnoreUnknownCheckNames flag was not provided.

What did you see instead?

No error was reported. The Errorprone compiler ran successfully on the file, apparently ignoring the invalid check.

Note that the compiler does report an error, as expected, when passing a flag like -Xep:NotAValidCheck. However, it doesn't report an error when passing a flag like -XepPatchChecks:NotAValidCheck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions