You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the javadoc, the hasEdgeConnecting method is equivalent to nodes().contains(nodeU) && successors(nodeU).contains(nodeV).
But, unlike this expression, it throws an exception if the nodes are unknown.
Here is a simple demonstration
importcom.google.common.graph.MutableNetwork;
importcom.google.common.graph.NetworkBuilder;
publicclassBug {
publicstaticvoidmain(String[] args) {
finalMutableNetwork<String, String> graph = NetworkBuilder.undirected().allowsParallelEdges(false).build();
// Foolowing line prints falseSystem.out.println(graph.nodes().contains("1") && graph.successors("1").contains("2"));
// Next should print false but throws an IllegalArgumentExceptionSystem.out.println(graph.hasEdgeConnecting("1", "2"));
}
}