diff --git a/analyzer-comments/java/annalyns-infiltration/avoid_boolean_literal_returns.md b/analyzer-comments/java/annalyns-infiltration/avoid_boolean_literal_returns.md index 20e0d9f75..cb3a57c48 100644 --- a/analyzer-comments/java/annalyns-infiltration/avoid_boolean_literal_returns.md +++ b/analyzer-comments/java/annalyns-infiltration/avoid_boolean_literal_returns.md @@ -6,12 +6,12 @@ Example : ```java // instead of -if (knightIsAwake) { +if (someExpression) { return true; } else { return false; } // ... return the expression directly -return knightIsAwake; +return someExpression; ``` diff --git a/analyzer-comments/java/annalyns-infiltration/avoid_comparison_with_literal.md b/analyzer-comments/java/annalyns-infiltration/avoid_comparison_with_literal.md index a686c5522..a58a3a824 100644 --- a/analyzer-comments/java/annalyns-infiltration/avoid_comparison_with_literal.md +++ b/analyzer-comments/java/annalyns-infiltration/avoid_comparison_with_literal.md @@ -4,8 +4,8 @@ Instead of comparing booleans with the literal values, it can be simplified to j ```java // instead of -return knightIsAwake == true; +return someBoolVariable == true; // use -return knightIsAwake; +return someBoolVariable; ```