private int dfsMatch( BaseNode a, BranchNode b, int count, Vector stopNodes ) { if( stopNodes != null ) {  addMatching( b, a ); } boolean childrenMatch = true; if( a.getChildCount() == b.getChildCount() ) {  for( int i=0; childrenMatch && i<a.getChildCount(); i ++ ) { childrenMatch = a.getChild(i).getContent().contentEquals(b.getChild(i).getContent()); if( !childrenMatch ) {  double distance = measure.getDistance( a.getChild(i), b.getChild(i) ); childrenMatch =  distance < DFS_MATCH_THRESHOLD; } } } else childrenMatch = false;  if( !childrenMatch ) {  for( int i=0; stopNodes!=null && i<b.getChildCount(); i ++ ) stopNodes.add( b.getChild(i) ); } else {  for( int i=0; i<a.getChildCount(); i ++ ) count += dfsMatch( a.getChild(i), b.getChild(i), 0, stopNodes ); } return count + 1;
protected int dfsMatch( BaseNode a, BranchNode b, int count ) { return dfsMatch(a,b,count,null,null);
  private int dfsMatch( BaseNode a, BranchNode b, int count, Vector stopNodes ) {    if( stopNodes != null ) {      // Also means matchings should be added      addMatching( b, a );    }    boolean childrenMatch = true;    if( a.getChildCount() == b.getChildCount() ) {      // Only match children, if there are equally many      for( int i=0; childrenMatch && i<a.getChildCount(); i ++ ) {        childrenMatch = a.getChild(i).getContent().contentEquals(b.getChild(i).getContent());        if( !childrenMatch ) {          // Try fuzzy mathcing          double distance = measure.getDistance( a.getChild(i), b.getChild(i) );          childrenMatch =  distance < DFS_MATCH_THRESHOLD;        }      }    } else      childrenMatch = false;    if( !childrenMatch ) {      // Mark all children as stopnodes      for( int i=0; stopNodes!=null && i<b.getChildCount(); i ++ )        stopNodes.add( b.getChild(i) );    } else {      // All children match      for( int i=0; i<a.getChildCount(); i ++ )        count += dfsMatch( a.getChild(i), b.getChild(i), 0, stopNodes );    }    return count + 1;  }