JAL-629 All applications System.exits going through Jalview.exit
[jalview.git] / src / jalview / io / NewickFile.java
index 027390a..98978d0 100755 (executable)
 // TODO: Extended SequenceNodeI to hold parsed NHX strings
 package jalview.io;
 
-import java.util.Locale;
-
-import jalview.datamodel.SequenceNode;
-import jalview.util.MessageManager;
-
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
+import java.util.Locale;
 import java.util.StringTokenizer;
 
 import com.stevesoft.pat.Regex;
 
+import jalview.bin.Jalview;
+import jalview.datamodel.SequenceNode;
+import jalview.util.MessageManager;
+
 /**
  * Parse a new hanpshire style tree Caveats: NHX files are NOT supported and the
  * tree distances and topology are unreliable when they are parsed. TODO: on
@@ -487,7 +487,8 @@ public class NewickFile extends FileParse
         {
           try
           {
-            distance = (Double.valueOf(ndist.stringMatched(1))).floatValue();
+            distance = (Double.valueOf(ndist.stringMatched(1)))
+                    .floatValue();
             HasDistances = true;
             nodehasdistance = true;
           } catch (Exception e)
@@ -944,9 +945,8 @@ public class NewickFile extends FileParse
     {
       if (args == null || args.length != 1)
       {
-        System.err.println(
-                "Takes one argument - file name of a newick tree file.");
-        System.exit(0);
+        Jalview.exit(
+                "Takes one argument - file name of a newick tree file.", 0);
       }
 
       File fn = new File(args[0]);