Skip to content

Commit 9c96d8f

Browse files
authored
Merge branch 'master' into enable_NeedBraces
2 parents f801bfa + 31db1af commit 9c96d8f

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

checkstyle.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
<!-- TODO <module name="NoWhitespaceAfter"/> -->
141141
<module name="NoWhitespaceBefore"/>
142142
<module name="OperatorWrap"/>
143-
<!-- TODO <module name="ParenPad"/> -->
143+
<module name="ParenPad"/>
144144
<module name="TypecastParenPad"/>
145145
<module name="WhitespaceAfter"/>
146146
<!-- TODO <module name="WhitespaceAround"/> -->

spotbugs-exclude.xml

-3
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,6 @@
222222
<Match>
223223
<Bug pattern="IMC_IMMATURE_CLASS_BAD_SERIALVERSIONUID" />
224224
</Match>
225-
<Match>
226-
<Bug pattern="SUI_CONTAINS_BEFORE_ADD" />
227-
</Match>
228225
<Match>
229226
<Bug pattern="DRE_DECLARED_RUNTIME_EXCEPTION" />
230227
</Match>

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ public static void main(String[] args) {
5757
obj.go();
5858
}
5959

60-
public void go() { // shows distance to all vertices // Interactive run for understanding the
61-
try ( // class first time. Assumes source vertex is 0 and
62-
Scanner sc = new Scanner(System.in)) {
60+
public void go() {
61+
// shows distance to all vertices
62+
// Interactive run for understanding the
63+
// class first time. Assumes source vertex is 0 and
64+
try (Scanner sc = new Scanner(System.in)) {
6365
int i;
6466
int v;
6567
int e;

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ public int countGraphs() {
8181
Set<Node> markedNodes = new HashSet<Node>();
8282

8383
for (Node n : nodeList) {
84-
if (!markedNodes.contains(n)) {
85-
markedNodes.add(n);
84+
if (markedNodes.add(n)) {
8685
markedNodes.addAll(depthFirstSearch(n, new ArrayList<Node>()));
8786
count++;
8887
}

0 commit comments

Comments
 (0)