X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FNewickFile.java;h=4a30d738923ff65be70374fce1439892946c2dee;hb=57738a1f3c19b1c3a00bd3ac5108f8cd0af32f99;hp=f3eaa45e2882fd08445dbbc85fbb8848bc46de6d;hpb=17e4ea278bc9a5fb280db1252ce78b7a295215f5;p=jalview.git diff --git a/src/jalview/io/NewickFile.java b/src/jalview/io/NewickFile.java index f3eaa45..4a30d73 100755 --- a/src/jalview/io/NewickFile.java +++ b/src/jalview/io/NewickFile.java @@ -26,6 +26,8 @@ // TODO: Extended SequenceNodeI to hold parsed NHX strings package jalview.io; +import java.util.Locale; + import jalview.datamodel.SequenceNode; import jalview.util.MessageManager; @@ -294,8 +296,7 @@ public class NewickFile extends FileParse 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; @@ -354,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)) { @@ -363,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 @@ -398,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 @@ -430,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 @@ -656,7 +651,7 @@ public class NewickFile extends FileParse try { // parse out code/value pairs - if (code.toLowerCase().equals("b")) + if (code.toLowerCase(Locale.ROOT).equals("b")) { int v = -1; Float iv = Float.valueOf(value);