Skip to content

Commit 8886e09

Browse files
authored
style: include OCP_OVERLY_CONCRETE_PARAMETER (#5833)
1 parent 3af4cfd commit 8886e09

28 files changed

+46
-33
lines changed

spotbugs-exclude.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@
8787
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
8888
</Match>
8989
<!-- fb-contrib -->
90-
<Match>
91-
<Bug pattern="OCP_OVERLY_CONCRETE_PARAMETER" />
92-
</Match>
9390
<Match>
9491
<Bug pattern="LSC_LITERAL_STRING_COMPARISON" />
9592
</Match>

src/main/java/com/thealgorithms/backtracking/CrosswordSolver.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.thealgorithms.backtracking;
22

33
import java.util.ArrayList;
4+
import java.util.Collection;
45
import java.util.List;
56

67
/**
@@ -95,7 +96,7 @@ public static void removeWord(char[][] puzzle, String word, int row, int col, bo
9596
* @param words The list of words to be placed.
9697
* @return true if the crossword is solved, false otherwise.
9798
*/
98-
public static boolean solveCrossword(char[][] puzzle, List<String> words) {
99+
public static boolean solveCrossword(char[][] puzzle, Collection<String> words) {
99100
// Create a mutable copy of the words list
100101
List<String> remainingWords = new ArrayList<>(words);
101102

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public int getEstimated() {
9494
}
9595

9696
// Initializes the graph with edges defined in the input data
97-
static void initializeGraph(Graph graph, ArrayList<Integer> data) {
97+
static void initializeGraph(Graph graph, List<Integer> data) {
9898
for (int i = 0; i < data.size(); i += 4) {
9999
graph.addEdge(new Edge(data.get(i), data.get(i + 1), data.get(i + 2)));
100100
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private EdmondsBlossomAlgorithm() {
3030
* @param vertexCount The number of vertices in the graph.
3131
* @return A list of matched pairs of vertices.
3232
*/
33-
public static List<int[]> maximumMatching(List<int[]> edges, int vertexCount) {
33+
public static List<int[]> maximumMatching(Iterable<int[]> edges, int vertexCount) {
3434
List<List<Integer>> graph = new ArrayList<>(vertexCount);
3535

3636
// Initialize each vertex's adjacency list.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.thealgorithms.datastructures.lists;
22

33
import java.util.ArrayList;
4+
import java.util.Collection;
45
import java.util.List;
56

67
/**
@@ -38,7 +39,7 @@ public static void main(String[] args) {
3839
* @param listB the second list to merge
3940
* @param listC the result list after merging
4041
*/
41-
public static void merge(List<Integer> listA, List<Integer> listB, List<Integer> listC) {
42+
public static void merge(List<Integer> listA, List<Integer> listB, Collection<Integer> listC) {
4243
int pa = 0;
4344
/* the index of listA */
4445
int pb = 0;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.thealgorithms.geometry;
22

33
import java.util.ArrayList;
4+
import java.util.Collection;
45
import java.util.Collections;
56
import java.util.Comparator;
67
import java.util.HashSet;
@@ -89,7 +90,7 @@ public static List<Point> convexHullRecursive(List<Point> points) {
8990
return result;
9091
}
9192

92-
private static void constructHull(List<Point> points, Point left, Point right, Set<Point> convexSet) {
93+
private static void constructHull(Collection<Point> points, Point left, Point right, Set<Point> convexSet) {
9394
if (!points.isEmpty()) {
9495
Point extremePoint = null;
9596
int extremePointDistance = Integer.MIN_VALUE;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.thealgorithms.maths;
22

33
import java.util.ArrayList;
4+
import java.util.Collection;
45

56
/**
67
* Class for circular convolution of two discrete signals using the convolution
@@ -19,7 +20,7 @@ private CircularConvolutionFFT() {
1920
* @param x The signal to be padded.
2021
* @param newSize The new size of the signal.
2122
*/
22-
private static void padding(ArrayList<FFT.Complex> x, int newSize) {
23+
private static void padding(Collection<FFT.Complex> x, int newSize) {
2324
if (x.size() < newSize) {
2425
int diff = newSize - x.size();
2526
for (int i = 0; i < diff; i++) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.thealgorithms.maths;
22

33
import java.util.ArrayList;
4+
import java.util.Collection;
45

56
/**
67
* Class for linear convolution of two discrete signals using the convolution
@@ -19,7 +20,7 @@ private ConvolutionFFT() {
1920
* @param x The signal to be padded.
2021
* @param newSize The new size of the signal.
2122
*/
22-
private static void padding(ArrayList<FFT.Complex> x, int newSize) {
23+
private static void padding(Collection<FFT.Complex> x, int newSize) {
2324
if (x.size() < newSize) {
2425
int diff = newSize - x.size();
2526
for (int i = 0; i < diff; i++) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.thealgorithms.maths;
22

33
import java.util.ArrayList;
4+
import java.util.Collection;
45
import java.util.Collections;
56

67
/**
@@ -274,7 +275,7 @@ private static int reverseBits(int num, int log2n) {
274275
*
275276
* @param x The ArrayList to be padded.
276277
*/
277-
private static void paddingPowerOfTwo(ArrayList<Complex> x) {
278+
private static void paddingPowerOfTwo(Collection<Complex> x) {
278279
int n = 1;
279280
int oldSize = x.size();
280281
while (n < oldSize) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.thealgorithms.maths;
22

33
import java.util.ArrayList;
4+
import java.util.List;
45

56
/**
67
* Class for calculating the Fast Fourier Transform (FFT) of a discrete signal
@@ -25,7 +26,7 @@ private FFTBluestein() {
2526
* IFFT of signal x.
2627
* @param inverse True if you want to find the inverse FFT.
2728
*/
28-
public static void fftBluestein(ArrayList<FFT.Complex> x, boolean inverse) {
29+
public static void fftBluestein(List<FFT.Complex> x, boolean inverse) {
2930
int n = x.size();
3031
int bnSize = 2 * n - 1;
3132
int direction = inverse ? -1 : 1;

0 commit comments

Comments
 (0)