Skip to content

Commit 1607421

Browse files
authored
Enabled LocalFinalVariableName in Checkstyle (#5172)
1 parent 8be8b95 commit 1607421

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

checkstyle.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
<!-- Checks for Naming Conventions. -->
110110
<!-- See https://checkstyle.org/checks/naming/index.html -->
111111
<module name="ConstantName"/>
112-
<!-- TODO <module name="LocalFinalVariableName"/> -->
112+
<module name="LocalFinalVariableName"/>
113113
<!-- TODO <module name="LocalVariableName"/> -->
114114
<!-- TODO <module name="MemberName"/> -->
115115
<!-- TODO <module name="MethodName"/> -->

src/main/java/com/thealgorithms/maths/DudeneyNumber.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ public static boolean isDudeney(final int n) {
1616
throw new IllegalArgumentException("Input must me positive.");
1717
}
1818
// Calculating Cube Root
19-
final int cube_root = (int) Math.round(Math.pow(n, 1.0 / 3.0));
19+
final int cubeRoot = (int) Math.round(Math.pow(n, 1.0 / 3.0));
2020
// If the number is not a perfect cube the method returns false.
21-
if (cube_root * cube_root * cube_root != n) {
21+
if (cubeRoot * cubeRoot * cubeRoot != n) {
2222
return false;
2323
}
2424

2525
// If the cube root of the number is not equal to the sum of its digits, we return false.
26-
return cube_root == SumOfDigits.sumOfDigits(n);
26+
return cubeRoot == SumOfDigits.sumOfDigits(n);
2727
}
2828
}

src/main/java/com/thealgorithms/sorts/SimpleSort.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ public class SimpleSort implements SortAlgorithm {
44

55
@Override
66
public <T extends Comparable<T>> T[] sort(T[] array) {
7-
final int LENGTH = array.length;
7+
final int length = array.length;
88

9-
for (int i = 0; i < LENGTH; i++) {
10-
for (int j = i + 1; j < LENGTH; j++) {
9+
for (int i = 0; i < length; i++) {
10+
for (int j = i + 1; j < length; j++) {
1111
if (SortUtils.less(array[j], array[i])) {
1212
T element = array[j];
1313
array[j] = array[i];

0 commit comments

Comments
 (0)