Skip to content

Commit e1bcb4a

Browse files
authored
[java/annalyns-infiltration] Remove knightIsAwake from examples in comments (#2356)
This is to try make it clearer that the example in the comment isn't the solution for the task. Resolves exercism/java-analyzer#188
1 parent 6aafb17 commit e1bcb4a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

analyzer-comments/java/annalyns-infiltration/avoid_boolean_literal_returns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ Example :
66

77
```java
88
// instead of
9-
if (knightIsAwake) {
9+
if (someExpression) {
1010
return true;
1111
} else {
1212
return false;
1313
}
1414

1515
// ... return the expression directly
16-
return knightIsAwake;
16+
return someExpression;
1717
```

analyzer-comments/java/annalyns-infiltration/avoid_comparison_with_literal.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Instead of comparing booleans with the literal values, it can be simplified to j
44

55
```java
66
// instead of
7-
return knightIsAwake == true;
7+
return someBoolVariable == true;
88

99
// use
10-
return knightIsAwake;
10+
return someBoolVariable;
1111
```

0 commit comments

Comments
 (0)