style: enable AvoidNestedBlocks in checkstyle (#5228)

* enable style AvoidNestedBlocks

* refactor after enable style AvoidNestedBlocks

* fix clang

* fix checkstyle

* fix pmd

---------

Co-authored-by: Samuel Facchinello <samuel.facchinello@piksel.com>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
This commit is contained in:
Samuel Facchinello
2024-06-14 16:57:30 +02:00
committed by GitHub
parent 87b17e0571
commit cdb3affdd9
7 changed files with 117 additions and 117 deletions

View File

@ -33,28 +33,27 @@ public final class Sort012D {
int temp;
while (mid <= h) {
switch (a[mid]) {
case 0: {
case 0:
temp = a[l];
a[l] = a[mid];
a[mid] = temp;
l++;
mid++;
break;
}
case 1:
mid++;
break;
case 2: {
case 2:
temp = a[mid];
a[mid] = a[h];
a[h] = temp;
h--;
break;
}
default: {
default:
throw new IllegalArgumentException("Unexpected value: " + a[mid]);
}
}
}
System.out.println("the Sorted array is ");
for (int i = 0; i < a.length; i++) {