// Path: src/treecmp/common/TreeCmpException.java
// public class TreeCmpException extends Exception {
// 
//   private String errMsg;
// //----------------------------------------------
// // Default constructor - initializes instance variable to unknown
//   public TreeCmpException()
//   {
//     super();             // call superclass constructor
//     errMsg = "unknown";
//   }
// 
// //-----------------------------------------------
// // Constructor receives some kind of message that is saved in an instance variable.
//   public TreeCmpException(String errMsg)
//   {
//     super(errMsg);     // call super class constructor
//     this.errMsg = errMsg;  // save message
//   }
// 
// //------------------------------------------------
// // public method, callable by exception catcher. It returns the error message.
//   public String getError()
//   {
//     return errMsg;
//   }
// }


import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import pal.io.InputSource;
import pal.tree.ReadTree;
import pal.tree.SimpleTree;
import pal.tree.TreeParseException;
import treecmp.common.TreeCmpException;
import treecmp.metric.*;
import pal.tree.Tree;
                bestDist = Double.POSITIVE_INFINITY;
                tempDist = 0;
                sprDist++;
                for (int i = 0; i < treeList.length; i++) {
                    tempTree = treeList[i];
                    tempDist = m.getDistance(tempTree, t2);
                    if (tempDist < bestDist) {
                        bestDist = tempDist;
                        bestTree = tempTree;
                    }
                }
                //todo:poprawić
                // zapisuję do stringu i odczytuje bo inaczej powstają błędy
                // w postaci wierzchołków wewnętrznych stopnia 1
                {
                    String bestTreeString = bestTree.toString();
                    InputSource is = InputSource.openString(bestTreeString);
                    currentStepTree = new ReadTree(is);
                    is.close();
                }

                bestDist1 = bestDist2;
                bestDist2 = bestDist;
                if (bestDist1 <= bestDist2) {
                    return Double.POSITIVE_INFINITY;
                }

            } while (bestDist != 0);

            dist = (double) sprDist;
// Path: src/treecmp/common/TreeCmpException.java
// public class TreeCmpException extends Exception {
// 
//   private String errMsg;
// //----------------------------------------------
// // Default constructor - initializes instance variable to unknown
//   public TreeCmpException()
//   {
//     super();             // call superclass constructor
//     errMsg = "unknown";
//   }
// 
// //-----------------------------------------------
// // Constructor receives some kind of message that is saved in an instance variable.
//   public TreeCmpException(String errMsg)
//   {
//     super(errMsg);     // call super class constructor
//     this.errMsg = errMsg;  // save message
//   }
// 
// //------------------------------------------------
// // public method, callable by exception catcher. It returns the error message.
//   public String getError()
//   {
//     return errMsg;
//   }
// }


// Path: src/treecmp/spr/UsprHeuristicBaseMetric.java
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import pal.io.InputSource;
import pal.tree.ReadTree;
import pal.tree.SimpleTree;
import pal.tree.TreeParseException;
import treecmp.common.TreeCmpException;
import treecmp.metric.*;
import pal.tree.Tree;

                bestDist = Double.POSITIVE_INFINITY;
                tempDist = 0;
                sprDist++;
                for (int i = 0; i < treeList.length; i++) {
                    tempTree = treeList[i];
                    tempDist = m.getDistance(tempTree, t2);
                    if (tempDist < bestDist) {
                        bestDist = tempDist;
                        bestTree = tempTree;
                    }
                }
                //todo:poprawić
                // zapisuję do stringu i odczytuje bo inaczej powstają błędy
                // w postaci wierzchołków wewnętrznych stopnia 1
                {
                    String bestTreeString = bestTree.toString();
                    InputSource is = InputSource.openString(bestTreeString);
                    currentStepTree = new ReadTree(is);
                    is.close();
                }

                bestDist1 = bestDist2;
                bestDist2 = bestDist;
                if (bestDist1 <= bestDist2) {
                    return Double.POSITIVE_INFINITY;
                }

            } while (bestDist != 0);

            dist = (double) sprDist;
        } catch (TreeCmpException ex) {