Skip to content

Commit 5872540

Browse files
committed
Return of boolean expression should not be wrapped into an if-the-else statement
Signed-off-by:Matteo Baccan <matteo.baccan@gmail.com>
1 parent c665ec9 commit 5872540

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

core/src/main/java/pl/project13/core/log/MessageFormatter.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -261,19 +261,11 @@ static boolean isEscapedDelimeter(String messagePattern, int delimeterStartIndex
261261
return false;
262262
}
263263
char potentialEscape = messagePattern.charAt(delimeterStartIndex - 1);
264-
if (potentialEscape == ESCAPE_CHAR) {
265-
return true;
266-
} else {
267-
return false;
268-
}
264+
return (potentialEscape == ESCAPE_CHAR);
269265
}
270266

271267
static boolean isDoubleEscaped(String messagePattern, int delimeterStartIndex) {
272-
if (delimeterStartIndex >= 2 && messagePattern.charAt(delimeterStartIndex - 2) == ESCAPE_CHAR) {
273-
return true;
274-
} else {
275-
return false;
276-
}
268+
return (delimeterStartIndex >= 2 && messagePattern.charAt(delimeterStartIndex - 2) == ESCAPE_CHAR);
277269
}
278270

279271
// special treatment of array values was suggested by 'lizongbo'

0 commit comments

Comments
 (0)