"rio" work
[jalview.git] / forester / java / src / org / forester / phylogeny / PhylogenyMethods.java
index 67e9b52..f839fd6 100644 (file)
@@ -159,6 +159,12 @@ public class PhylogenyMethods {
      * @return LCA of node1 and node2
      */
     public final static PhylogenyNode calculateLCA( PhylogenyNode node1, PhylogenyNode node2 ) {
+        if ( node1 == null ) {
+            throw new IllegalArgumentException( "first argument (node) is null" );
+        }
+        if ( node2 == null ) {
+            throw new IllegalArgumentException( "second argument (node) is null" );
+        }
         if ( node1 == node2 ) {
             return node1;
         }
@@ -211,6 +217,12 @@ public class PhylogenyMethods {
      * @return LCA of node1 and node2
      */
     public final static PhylogenyNode calculateLCAonTreeWithIdsInPreOrder( PhylogenyNode node1, PhylogenyNode node2 ) {
+        if ( node1 == null ) {
+            throw new IllegalArgumentException( "first argument (node) is null" );
+        }
+        if ( node2 == null ) {
+            throw new IllegalArgumentException( "second argument (node) is null" );
+        }
         while ( node1 != node2 ) {
             if ( node1.getId() > node2.getId() ) {
                 node1 = node1.getParent();
@@ -1692,10 +1704,6 @@ public class PhylogenyMethods {
         TAXONOMY_ID;
     }
 
-    public static enum TAXONOMY_EXTRACTION {
-        NO, YES, PFAM_STYLE_ONLY;
-    }
-
     public static enum DESCENDANT_SORT_PRIORITY {
         TAXONOMY, SEQUENCE, NODE_NAME;
     }