From 2dbb23885a6fbaf593312556e3b65c6d4991a1d2 Mon Sep 17 00:00:00 2001 From: Kah Goh Date: Sat, 20 Jul 2024 20:50:11 +0800 Subject: [PATCH] [java/annalyns-infiltration] Remove knightIsAwake from examples in comments This is to try make it clearer that the example in the comment isn't the solution for the task. Resolves exercism/java-analyzer#118 --- .../annalyns-infiltration/avoid_boolean_literal_returns.md | 4 ++-- .../annalyns-infiltration/avoid_comparison_with_literal.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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; ```