diff --git a/azure-client-runtime/src/main/java/com/microsoft/azure/DAGraph.java b/azure-client-runtime/src/main/java/com/microsoft/azure/DAGraph.java index df3ba483f6787..153c38f2592a3 100644 --- a/azure-client-runtime/src/main/java/com/microsoft/azure/DAGraph.java +++ b/azure-client-runtime/src/main/java/com/microsoft/azure/DAGraph.java @@ -167,9 +167,8 @@ public void visitNode(U node) { } @Override - public void visitEdge(String fromKey, String toKey, GraphEdgeType edgeType) { - System.out.println("{" + fromKey + ", " + toKey + "} " + edgeType); - if (edgeType == GraphEdgeType.BACK) { + public void visitEdge(String fromKey, String toKey, EdgeType edgeType) { + if (edgeType == EdgeType.BACK) { throw new IllegalStateException("Detected circular dependency: " + findPath(fromKey, toKey)); } } diff --git a/azure-client-runtime/src/main/java/com/microsoft/azure/Graph.java b/azure-client-runtime/src/main/java/com/microsoft/azure/Graph.java index 17440ddbeb193..89087dd6d3580 100644 --- a/azure-client-runtime/src/main/java/com/microsoft/azure/Graph.java +++ b/azure-client-runtime/src/main/java/com/microsoft/azure/Graph.java @@ -12,16 +12,6 @@ import java.util.Map; import java.util.Set; -/** - * The edge types in a graph. - */ -enum GraphEdgeType { - TREE, - FORWARD, - BACK, - CROSS -} - /** * Type representing a directed graph data structure. *
@@ -61,30 +51,6 @@ public void addNode(U node) { graph.put(node.key(), node); } - /** - * Represents a visitor to be implemented by the consumer who want to visit the - * graph's nodes in DFS order. - * - * @param the type of the node - */ - interface Visitor { - /** - * visit a node. - * - * @param node the node to visited - */ - void visitNode(U node); - - /** - * visit an edge. - * - * @param fromKey key of the from node - * @param toKey key of the to node - * @param graphEdgeType the edge type - */ - void visitEdge(String fromKey, String toKey, GraphEdgeType graphEdgeType); - } - /** * Perform DFS visit in this graph. *
@@ -128,22 +94,22 @@ private void dfs(Visitor visitor, Node