style: enable NeedBraces in checkstyle (#5227)

* enable style NeedBraces

* style: enable NeedBraces in checkstyle

---------

Co-authored-by: Samuel Facchinello <samuel.facchinello@piksel.com>
This commit is contained in:
Samuel Facchinello
2024-06-13 21:00:16 +02:00
committed by GitHub
parent 51fcc66345
commit 87b17e0571
68 changed files with 629 additions and 261 deletions

View File

@@ -5,7 +5,9 @@ final class ZigZagPattern {
}
public static String encode(String s, int numRows) {
if (numRows < 2 || s.length() < numRows) return s;
if (numRows < 2 || s.length() < numRows) {
return s;
}
int start = 0;
int index = 0;
int height = 1;
@@ -18,11 +20,11 @@ final class ZigZagPattern {
boolean bool = true;
while (pointer < s.length()) {
zigZagedArray[index++] = s.charAt(pointer);
if (heightSpace == 0)
if (heightSpace == 0) {
pointer += depthSpace;
else if (depthSpace == 0)
} else if (depthSpace == 0) {
pointer += heightSpace;
else if (bool) {
} else if (bool) {
pointer += depthSpace;
bool = false;
} else {