From 02bd6b8ccffbbf7366c495007992cbe1d70cff95 Mon Sep 17 00:00:00 2001 From: "copybara-service[bot]" Date: Wed, 30 Oct 2024 12:17:00 +0000 Subject: [PATCH] Latest docs on successful build 6821 auto-pushed to gh-pages --- bugpattern/YodaCondition.md | 5 +++-- bugpatterns.md | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bugpattern/YodaCondition.md b/bugpattern/YodaCondition.md index fe08a5efee9..3486aabb603 100644 --- a/bugpattern/YodaCondition.md +++ b/bugpattern/YodaCondition.md @@ -1,7 +1,8 @@ --- title: YodaCondition -summary: The non-constant portion of an equals check generally comes first. Prefer - e.equals(CONSTANT) if e is non-null or Objects.equals(e, CONSTANT) if e may be +summary: The non-constant portion of a comparison generally comes first. For equality, + prefer e.equals(CONSTANT) if e is non-null or Objects.equals(e, CONSTANT) if e may + be null. For standard operators, prefer e > CONSTANT. layout: bugpattern tags: '' severity: WARNING diff --git a/bugpatterns.md b/bugpatterns.md index 411c5f31a82..dc7f612315b 100644 --- a/bugpatterns.md +++ b/bugpatterns.md @@ -1666,7 +1666,7 @@ __[Varifier](bugpattern/Varifier)__
Consider using `var` here to avoid boilerplate. __[YodaCondition](bugpattern/YodaCondition)__
-The non-constant portion of an equals check generally comes first. Prefer e.equals(CONSTANT) if e is non-null or Objects.equals(e, CONSTANT) if e may be +The non-constant portion of a comparison generally comes first. For equality, prefer e.equals(CONSTANT) if e is non-null or Objects.equals(e, CONSTANT) if e may be null. For standard operators, prefer e <OPERATION>> CONSTANT. ## Experimental : SUGGESTION