Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: enable FinalClass in checkstyle #5154

Merged
merged 1 commit into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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