Merge branch 'features/JAL-4071_visibleFeaturesCounter' into features/JAL-3417_sdppre...
[jalview.git] / src / jalview / io / NewickFile.java
index ec5d267..027390a 100755 (executable)
@@ -286,18 +286,17 @@ public class NewickFile extends FileParse
     String nodename = null;
     String commentString2 = null; // comments after simple node props
 
-    float DefDistance = (float) 0.001; // @param Default distance for a node -
+    double DefDistance = (float) 0.001; // @param Default distance for a node -
     // very very small
     int DefBootstrap = -1; // @param Default bootstrap for a node
 
-    float distance = DefDistance;
+    double distance = DefDistance;
     int bootstrap = DefBootstrap;
 
     boolean ascending = false; // flag indicating that we are leaving the
     // current node
 
-    Regex majorsyms = new Regex(
-            "[(\\['),;]");
+    Regex majorsyms = new Regex("[(\\['),;]");
 
     int nextcp = 0;
     int ncp = cp;
@@ -356,8 +355,7 @@ public class NewickFile extends FileParse
       // Deal with quoted fields
       case '\'':
 
-        Regex qnodename = new Regex(
-                "'([^']|'')+'");
+        Regex qnodename = new Regex("'([^']|'')+'");
 
         if (qnodename.searchFrom(nf, fcp))
         {
@@ -365,8 +363,7 @@ public class NewickFile extends FileParse
           nodename = new String(
                   qnodename.stringMatched().substring(1, nl - 1));
           // unpack any escaped colons
-          Regex xpandquotes = Regex
-                  .perlCode("s/''/'/");
+          Regex xpandquotes = Regex.perlCode("s/''/'/");
           String widernodename = xpandquotes.replaceAll(nodename);
           nodename = widernodename;
           // jump to after end of quoted nodename
@@ -400,8 +397,7 @@ public class NewickFile extends FileParse
            * '"+nf.substring(cp,fcp)+"'"); }
            */
           // verify termination.
-          Regex comment = new Regex(
-                  "]");
+          Regex comment = new Regex("]");
           if (comment.searchFrom(nf, fcp))
           {
             // Skip the comment field
@@ -432,12 +428,9 @@ public class NewickFile extends FileParse
                   + fstring.substring(cend + 1);
 
         }
-        Regex uqnodename = new Regex(
-                "\\b([^' :;\\](),]+)");
-        Regex nbootstrap = new Regex(
-                "\\s*([0-9+]+)\\s*:");
-        Regex ndist = new Regex(
-                ":([-0-9Ee.+]+)");
+        Regex uqnodename = new Regex("\\b([^' :;\\](),]+)");
+        Regex nbootstrap = new Regex("\\s*([0-9+]+)\\s*:");
+        Regex ndist = new Regex(":([-0-9Ee.+]+)");
 
         if (!parsednodename && uqnodename.search(fstring)
                 && ((uqnodename.matchedFrom(1) == 0) || (fstring
@@ -494,7 +487,7 @@ public class NewickFile extends FileParse
         {
           try
           {
-            distance = (Float.valueOf(ndist.stringMatched(1))).floatValue();
+            distance = (Double.valueOf(ndist.stringMatched(1))).floatValue();
             HasDistances = true;
             nodehasdistance = true;
           } catch (Exception e)