Skip to content

style: resolve some FCBL_FIELD_COULD_BE_LOCAL warnings #5764

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

Merged
merged 2 commits into from
Oct 13, 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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
class Cycle {

private final int nodes;
private final int edges;
private int[][] adjacencyMatrix;
private boolean[] visited;
ArrayList<ArrayList<Integer>> cycles = new ArrayList<ArrayList<Integer>>();
Expand All @@ -16,7 +15,7 @@ class Cycle {
System.out.print("Enter the no. of nodes: ");
nodes = in.nextInt();
System.out.print("Enter the no. of Edges: ");
edges = in.nextInt();
final int edges = in.nextInt();

adjacencyMatrix = new int[nodes][nodes];
visited = new boolean[nodes];
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/com/thealgorithms/others/CRCAlgorithm.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public class CRCAlgorithm {

private ArrayList<Integer> message;

private ArrayList<Integer> dividedMessage;

private ArrayList<Integer> p;

private Random randomGenerator;
Expand All @@ -44,7 +42,6 @@ public CRCAlgorithm(String str, int size, double ber) {
messageChanged = false;
message = new ArrayList<>();
messSize = size;
dividedMessage = new ArrayList<>();
p = new ArrayList<>();
for (int i = 0; i < str.length(); i++) {
p.add(Character.getNumericValue(str.charAt(i)));
Expand Down Expand Up @@ -103,7 +100,6 @@ public int getCorrectMess() {
public void refactor() {
messageChanged = false;
message = new ArrayList<>();
dividedMessage = new ArrayList<>();
}

/**
Expand Down Expand Up @@ -156,7 +152,7 @@ public void divideMessageWithP(boolean check) {
}
}
}
dividedMessage = (ArrayList<Integer>) x.clone();
ArrayList<Integer> dividedMessage = (ArrayList<Integer>) x.clone();
if (!check) {
message.addAll(dividedMessage);
} else {
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/thealgorithms/sorts/LinkListSort.java
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,12 @@ static int count(Node head) {

class Task2 {

private int[] a;

public Node sortByHeapSort(Node head) {
if (head == null || head.next == null) {
return head;
}
int c = count(head);
a = new int[c];
int[] a = new int[c];
// Array of size c is created
int i = 0;
for (Node ptr = head; ptr != null; ptr = ptr.next) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
public class A5CipherTest {

private A5Cipher a5Cipher;
private BitSet sessionKey;
private BitSet frameCounter;

@BeforeEach
void setUp() {
// Initialize the session key and frame counter
sessionKey = BitSet.valueOf(new long[] {0b1010101010101010L});
frameCounter = BitSet.valueOf(new long[] {0b0000000000000001L});
final var sessionKey = BitSet.valueOf(new long[] {0b1010101010101010L});
final var frameCounter = BitSet.valueOf(new long[] {0b0000000000000001L});
a5Cipher = new A5Cipher(sessionKey, frameCounter);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
public class A5KeyStreamGeneratorTest {

private A5KeyStreamGenerator keyStreamGenerator;
private BitSet sessionKey;
private BitSet frameCounter;

@BeforeEach
void setUp() {
keyStreamGenerator = new A5KeyStreamGenerator();

// Initialize session key and frame counter for testing
sessionKey = BitSet.valueOf(new long[] {0b1010101010101010L}); // Example 16-bit key
final var sessionKey = BitSet.valueOf(new long[] {0b1010101010101010L}); // Example 16-bit key
frameCounter = BitSet.valueOf(new long[] {0b0000000000000001L}); // Example 16-bit frame counter
keyStreamGenerator.initialize(sessionKey, frameCounter);
}
Expand Down