From: Ben Soares Date: Wed, 5 Aug 2020 21:57:13 +0000 (+0100) Subject: JAL-3691 Changed .toUppoerCase().startsWith(...) to .regionMatches(true,...) as upper... X-Git-Tag: Develop-2_11_2_0-d20201215~24^2~17 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=23ad471234d4095e80fcfb743c315a55ff745c33;p=jalview.git JAL-3691 Changed .toUppoerCase().startsWith(...) to .regionMatches(true,...) as upper-cased 'i' in Turkish is not 'I'. --- diff --git a/src/jalview/io/ScoreMatrixFile.java b/src/jalview/io/ScoreMatrixFile.java index 0b70dce..ee7503d 100644 --- a/src/jalview/io/ScoreMatrixFile.java +++ b/src/jalview/io/ScoreMatrixFile.java @@ -20,13 +20,13 @@ */ 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