JAL-4134 fix more of the egregious SeqNode/BinaryNode casting
authorJames Procter <j.procter@dundee.ac.uk>
Mon, 27 Feb 2023 18:43:58 +0000 (18:43 +0000)
committerJames Procter <j.procter@dundee.ac.uk>
Mon, 27 Feb 2023 18:43:58 +0000 (18:43 +0000)
src/jalview/analysis/TreeModel.java

index 1725adc..dd56424 100644 (file)
@@ -20,7 +20,6 @@
  */
 package jalview.analysis;
 
-import jalview.bin.Cache;
 import jalview.datamodel.AlignmentView;
 import jalview.datamodel.BinaryNode;
 import jalview.datamodel.NodeTransformI;
@@ -81,7 +80,7 @@ public class TreeModel
   public TreeModel(SequenceI[] seqs, AlignmentView odata,
           NewickFile treefile)
   {
-    this(seqs, (SequenceNode) treefile.getTree(), treefile.HasDistances(),
+    this(seqs,  treefile.getTree(), treefile.HasDistances(),
             treefile.HasBootstrap(), treefile.HasRootDistance());
     seqData = odata;
 
@@ -95,7 +94,7 @@ public class TreeModel
    */
   public TreeModel(TreeBuilder tree)
   {
-    this(tree.getSequences(), (SequenceNode) tree.getTopNode(), tree.hasDistances(),
+    this(tree.getSequences(),  tree.getTopNode(), tree.hasDistances(),
             tree.hasBootstrap(), tree.hasRootDistance());
     seqData = tree.getOriginalData();
   }
@@ -109,7 +108,7 @@ public class TreeModel
    * @param hasBoot
    * @param hasRootDist
    */
-  public TreeModel(SequenceI[] seqs, SequenceNode root, boolean hasDist,
+  public TreeModel(SequenceI[] seqs, BinaryNode root, boolean hasDist,
           boolean hasBoot, boolean hasRootDist)
   {
     this.sequences = seqs;
@@ -333,8 +332,8 @@ public class TreeModel
        * TODO: Identify internal nodes... if (node.isSequenceLabel()) {
        * leaves.addElement(node); }
        */
-      findLeaves((SequenceNode) nd.left(), leaves);
-      findLeaves((SequenceNode) nd.right(), leaves);
+      findLeaves(nd.left(), leaves);
+      findLeaves(nd.right(), leaves);
     }
 
     return leaves;