JAL-3691 Changed .toUppoerCase().startsWith(...) to .regionMatches(true,...) as upper...
authorBen Soares <b.soares@dundee.ac.uk>
Wed, 5 Aug 2020 21:57:13 +0000 (22:57 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Wed, 5 Aug 2020 21:57:13 +0000 (22:57 +0100)
src/jalview/io/ScoreMatrixFile.java

index 0b70dce..ee7503d 100644 (file)
  */
 package jalview.io;
 
+import java.io.IOException;
+import java.util.StringTokenizer;
+
 import jalview.analysis.scoremodels.ScoreMatrix;
 import jalview.analysis.scoremodels.ScoreModels;
 import jalview.datamodel.SequenceI;
 
-import java.io.IOException;
-import java.util.StringTokenizer;
-
 /**
  * A class that can parse a file containing a substitution matrix and register
  * it for use in Jalview
@@ -131,7 +131,8 @@ public class ScoreMatrixFile extends AlignFile
       {
         continue;
       }
-      if (data.toUpperCase().startsWith(SCOREMATRIX))
+      // equivalent to data.startsWithIgnoreCase(SCOREMATRIX)
+      if (data.regionMatches(true, 0, SCOREMATRIX, 0, SCOREMATRIX.length()))
       {
         /*
          * Parse name from ScoreMatrix <name>