refactoring
[jalview.git] / forester / java / src / org / forester / application / sdi_dir.java
index bc91edb..d1bcbce 100644 (file)
@@ -39,6 +39,7 @@ import org.forester.phylogeny.Phylogeny;
 import org.forester.phylogeny.PhylogenyMethods;
 import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
 import org.forester.phylogeny.factories.PhylogenyFactory;
+import org.forester.sdi.SDIException;
 import org.forester.sdi.SDIR;
 import org.forester.sdi.SDIse;
 import org.forester.util.ForesterUtil;
@@ -144,6 +145,7 @@ public class sdi_dir {
      *            set to true, then out of the resulting trees with minimal
      *            mapping cost or minimal number of duplications the tree with
      *            the minimal height is chosen
+     * @throws SDIException 
      */
     public static void infer( final File indir,
                               final File species_tree_file,
@@ -153,7 +155,7 @@ public class sdi_dir {
                               final boolean write_trees,
                               final boolean minimize_mapping_cost,
                               boolean minimize_sum_of_dup,
-                              final boolean minimize_height ) throws IOException {
+                              final boolean minimize_height ) throws IOException, SDIException {
         final int MIN_EXT_NODES = 4; // Minimal size of trees [in ext nodes]
         // to be analyzed.
         final int MAX_EXT_NODES = 5000; // Maximal size of trees [in ext nodes]
@@ -209,8 +211,8 @@ public class sdi_dir {
         suffix = suffix.trim();
         out = new PrintWriter( new FileWriter( outfile ), true );
         //nodecount0 = PhylogenyNode.getNodeCount();
-        for( int i = 0; i < filenames.length; ++i ) {
-            filename = filenames[ i ];
+        for( final String filename2 : filenames ) {
+            filename = filename2;
             if ( ( suffix.length() < 1 ) || filename.endsWith( suffix ) ) {
                 final File gene_tree_file = new File( indir.getPath(), filename );
                 if ( gene_tree_file.exists() && gene_tree_file.isFile() ) {
@@ -283,7 +285,7 @@ public class sdi_dir {
                         }
                         out.println();
                         if ( write_trees ) {
-                            outtree = new File( outdir, new File( filenames[ i ] ).getName() );
+                            outtree = new File( outdir, new File( filename2 ).getName() );
                             final PhylogenyWriter writer = new PhylogenyWriter();
                             writer.toPhyloXML( outtree, trees[ 0 ], 1 );
                         }