Skip to content

Commit

Permalink
style: enable FinalClass in checkstyle (#5154)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodaBlurd committed May 11, 2024
1 parent 52f15b2 commit bbe4a02
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion checkstyle.xml
Expand Up @@ -174,7 +174,7 @@
<!-- Checks for class design -->
<!-- See https://checkstyle.org/checks/design/index.html -->
<!-- TODO <module name="DesignForExtension"/> -->
<!-- TODO <module name="FinalClass"/> -->
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<!-- TODO <module name="VisibilityModifier"/> -->
Expand Down
Expand Up @@ -13,7 +13,7 @@ public class Bag<Element> implements Iterable<Element> {
private Node<Element> firstElement; // first element of the bag
private int size; // size of bag

private static class Node<Element> {
private static final class Node<Element> {

private Element content;
private Node<Element> nextElement;
Expand Down
Expand Up @@ -153,7 +153,7 @@ public Iterator<E> iterator() {
return new DynamicArrayIterator();
}

private class DynamicArrayIterator implements Iterator<E> {
private final class DynamicArrayIterator implements Iterator<E> {

private int cursor;

Expand Down
Expand Up @@ -17,7 +17,7 @@ public final class WelshPowell {
private WelshPowell() {
}

static class Graph {
static final class Graph {
private HashSet<Integer>[] adjacencyLists;

private Graph(int vertices) {
Expand Down
Expand Up @@ -12,7 +12,7 @@
import java.util.List;
import java.util.Map;

public class Intersection {
public final class Intersection {

public static List<Integer> intersection(int[] arr1, int[] arr2) {
if (arr1 == null || arr2 == null || arr1.length == 0 || arr2.length == 0) {
Expand Down
Expand Up @@ -13,7 +13,7 @@
*/

public class LeftistHeap {
private class Node {
private final class Node {
private int element, npl;
private Node left, right;

Expand Down
Expand Up @@ -2,7 +2,7 @@

public class CircleLinkedList<E> {

private static class Node<E> {
private static final class Node<E> {

Node<E> next;
E value;
Expand Down
Expand Up @@ -43,7 +43,7 @@ Node mergeKList(Node[] a, int N) {
return head;
}

private class Node {
private final class Node {

private int data;
private Node next;
Expand Down
Expand Up @@ -16,7 +16,7 @@
*/
public class GenericTree {

private static class Node {
private static final class Node {

int data;
ArrayList<Node> child = new ArrayList<>();
Expand Down
Expand Up @@ -26,7 +26,7 @@ the inOrder() method to store the values in the arraylist, then find the size of

public class TreeRandomNode {

private class Node {
private final class Node {

int item;
Node left, right;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/thealgorithms/geometry/GrahamScan.java
Expand Up @@ -126,7 +126,7 @@ public Comparator<Point> polarOrder() {
return new PolarOrder();
}

private class PolarOrder implements Comparator<Point> {
private final class PolarOrder implements Comparator<Point> {
public int compare(Point p1, Point p2) {
int dx1 = p1.x - x;
int dy1 = p1.y - y;
Expand Down
Expand Up @@ -6,7 +6,7 @@
*/
import java.util.Scanner;

class Rotate_by_90_degrees {
final class Rotate_by_90_degrees {
private Rotate_by_90_degrees() {
}

Expand Down

0 comments on commit bbe4a02

Please sign in to comment.