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: Release_2_11_1_1~13^2~4^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5128fde4a463fa4debafb17ff00c2252831bed17;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