Skip to content

Commit 76488fb

Browse files
committed
Fix bug in missing call edge
Signed-off-by: Rahul Krishna <[email protected]>
1 parent 677ce82 commit 76488fb

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/main/java/com/ibm/northstar/SystemDependencyGraph.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,11 @@ private static org.jgrapht.Graph<Pair<String, Callable>, AbstractGraphEdge> buil
174174

175175
// Get the edge between the source and the target
176176
AbstractGraphEdge cgEdge = graph.getEdge(source, target);
177-
178-
if (cgEdge == null) {
177+
if (cgEdge instanceof CallEdge) {
178+
((CallEdge) cgEdge).incrementWeight();
179+
} else {
179180
graph.addEdge(source, target, new CallEdge());
180181
}
181-
// If edge exists, then increment the weight
182-
else {
183-
cgEdge.incrementWeight();
184-
}
185182
}
186183
});
187184
});

0 commit comments

Comments
 (0)