Skip to content

Commit bbe4a02

Browse files
authored
style: enable FinalClass in checkstyle (#5154)
1 parent 52f15b2 commit bbe4a02

File tree

12 files changed

+12
-12
lines changed

12 files changed

+12
-12
lines changed

checkstyle.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
<!-- Checks for class design -->
175175
<!-- See https://checkstyle.org/checks/design/index.html -->
176176
<!-- TODO <module name="DesignForExtension"/> -->
177-
<!-- TODO <module name="FinalClass"/> -->
177+
<module name="FinalClass"/>
178178
<module name="HideUtilityClassConstructor"/>
179179
<module name="InterfaceIsType"/>
180180
<!-- TODO <module name="VisibilityModifier"/> -->

src/main/java/com/thealgorithms/datastructures/bags/Bag.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class Bag<Element> implements Iterable<Element> {
1313
private Node<Element> firstElement; // first element of the bag
1414
private int size; // size of bag
1515

16-
private static class Node<Element> {
16+
private static final class Node<Element> {
1717

1818
private Element content;
1919
private Node<Element> nextElement;

src/main/java/com/thealgorithms/datastructures/dynamicarray/DynamicArray.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public Iterator<E> iterator() {
153153
return new DynamicArrayIterator();
154154
}
155155

156-
private class DynamicArrayIterator implements Iterator<E> {
156+
private final class DynamicArrayIterator implements Iterator<E> {
157157

158158
private int cursor;
159159

src/main/java/com/thealgorithms/datastructures/graphs/WelshPowell.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public final class WelshPowell {
1717
private WelshPowell() {
1818
}
1919

20-
static class Graph {
20+
static final class Graph {
2121
private HashSet<Integer>[] adjacencyLists;
2222

2323
private Graph(int vertices) {

src/main/java/com/thealgorithms/datastructures/hashmap/hashing/Intersection.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import java.util.List;
1313
import java.util.Map;
1414

15-
public class Intersection {
15+
public final class Intersection {
1616

1717
public static List<Integer> intersection(int[] arr1, int[] arr2) {
1818
if (arr1 == null || arr2 == null || arr1.length == 0 || arr2.length == 0) {

src/main/java/com/thealgorithms/datastructures/heaps/LeftistHeap.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414

1515
public class LeftistHeap {
16-
private class Node {
16+
private final class Node {
1717
private int element, npl;
1818
private Node left, right;
1919

src/main/java/com/thealgorithms/datastructures/lists/CircleLinkedList.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
public class CircleLinkedList<E> {
44

5-
private static class Node<E> {
5+
private static final class Node<E> {
66

77
Node<E> next;
88
E value;

src/main/java/com/thealgorithms/datastructures/lists/Merge_K_SortedLinkedlist.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Node mergeKList(Node[] a, int N) {
4343
return head;
4444
}
4545

46-
private class Node {
46+
private final class Node {
4747

4848
private int data;
4949
private Node next;

src/main/java/com/thealgorithms/datastructures/trees/GenericTree.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
public class GenericTree {
1818

19-
private static class Node {
19+
private static final class Node {
2020

2121
int data;
2222
ArrayList<Node> child = new ArrayList<>();

src/main/java/com/thealgorithms/datastructures/trees/TreeRandomNode.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ the inOrder() method to store the values in the arraylist, then find the size of
2626

2727
public class TreeRandomNode {
2828

29-
private class Node {
29+
private final class Node {
3030

3131
int item;
3232
Node left, right;

src/main/java/com/thealgorithms/geometry/GrahamScan.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public Comparator<Point> polarOrder() {
126126
return new PolarOrder();
127127
}
128128

129-
private class PolarOrder implements Comparator<Point> {
129+
private final class PolarOrder implements Comparator<Point> {
130130
public int compare(Point p1, Point p2) {
131131
int dx1 = p1.x - x;
132132
int dy1 = p1.y - y;

src/main/java/com/thealgorithms/others/RotateMatrixBy90Degrees.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
import java.util.Scanner;
88

9-
class Rotate_by_90_degrees {
9+
final class Rotate_by_90_degrees {
1010
private Rotate_by_90_degrees() {
1111
}
1212

0 commit comments

Comments
 (0)