style: include SUI_CONTAINS_BEFORE_ADD
(#5216)
This commit is contained in:
parent
a2af09cdfb
commit
31db1af345
@ -222,9 +222,6 @@
|
||||
<Match>
|
||||
<Bug pattern="IMC_IMMATURE_CLASS_BAD_SERIALVERSIONUID" />
|
||||
</Match>
|
||||
<Match>
|
||||
<Bug pattern="SUI_CONTAINS_BEFORE_ADD" />
|
||||
</Match>
|
||||
<Match>
|
||||
<Bug pattern="DRE_DECLARED_RUNTIME_EXCEPTION" />
|
||||
</Match>
|
||||
|
@ -81,8 +81,7 @@ class Graph<E extends Comparable<E>> {
|
||||
Set<Node> markedNodes = new HashSet<Node>();
|
||||
|
||||
for (Node n : nodeList) {
|
||||
if (!markedNodes.contains(n)) {
|
||||
markedNodes.add(n);
|
||||
if (markedNodes.add(n)) {
|
||||
markedNodes.addAll(depthFirstSearch(n, new ArrayList<Node>()));
|
||||
count++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user