public CommitOrderDependencyNode nodeFor(ClassDescriptor d) {
   for (Enumeration e = nodes.elements(); e.hasMoreElements(); ) {
     CommitOrderDependencyNode n = (CommitOrderDependencyNode) e.nextElement();
     if (n.getDescriptor() == d) {
       return n;
     }
   }
   return null;
 }
  /**
   * Calculate the commit order. Do a depth first search on the graph, skipping nodes that we have
   * already visited or are in the process of visiting. Keep a counter and note when we first
   * encounter a node and when we finish visiting it. Once we've visited everything, sort nodes by
   * finishing time
   */
  public void orderCommits() {
    depthFirstSearch();

    Object[] nodeArray = new Object[nodes.size()];
    nodes.copyInto(nodeArray);

    quicksort(nodeArray);
    Vector result = new Vector(nodes.size());
    for (int i = 0; i < nodes.size(); i++) {
      CommitOrderDependencyNode node = (CommitOrderDependencyNode) nodeArray[i];
      result.addElement(node.getDescriptor());
    }
    this.orderedDescriptors = result;
  }