Replace NOT operator with explicit false check (#67817)

We have an in-house rule to compare explicitly against `false` instead
of using the logical not operator (`!`). However, this hasn't
historically been enforced, meaning that there are many violations in
the source at present.

We now have a Checkstyle rule that can detect these cases, but before we
can turn it on, we need to fix the existing violations. This is being
done over a series of PRs, since there are a lot to fix.
This commit is contained in:
Rory Hunter 2021-01-26 14:47:09 +00:00 committed by GitHub
parent 9a1611da80
commit ad1f876daa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
119 changed files with 264 additions and 246 deletions

View file

@ -29,7 +29,7 @@ public class JavaVersion {
public static final List<Integer> JAVA_11 = parse("11");
static List<Integer> parse(final String value) {
if (!value.matches("^0*[0-9]+(\\.[0-9]+)*$")) {
if (value.matches("^0*[0-9]+(\\.[0-9]+)*$") == false) {
throw new IllegalArgumentException(value);
}