Skip to content

Commit 96e59e0

Browse files
authored
style: include DLS_DEAD_LOCAL_STORE (#5276)
1 parent 26b4b82 commit 96e59e0

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

spotbugs-exclude.xml

-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@
6565
<Match>
6666
<Bug pattern="UWF_UNWRITTEN_FIELD" />
6767
</Match>
68-
<Match>
69-
<Bug pattern="DLS_DEAD_LOCAL_STORE" />
70-
</Match>
7168
<Match>
7269
<Bug pattern="UWF_NULL_FIELD" />
7370
</Match>

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ private Gaussian() {
77
}
88

99
public static ArrayList<Double> gaussian(int matSize, ArrayList<Double> matrix) {
10-
ArrayList<Double> answerArray = new ArrayList<Double>();
1110
int i;
1211
int j = 0;
1312

@@ -22,8 +21,7 @@ public static ArrayList<Double> gaussian(int matSize, ArrayList<Double> matrix)
2221
}
2322

2423
mat = gaussianElimination(matSize, i, mat);
25-
answerArray = valueOfGaussian(matSize, x, mat);
26-
return answerArray;
24+
return valueOfGaussian(matSize, x, mat);
2725
}
2826

2927
// Perform Gaussian elimination

src/test/java/com/thealgorithms/maths/GaussianTest.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public class GaussianTest {
1212
@Test
1313
void passTest1() {
1414
ArrayList<Double> list = new ArrayList<Double>();
15-
ArrayList<Double> gaussian = new ArrayList<Double>();
1615
ArrayList<Double> answer = new ArrayList<Double>();
1716
answer.add(0.0);
1817
answer.add(1.0);
@@ -24,8 +23,7 @@ void passTest1() {
2423
list.add(2.0);
2524
list.add(1.0);
2625
list.add(1.0);
27-
gaussian = gaussian(matrixSize, list);
2826

29-
assertEquals(answer, gaussian);
27+
assertEquals(answer, gaussian(matrixSize, list));
3028
}
3129
}

0 commit comments

Comments
 (0)