*/
package jalview.analysis;
+import java.util.Locale;
+
import jalview.analysis.scoremodels.PIDModel;
import jalview.analysis.scoremodels.ScoreMatrix;
import jalview.analysis.scoremodels.ScoreModels;
public AlignSeq(SequenceI s1, String string1, SequenceI s2,
String string2, String type)
{
- seqInit(s1, string1.toUpperCase(), s2, string2.toUpperCase(), type);
+ seqInit(s1, string1.toUpperCase(Locale.ROOT), s2, string2.toUpperCase(Locale.ROOT), type);
}
/**
*/
package jalview.analysis;
+import java.util.Locale;
+
import jalview.commands.RemoveGapColCommand;
import jalview.datamodel.AlignedCodon;
import jalview.datamodel.AlignedCodonFrame;
// TODO use Character.toLowerCase to avoid creating String objects?
char[] upstream = new String(ds
.getSequence(s.getStart() - 1 - ustream_ds, s.getStart() - 1))
- .toLowerCase().toCharArray();
+ .toLowerCase(Locale.ROOT).toCharArray();
char[] downstream = new String(
- ds.getSequence(s_end - 1, s_end + dstream_ds)).toLowerCase()
+ ds.getSequence(s_end - 1, s_end + dstream_ds)).toLowerCase(Locale.ROOT)
.toCharArray();
char[] coreseq = s.getSequence();
char[] nseq = new char[offset + upstream.length + downstream.length
if (cdnaLength != mappedLength && cdnaLength > 2)
{
String lastCodon = String.valueOf(cdnaSeqChars,
- cdnaLength - CODON_LENGTH, CODON_LENGTH).toUpperCase();
+ cdnaLength - CODON_LENGTH, CODON_LENGTH).toUpperCase(Locale.ROOT);
for (String stop : ResidueProperties.STOP_CODONS)
{
if (lastCodon.equals(stop))
*/
int startOffset = 0;
if (cdnaLength != mappedLength && cdnaLength > 2
- && String.valueOf(cdnaSeqChars, 0, CODON_LENGTH).toUpperCase()
+ && String.valueOf(cdnaSeqChars, 0, CODON_LENGTH).toUpperCase(Locale.ROOT)
.equals(ResidueProperties.START))
{
startOffset += CODON_LENGTH;
*/
package jalview.analysis;
+import java.util.Locale;
+
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceI;
{
return 1;
}
- return label1.toUpperCase().compareTo(label2.toUpperCase());
+ return label1.toUpperCase(Locale.ROOT).compareTo(label2.toUpperCase(Locale.ROOT));
}
/**
*/
package jalview.analysis;
+import java.util.Locale;
+
import jalview.analysis.scoremodels.ScoreMatrix;
import jalview.analysis.scoremodels.ScoreModels;
import jalview.datamodel.AlignmentAnnotation;
protected static void recordConservation(Map<String, Integer> resultMap,
String res)
{
- res = res.toUpperCase();
+ res = res.toUpperCase(Locale.ROOT);
for (Entry<String, Map<String, Integer>> property : ResidueProperties.propHash
.entrySet())
{
*/
package jalview.analysis;
+import java.util.Locale;
+
import jalview.api.AlignViewportI;
import jalview.api.FinderI;
import jalview.datamodel.AlignmentI;
idMatches = new ArrayList<>();
String searchString = matchCase ? theSearchString
- : theSearchString.toUpperCase();
+ : theSearchString.toUpperCase(Locale.ROOT);
Regex searchPattern = new Regex(searchString);
searchPattern.setIgnoreCase(!matchCase);
*/
package jalview.analysis;
+import java.util.Locale;
+
import jalview.bin.Cache;
import java.io.BufferedReader;
while (line != null)
{
line = readLine(dataIn);
- if (line != null && !"DNA".equals(line.toUpperCase()))
+ if (line != null && !"DNA".equals(line.toUpperCase(Locale.ROOT)))
{
String[] tokens = line.split("\\t");
if (tokens.length == 2)
{
- ambiguityCodes.put(tokens[0].toUpperCase(),
- tokens[1].toUpperCase());
+ ambiguityCodes.put(tokens[0].toUpperCase(Locale.ROOT),
+ tokens[1].toUpperCase(Locale.ROOT));
}
else
{
@Override
public String translateCanonical(String codon)
{
- return codons.get(codon.toUpperCase());
+ return codons.get(codon.toUpperCase(Locale.ROOT));
}
@Override
public String translate(String codon)
{
- String upper = codon.toUpperCase();
+ String upper = codon.toUpperCase(Locale.ROOT);
String peptide = translateCanonical(upper);
/*
*/
package jalview.analysis;
+import java.util.Locale;
+
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceI;
{
if (s != null)
{
- id = s.toLowerCase();
+ id = s.toLowerCase(Locale.ROOT);
}
else
{
{
if (s instanceof String)
{
- return this.stringequals(((String) s).toLowerCase());
+ return this.stringequals(((String) s).toLowerCase(Locale.ROOT));
}
}
package jalview.bin;
+import java.util.Locale;
+
import java.awt.HeadlessException;
public class HiDPISetting
static
{
String system = System.getProperty("os.name") == null ? null
- : System.getProperty("os.name").toLowerCase();
+ : System.getProperty("os.name").toLowerCase(Locale.ROOT);
if (system != null)
{
isLinux = system.indexOf("linux") > -1;
*/
package jalview.bin;
+import java.util.Locale;
+
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels())
{
if (info.getName() != null && nameStartsWith
- ? info.getName().toLowerCase()
- .startsWith(name.toLowerCase())
- : info.getName().toLowerCase().equals(name.toLowerCase()))
+ ? info.getName().toLowerCase(Locale.ROOT)
+ .startsWith(name.toLowerCase(Locale.ROOT))
+ : info.getName().toLowerCase(Locale.ROOT).equals(name.toLowerCase(Locale.ROOT)))
{
className = info.getClassName();
break;
System.setProperty("apple.laf.useScreenMenuBar", "true");
set = setQuaquaLookAndFeel();
if ((!set) || !UIManager.getLookAndFeel().getClass().toString()
- .toLowerCase().contains("quaqua"))
+ .toLowerCase(Locale.ROOT).contains("quaqua"))
{
set = setVaquaLookAndFeel();
}
*/
package jalview.bin;
+import java.util.Locale;
+
import jalview.analysis.AlignmentUtils;
import jalview.api.StructureSelectionManagerProvider;
import jalview.appletgui.AlignFrame;
final int pos = apos;
// use vamsas listener to broadcast to all listeners in scope
if (alignedPosition != null && (alignedPosition.trim().length() == 0
- || alignedPosition.toLowerCase().indexOf("false") > -1))
+ || alignedPosition.toLowerCase(Locale.ROOT).indexOf("false") > -1))
{
java.awt.EventQueue.invokeLater(new Runnable()
{
r--;
} catch (NumberFormatException ex)
{
- if (cl.toLowerCase().equals("sequence"))
+ if (cl.toLowerCase(Locale.ROOT).equals("sequence"))
{
// we are in the dataset sequence's coordinate frame.
inseqpos = true;
String externalsviewer = getParameter("externalstructureviewer");
if (externalsviewer != null)
{
- useXtrnalSviewer = externalsviewer.trim().toLowerCase().equals(TRUE);
+ useXtrnalSviewer = externalsviewer.trim().toLowerCase(Locale.ROOT).equals(TRUE);
}
/**
* if true disable the check for jmol
final String groups, boolean state)
{
final boolean st = state;// !(state==null || state.equals("") ||
- // state.toLowerCase().equals("false"));
+ // state.toLowerCase(Locale.ROOT).equals("false"));
java.awt.EventQueue.invokeLater(new Runnable()
{
@Override
*/
package jalview.bin;
+import java.util.Locale;
+
import java.io.File;
import java.io.IOException;
import java.lang.management.ManagementFactory;
process.waitFor();
} catch (IOException e)
{
- if (e.getMessage().toLowerCase().contains("memory"))
+ if (e.getMessage().toLowerCase(Locale.ROOT).contains("memory"))
{
System.out.println("Caught a memory exception: " + e.getMessage());
// Probably the "Cannot allocate memory" error, try without the memory
* @author bsoares
*
*/
+import java.util.Locale;
+
public class MemorySetting
{
public static final String MAX_HEAPSIZE_PERCENT_PROPERTY_NAME = "jvmmempc";
if (jvmmemmax != null && jvmmemmax.length() > 0)
{
long multiplier = 1;
- switch (jvmmemmax.toLowerCase().substring(jvmmemmax.length() - 1))
+ switch (jvmmemmax.toLowerCase(Locale.ROOT).substring(jvmmemmax.length() - 1))
{
case "t":
multiplier = 1099511627776L; // 2^40
*/
package jalview.commands;
+import java.util.Locale;
+
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceI;
if ((caseChange == TO_UPPER && doCommand)
|| (caseChange == TO_LOWER && !doCommand))
{
- newSeq.append(sequence.substring(start, end).toUpperCase());
+ newSeq.append(sequence.substring(start, end).toUpperCase(Locale.ROOT));
}
else if ((caseChange == TO_LOWER && doCommand)
|| (caseChange == TO_UPPER && !doCommand))
{
- newSeq.append(sequence.substring(start, end).toLowerCase());
+ newSeq.append(sequence.substring(start, end).toLowerCase(Locale.ROOT));
}
else
*/
package jalview.commands;
+import java.util.Locale;
+
import jalview.analysis.AlignSeq;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
String nogapold = AlignSeq.extractGaps(Comparison.GapChars,
new String(command.string[i]));
- if (!nogaprep.toLowerCase().equals(nogapold.toLowerCase()))
+ if (!nogaprep.toLowerCase(Locale.ROOT).equals(nogapold.toLowerCase(Locale.ROOT)))
{
// we may already have dataset and limits stashed...
if (newDSWasNeeded || newStartEndWasNeeded)
// old ds and edited ds are different, so
// create the new dataset sequence
SequenceI newds = new Sequence(oldds);
- newds.setSequence(fullseq.toUpperCase());
+ newds.setSequence(fullseq.toUpperCase(Locale.ROOT));
if (command.oldds == null)
{
// new
// start/end
String nogapalseq = AlignSeq.extractGaps(Comparison.GapChars,
- command.seqs[i].getSequenceAsString().toUpperCase());
+ command.seqs[i].getSequenceAsString().toUpperCase(Locale.ROOT));
int newStart = command.seqs[i].getDatasetSequence()
.getSequenceAsString().indexOf(nogapalseq);
if (newStart == -1)
*/
package jalview.datamodel;
+import java.util.Locale;
+
import jalview.analysis.Rna;
import jalview.analysis.SecStrConsensus.SimpleBP;
import jalview.analysis.WUSSParseException;
{
if (seqname && this.sequenceRef != null)
{
- int i = description.toLowerCase().indexOf("<html>");
+ int i = description.toLowerCase(Locale.ROOT).indexOf("<html>");
if (i > -1)
{
// move the html tag to before the sequence reference.
*/
package jalview.datamodel;
+import java.util.Locale;
+
import jalview.api.DBRefEntryI;
import jalview.util.DBRefUtils;
import jalview.util.MapList;
Mapping map,boolean isCanonical)
{
- this.source = source.toUpperCase();
+ this.source = source.toUpperCase(Locale.ROOT);
setVersion(version);
this.accessionId = accessionId;
this.map = map;
public void setAccessionId(String accessionId)
{
this.accessionId = accessionId;
-// this.accessionId = (accessionId == null ? "" : accessionId).toUpperCase();
+// this.accessionId = (accessionId == null ? "" : accessionId).toUpperCase(Locale.ROOT);
}
/**
{
this.source = source;
-// this.source = (source == null ? "" : source).toUpperCase();
+// this.source = (source == null ? "" : source).toUpperCase(Locale.ROOT);
// this.canonicalSourceName = DBRefUtils.getCanonicalName(this.source);
// this.sourceKey = DBRefSource.getSourceKey(this.canonicalSourceName);
}
public void setVersion(String version)
{
this.version = version;
- this.ucversion = (version == null ? null : version.toUpperCase());
+ this.ucversion = (version == null ? null : version.toUpperCase(Locale.ROOT));
}
@Override
* @author JimP
*
*/
+import java.util.Locale;
+
public class DBRefSource
{
public static final String UNIPROT = "UNIPROT";
- public static final String UP_NAME = "UNIPROT_NAME".toUpperCase();
+ public static final String UP_NAME = "UNIPROT_NAME".toUpperCase(Locale.ROOT);
/**
* Uniprot Knowledgebase/TrEMBL as served from EMBL protein products.
*/
- public static final String UNIPROTKB = "UniProtKB/TrEMBL".toUpperCase();
+ public static final String UNIPROTKB = "UniProtKB/TrEMBL".toUpperCase(Locale.ROOT);
public static final String ENSEMBL = "ENSEMBL";
public static final String ENSEMBLGENOMES = "ENSEMBLGENOMES";
public static final String EMBL = "EMBL";
public static final String EMBLCDS = "EMBLCDS";
- public static final String EMBLCDSProduct = "EMBLCDSProtein".toUpperCase();
+ public static final String EMBLCDSProduct = "EMBLCDSProtein".toUpperCase(Locale.ROOT);
public static final String PDB = "PDB";
public static final String PFAM = "PFAM";
public static final String RFAM = "RFAM";
- public static final String GENEDB = "GeneDB".toUpperCase();
+ public static final String GENEDB = "GeneDB".toUpperCase(Locale.ROOT);
public static final String PDB_CANONICAL_NAME = PDB;
// see if there is a primary reference that derived this reference.
for (int i = allSources.length; --i >= 0;)
{
- if (ucversion.startsWith(allSources[i])) // BH 2019.01.25 .toUpperCase() unnecessary here for allSources
+ if (ucversion.startsWith(allSources[i])) // BH 2019.01.25 .toUpperCase(Locale.ROOT) unnecessary here for allSources
{
// by convention, many secondary references inherit the primary
// reference's
*/
package jalview.datamodel;
+import java.util.Locale;
+
import java.util.HashSet;
import java.util.List;
import java.util.Set;
* e.g. C,G,T gives variants G and T for base C
*/
Set<String> variantPeptides = new HashSet<>();
- String[] alleles = alls.toUpperCase().split(",");
+ String[] alleles = alls.toUpperCase(Locale.ROOT).split(",");
StringBuilder vars = new StringBuilder();
for (String allele : alleles)
{
- allele = allele.trim().toUpperCase();
+ allele = allele.trim().toUpperCase(Locale.ROOT);
if (allele.length() > 1 || "-".equals(allele))
{
continue; // multi-locus variant
*/
final int i = cdsPos == codonPos[0] ? 0
: (cdsPos == codonPos[1] ? 1 : 2);
- variantCodon[i] = allele.toUpperCase().charAt(0);
+ variantCodon[i] = allele.toUpperCase(Locale.ROOT).charAt(0);
if (variantCodon[i] == baseCodon[i])
{
continue;
*/
package jalview.datamodel.features;
+import java.util.Locale;
+
import jalview.datamodel.SequenceFeature;
import jalview.util.MessageManager;
import jalview.util.matcher.Condition;
firstField = descriptor.substring(0, nextSpacePos);
leftToParse = descriptor.substring(nextSpacePos + 1).trim();
}
- String lower = firstField.toLowerCase();
- if (lower.startsWith(LABEL.toLowerCase()))
+ String lower = firstField.toLowerCase(Locale.ROOT);
+ if (lower.startsWith(LABEL.toLowerCase(Locale.ROOT)))
{
byLabel = true;
}
- else if (lower.startsWith(SCORE.toLowerCase()))
+ else if (lower.startsWith(SCORE.toLowerCase(Locale.ROOT)))
{
byScore = true;
}
}
Condition condition = matcher.getCondition();
- sb.append(SPACE).append(condition.toString().toLowerCase());
+ sb.append(SPACE).append(condition.toString().toLowerCase(Locale.ROOT));
if (condition.isNumeric())
{
sb.append(SPACE).append(matcher.getPattern());
*/
package jalview.datamodel.features;
+import java.util.Locale;
+
import jalview.datamodel.SequenceFeature;
import jalview.util.MessageManager;
if (!first)
{
String joiner = andConditions ? AND_18N : OR_I18N;
- sb.append(SPACE).append(joiner.toLowerCase()).append(SPACE);
+ sb.append(SPACE).append(joiner.toLowerCase(Locale.ROOT)).append(SPACE);
}
first = false;
if (multiple)
*/
package jalview.ext.ensembl;
+import java.util.Locale;
+
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefSource;
import jalview.util.JSONUtils;
{
fetchDivisions();
}
- return divisions.get(division.toUpperCase());
+ return divisions.get(division.toUpperCase(Locale.ROOT));
}
/**
/*
* for convenience, pre-fill ensembl.org as the domain for "ENSEMBL"
*/
- divisions.put(DBRefSource.ENSEMBL.toUpperCase(), ensemblDomain);
+ divisions.put(DBRefSource.ENSEMBL.toUpperCase(Locale.ROOT), ensemblDomain);
try
{
@SuppressWarnings("unchecked")
while (rvals.hasNext())
{
String division = rvals.next().toString();
- divisions.put(division.toUpperCase(), ensemblGenomesDomain);
+ divisions.put(division.toUpperCase(Locale.ROOT), ensemblGenomesDomain);
}
} catch (IOException | ParseException | NumberFormatException e)
{
*/
package jalview.ext.jmol;
+import java.util.Locale;
+
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Annotation;
import jalview.datamodel.PDBEntry;
// }
// ;
// instead, we distinguish .cif from non-.cif by filename
- setStructureFileType(getDataName().toLowerCase().endsWith(".cif")
+ setStructureFileType(getDataName().toLowerCase(Locale.ROOT).endsWith(".cif")
? PDBEntry.Type.MMCIF.toString()
: "PDB");
*/
package jalview.ext.rbvi.chimera;
+import java.util.Locale;
+
import java.awt.Color;
import java.util.ArrayList;
import java.util.Arrays;
* Chimera treats an attribute name ending in 'color' as colour-valued;
* Jalview doesn't, so prevent this by appending an underscore
*/
- if (attName.toUpperCase().endsWith("COLOR"))
+ if (attName.toUpperCase(Locale.ROOT).endsWith("COLOR"))
{
attName += "_";
}
*/
package jalview.fts.core;
+import java.util.Locale;
+
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
public DataTypeI getDataType()
{
final String[] dataTypeString = lineData[2].split("\\|");
- final String classString = dataTypeString[0].toUpperCase();
+ final String classString = dataTypeString[0].toUpperCase(Locale.ROOT);
return new DataTypeI()
{
if (dataTypeString.length > 1
&& dataTypeString[1] != null)
{
- switch (dataTypeString[1].toUpperCase())
+ switch (dataTypeString[1].toUpperCase(Locale.ROOT))
{
case "T":
case "TRUE":
*/
package jalview.gui;
+import java.util.Locale;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
}
}
});
- if (Cache.getDefault("VERSION", "DEVELOPMENT").toLowerCase()
+ if (Cache.getDefault("VERSION", "DEVELOPMENT").toLowerCase(Locale.ROOT)
.indexOf("devel") > -1
- || Cache.getDefault("VERSION", "DEVELOPMENT").toLowerCase()
+ || Cache.getDefault("VERSION", "DEVELOPMENT").toLowerCase(Locale.ROOT)
.indexOf("test") > -1)
{
formatMenu.add(vsel);
jws2servs.attachWSMenuEntry(webService, me);
for (Jws2Instance sv : jws2servs.getServices())
{
- if (sv.description.toLowerCase().contains("jpred"))
+ if (sv.description.toLowerCase(Locale.ROOT).contains("jpred"))
{
for (JMenuItem jmi : legacyItems)
{
*/
package jalview.gui;
+import java.util.Locale;
+
import jalview.api.FeatureRenderer;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentAnnotation;
boolean nucleotide = ap.av.isNucleotide();
String complement = nucleotide
- ? MessageManager.getString("label.protein").toLowerCase()
+ ? MessageManager.getString("label.protein").toLowerCase(Locale.ROOT)
: "CDS";
JLabel label = new JLabel(
MessageManager.formatMessage("label.include_linked_features",
*/
package jalview.gui;
+import java.util.Locale;
+
import jalview.analysis.AlignSeq;
import jalview.analysis.AlignmentUtils;
import jalview.datamodel.Alignment;
// jalview.gui.SeqPanel.mouseMoved(..) that formats sequence feature
// tooltips
String desc = aa.getDescription(true).trim();
- if (!desc.toLowerCase().startsWith(HTML_START_TAG))
+ if (!desc.toLowerCase(Locale.ROOT).startsWith(HTML_START_TAG))
{
tooltip.append(HTML_START_TAG);
desc = desc.replace("<", "<");
}
- else if (desc.toLowerCase().endsWith(HTML_END_TAG))
+ else if (desc.toLowerCase(Locale.ROOT).endsWith(HTML_END_TAG))
{
desc = desc.substring(0, desc.length() - HTML_END_TAG.length());
}
*/
package jalview.gui;
+import java.util.Locale;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
jmb.jmolViewer.renderScreenImage(g, width, height);
}
};
- String view = MessageManager.getString("action.view").toLowerCase();
+ String view = MessageManager.getString("action.view").toLowerCase(Locale.ROOT);
ImageExporter exporter = new ImageExporter(writer,
getProgressIndicator(), type, getTitle());
exporter.doExport(null, this, width, height, view);
*/
package jalview.gui;
+import java.util.Locale;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
String url = (history instanceof JTextField ? ((JTextField) history).getText()
: ((JComboBox<String>) history).getEditor().getItem().toString().trim());
- if (url.toLowerCase().endsWith(".jar")) {
+ if (url.toLowerCase(Locale.ROOT).endsWith(".jar")) {
if (viewport != null) {
new FileLoader().LoadFile(viewport, url, DataSourceType.URL, FileFormat.Jalview);
} else {
// message.append("<br>...Checking latest version...</br>");
} else if (!latestVersion.equals(Cache.getProperty("VERSION"))) {
boolean red = false;
- if (Cache.getProperty("VERSION").toLowerCase().indexOf("automated build") == -1) {
+ if (Cache.getProperty("VERSION").toLowerCase(Locale.ROOT).indexOf("automated build") == -1) {
red = true;
// Displayed when code version and jnlp version do not match and code
// version is not a development build
continue;
}
java.net.URI uri = new java.net.URI(s);
- if (uri.getScheme().toLowerCase().startsWith("http")) {
+ if (uri.getScheme().toLowerCase(Locale.ROOT).startsWith("http")) {
protocols.add(DataSourceType.URL);
files.add(uri.toString());
} else {
// resolve any .lnk files in the file drop
for (int f = 0; f < files.size(); f++) {
- String source = files.get(f).toString().toLowerCase();
+ String source = files.get(f).toString().toLowerCase(Locale.ROOT);
if (protocols.get(f).equals(DataSourceType.FILE)
&& (source.endsWith(".lnk") || source.endsWith(".url") || source.endsWith(".site"))) {
try {
*/
package jalview.gui;
+import java.util.Locale;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
String text = MessageManager.formatMessage("label.show_linked_features",
nucleotide
? MessageManager.getString("label.protein")
- .toLowerCase()
+ .toLowerCase(Locale.ROOT)
: "CDS");
showComplement = new JCheckBox(text);
showComplement.addActionListener(new ActionListener()
*/
package jalview.gui;
+import java.util.Locale;
+
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.FocusAdapter;
if (idMatch.size() > 0 && searchResults.getCount() > 0)
{
message.append(" ").append(
- MessageManager.getString("label.and").toLowerCase())
+ MessageManager.getString("label.and").toLowerCase(Locale.ROOT))
.append(" ");
}
message.append(MessageManager.formatMessage(
*/
package jalview.gui;
+import java.util.Locale;
+
import jalview.util.MessageManager;
import jalview.ws.seqfetcher.DbSourceProxy;
if (child.getUserObject() instanceof DbSourceProxy)
{
names[i] = ((DbSourceProxy) child.getUserObject()).getDbName()
- .toLowerCase();
+ .toLowerCase(Locale.ROOT);
}
else
{
- names[i] = ((String) child.getUserObject()).toLowerCase();
+ names[i] = ((String) child.getUserObject()).toLowerCase(Locale.ROOT);
sortTreeNodes(child);
}
}
*/
package jalview.gui;
+import java.util.Locale;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
for (int d = 0; d < nd; d++)
{
DBRefEntry e = dbr.get(d);
- String src = e.getSource(); // jalview.util.DBRefUtils.getCanonicalName(dbr[d].getSource()).toUpperCase();
+ String src = e.getSource(); // jalview.util.DBRefUtils.getCanonicalName(dbr[d].getSource()).toUpperCase(Locale.ROOT);
Object[] sarray = commonDbrefs.get(src);
if (sarray == null)
{
boolean usingNames = false;
// Now see which parts of the group apply for this URL
String ltarget = urlLink.getTarget(); // jalview.util.DBRefUtils.getCanonicalName(urlLink.getTarget());
- Object[] idset = commonDbrefs.get(ltarget.toUpperCase());
+ Object[] idset = commonDbrefs.get(ltarget.toUpperCase(Locale.ROOT));
String[] seqstr, ids; // input to makeUrl
if (idset != null)
{
package jalview.gui;
+import java.util.Locale;
+
import java.awt.event.ItemEvent;
import java.util.ArrayList;
import java.util.Collection;
if (pdbIdStr.split(":").length > 1)
{
pdbEntry.setId(pdbIdStr.split(":")[0]);
- pdbEntry.setChainCode(pdbIdStr.split(":")[1].toUpperCase());
+ pdbEntry.setChainCode(pdbIdStr.split(":")[1].toUpperCase(Locale.ROOT));
}
else
{
// TODO move this pdb id search into the PDB specific
// FTSSearchEngine
// for moment, it will work fine as is because it is self-contained
- String searchTerm = text.toLowerCase();
+ String searchTerm = text.toLowerCase(Locale.ROOT);
searchTerm = searchTerm.split(":")[0];
// System.out.println(">>>>> search term : " + searchTerm);
List<FTSDataColumnI> wantedFields = new ArrayList<>();
*/
package jalview.gui;
+import java.util.Locale;
+
import jalview.analysis.AlignmentSorter;
import jalview.analysis.AverageDistanceTree;
import jalview.analysis.NJTree;
String tree = MessageManager.getString("label.tree");
ImageExporter exporter = new ImageExporter(writer, null, imageFormat,
tree);
- exporter.doExport(null, this, width, height, tree.toLowerCase());
+ exporter.doExport(null, this, width, height, tree.toLowerCase(Locale.ROOT));
}
/**
// search dbrefs, features and annotation
List<DBRefEntry> refs = jalview.util.DBRefUtils
.selectRefs(sq.getDBRefs(), new String[]
- { labelClass.toUpperCase() });
+ { labelClass.toUpperCase(Locale.ROOT) });
if (refs != null)
{
for (int i = 0, ni = refs.size(); i < ni; i++)
* i18n description of Neighbour Joining or Average Distance method
*/
String treecalcnm = MessageManager
- .getString("label.tree_calc_" + treeType.toLowerCase());
+ .getString("label.tree_calc_" + treeType.toLowerCase(Locale.ROOT));
/*
* short score model name (long description can be too long)
*/
package jalview.gui;
+import java.util.Locale;
+
import jalview.bin.Cache;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
{
int row = i / cols + 1;
int index = (row * cols) + i;
- JButton button = makeButton(ResidueProperties.aa[i].toLowerCase(),
- ResidueProperties.aa[i].toLowerCase(), lowerCaseButtons, i);
+ JButton button = makeButton(ResidueProperties.aa[i].toLowerCase(Locale.ROOT),
+ ResidueProperties.aa[i].toLowerCase(Locale.ROOT), lowerCaseButtons, i);
buttonPanel.add(button, index);
}
*/
package jalview.gui;
+import java.util.Locale;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
{
return null;
}
- String lowertxt = text.toLowerCase();
+ String lowertxt = text.toLowerCase(Locale.ROOT);
int htmlpos = leaveFirst ? -1 : lowertxt.indexOf("<body");
int htmlend = leaveLast ? -1 : lowertxt.indexOf("</body");
{
return "";
}
- String lowertxt = text.toLowerCase();
+ String lowertxt = text.toLowerCase(Locale.ROOT);
int htmlpos = lowertxt.indexOf("<body");
int htmlend = lowertxt.indexOf("</body");
int doctype = lowertxt.indexOf("<!doctype");
package jalview.gui.structurechooser;
+import java.util.Locale;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
{
if (isValidSeqName(entry.getId()))
{
- String id = entry.getId().toLowerCase();
+ String id = entry.getId().toLowerCase(Locale.ROOT);
queryBuilder.append("pdb_id:").append(id).append(" OR ");
isPDBRefsFound = true;
pdbids.add(id);
else if (dbRef.getSource().equalsIgnoreCase(DBRefSource.PDB))
{
- String id = getDBRefId(dbRef).toLowerCase();
+ String id = getDBRefId(dbRef).toLowerCase(Locale.ROOT);
if (!pdbids.contains(id))
{
queryBuilder.append("pdb_id:").append(id).append(" OR ");
{
String seqName = seq.getName();
seqName = sanitizeSeqName(seqName);
- String[] names = seqName.toLowerCase().split("\\|");
+ String[] names = seqName.toLowerCase(Locale.ROOT).split("\\|");
for (String name : names)
{
// System.out.println("Found name : " + name);
{
return false;
}
- seqName = seqName.toLowerCase();
+ seqName = seqName.toLowerCase(Locale.ROOT);
for (String ignoredEntry : ignoreList.split(","))
{
if (seqName.contains(ignoredEntry))
package jalview.gui.structurechooser;
+import java.util.Locale;
+
import java.util.Collection;
import java.util.List;
import java.util.Objects;
{
return false;
}
- seqName = seqName.toLowerCase();
+ seqName = seqName.toLowerCase(Locale.ROOT);
for (String ignoredEntry : ignoreList.split(","))
{
if (seqName.contains(ignoredEntry))
package jalview.gui.structurechooser;
+import java.util.Locale;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
{
return 0;
}
- String upper_cat = cat.toUpperCase();
+ String upper_cat = cat.toUpperCase(Locale.ROOT);
int idx = EXP_CATEGORIES.indexOf(upper_cat);
if (idx == -1)
{
int o1_s = (Integer) o1data[idx_ups];
int o1_e = (Integer) o1data[idx_upe];
int o1_cat = scoreCategory((String) o1data[idx_mcat]);
- String o1_prov= ((String) o1data[idx_mprov]).toUpperCase();
+ String o1_prov= ((String) o1data[idx_mprov]).toUpperCase(Locale.ROOT);
int o2_s = (Integer) o2data[idx_ups];
int o2_e = (Integer) o2data[idx_upe];
int o2_cat = scoreCategory((String) o2data[idx_mcat]);
- String o2_prov= ((String) o2data[idx_mprov]).toUpperCase();
+ String o2_prov= ((String) o2data[idx_mprov]).toUpperCase(Locale.ROOT);
if (o1_cat == o2_cat)
{
return false;
}
- seqName = seqName.toLowerCase();
+ seqName = seqName.toLowerCase(Locale.ROOT);
for (String ignoredEntry : ignoreList.split(","))
{
if (seqName.contains(ignoredEntry))
*/
package jalview.io;
+import java.util.Locale;
+
import jalview.api.AlignExportSettingsI;
import jalview.api.AlignmentViewPanel;
import jalview.datamodel.Alignment;
String data = dataObject.toString();
DataSourceType protocol = DataSourceType.PASTE;
- String ft = data.toLowerCase().trim();
+ String ft = data.toLowerCase(Locale.ROOT).trim();
if (ft.indexOf("http:") == 0 || ft.indexOf("https:") == 0
|| ft.indexOf("file:") == 0)
{
*/
package jalview.io;
+import java.util.Locale;
+
import java.awt.Color;
import java.io.IOException;
import java.util.ArrayList;
// skip comments/process pragmas
if (line.length() == 0 || line.startsWith("#"))
{
- if (line.toLowerCase().startsWith("##"))
+ if (line.toLowerCase(Locale.ROOT).startsWith("##"))
{
processGffPragma(line, gffProps, align, newseqs);
}
String line;
while ((line = nextLine()) != null)
{
- if (line.toUpperCase().startsWith(ENDFILTERS))
+ if (line.toUpperCase(Locale.ROOT).startsWith(ENDFILTERS))
{
return;
}
*/
package jalview.io;
+import java.util.Locale;
+
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
protected void registerFileFormat(FileFormatI format,
boolean isIdentifiable)
{
- String name = format.getName().toUpperCase();
+ String name = format.getName().toUpperCase(Locale.ROOT);
if (formats.containsKey(name))
{
System.err.println("Overwriting file format: " + format.getName());
*/
public void deregisterFileFormat(String name)
{
- FileFormatI ff = formats.remove(name.toUpperCase());
+ FileFormatI ff = formats.remove(name.toUpperCase(Locale.ROOT));
identifiable.remove(ff);
}
*/
public FileFormatI forName(String format)
{
- return format == null ? null : formats.get(format.toUpperCase());
+ return format == null ? null : formats.get(format.toUpperCase(Locale.ROOT));
}
/**
*/
package jalview.io;
+import java.util.Locale;
+
import jalview.api.AlignExportSettingsI;
import jalview.api.AlignmentViewPanel;
import jalview.bin.Cache;
public boolean getCacheSuffixDefault(FileFormatI format)
{
- return Cache.getDefault(format.getName().toUpperCase() + "_JVSUFFIX",
+ return Cache.getDefault(format.getName().toUpperCase(Locale.ROOT) + "_JVSUFFIX",
true);
}
*/
package jalview.io;
+import java.util.Locale;
+
import java.io.File;
import java.io.IOException;
break;
}
}
- data = data.toUpperCase();
+ data = data.toUpperCase(Locale.ROOT);
if (data.startsWith(ScoreMatrixFile.SCOREMATRIX))
{
if ((lessThan > -1)) // possible Markup Language data i.e HTML,
// RNAML, XML
{
- String upper = data.toUpperCase();
+ String upper = data.toUpperCase(Locale.ROOT);
if (upper.substring(lessThan).startsWith("<HTML"))
{
reply = FileFormat.Html;
*/
package jalview.io;
+import java.util.Locale;
+
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Sequence;
// check that no stray annotations have been added at the end.
{
SequenceI sq = seqs.elementAt(j - 1);
- if (sq.getName().toUpperCase().startsWith("JPRED"))
+ if (sq.getName().toUpperCase(Locale.ROOT).startsWith("JPRED"))
{
annotSeqs.addElement(sq);
seqs.removeElementAt(--j);
*/
package jalview.io;
+import java.util.Locale;
+
import java.io.File;
import java.util.Hashtable;
import java.util.Iterator;
if ((i > 0) && (i < (filename.length() - 1)))
{
- return filename.substring(i + 1).toLowerCase();
+ return filename.substring(i + 1).toLowerCase(Locale.ROOT);
}
;
filters = new LinkedHashMap<>(5);
}
- filters.put(extension.toLowerCase(), this);
+ filters.put(extension.toLowerCase(Locale.ROOT), this);
fullDescription = null;
}
*/
package jalview.io;
+import java.util.Locale;
+
import jalview.util.MessageManager;
import java.io.File;
String exts = ff.getExtensions();
for (String ext : exts.split(","))
{
- ext = ext.trim().toLowerCase();
+ ext = ext.trim().toLowerCase(Locale.ROOT);
extensions.put(ext,
desc + ("jar".equals(ext) ? " (old)" : ""));
}
if ((i > 0) && (i < (s.length() - 1)))
{
- ext = s.substring(i + 1).toLowerCase();
+ ext = s.substring(i + 1).toLowerCase(Locale.ROOT);
}
return ext;
*/
package jalview.io;
+import java.util.Locale;
+
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
while (i < preds.length)
{
- String id = preds[i].getName().toUpperCase();
+ String id = preds[i].getName().toUpperCase(Locale.ROOT);
if (id.startsWith("LUPAS") || id.startsWith("JNET")
|| id.startsWith("JPRED"))
*/
package jalview.io;
+import java.util.Locale;
+
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
import jalview.util.Comparison;
public int checkSum(String seq)
{
int check = 0;
- String sequence = seq.toUpperCase();
+ String sequence = seq.toUpperCase(Locale.ROOT);
for (int i = 0; i < sequence.length(); i++)
{
// TODO: Extended SequenceNodeI to hold parsed NHX strings
package jalview.io;
+import java.util.Locale;
+
import jalview.datamodel.SequenceNode;
import jalview.util.MessageManager;
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);
*/
package jalview.io;
+import java.util.Locale;
+
import java.util.Collection;
import java.util.Comparator;
import java.util.LinkedHashMap;
* truncate overlong descriptions unless they contain an href
* before the truncation point (as truncation could leave corrupted html)
*/
- int linkindex = description.toLowerCase().indexOf("<a ");
+ int linkindex = description.toLowerCase(Locale.ROOT).indexOf("<a ");
boolean hasLink = linkindex > -1
&& linkindex < MAX_DESCRIPTION_LENGTH;
if (description.length() > MAX_DESCRIPTION_LENGTH && !hasLink)
+ "\" target=\""
+ urllink.get(0)
+ "\">"
- + (urllink.get(0).toLowerCase()
- .equals(urllink.get(1).toLowerCase()) ? urllink
+ + (urllink.get(0).toLowerCase(Locale.ROOT)
+ .equals(urllink.get(1).toLowerCase(Locale.ROOT)) ? urllink
.get(0) : (urllink.get(0) + ":" + urllink
.get(1)))
+ "</a><br/>");
*/
package jalview.io;
+import java.util.Locale;
+
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
}
else
{
- key = type2id(aa.label.toLowerCase());
+ key = type2id(aa.label.toLowerCase(Locale.ROOT));
if (key == null)
{
label = aa.label;
*/
package jalview.io.gff;
+import java.util.Locale;
+
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.MappingType;
// e.g. exonerate:protein2genome:local
if (model != null)
{
- String mdl = model.toLowerCase();
+ String mdl = model.toLowerCase(Locale.ROOT);
if (mdl.contains(PROTEIN2DNA) || mdl.contains(PROTEIN2GENOME)
|| mdl.contains(CODING2CODING) || mdl.contains(CODING2GENOME)
|| mdl.contains(CDNA2GENOME) || mdl.contains(GENOME2GENOME))
*/
package jalview.io.packed;
+import java.util.Locale;
+
import jalview.api.FeatureColourI;
import jalview.datamodel.AlignmentI;
import jalview.io.AppletFormatAdapter;
String type = args[i++];
final String file = args[i++];
final JvDataType jtype = DataProvider.JvDataType
- .valueOf(type.toUpperCase());
+ .valueOf(type.toUpperCase(Locale.ROOT));
if (jtype != null)
{
final FileParse fp;
else
{
System.out.println("Couldn't parse source type token '"
- + type.toUpperCase() + "'");
+ + type.toUpperCase(Locale.ROOT) + "'");
}
}
if (i < args.length)
*/
package jalview.io.vcf;
+import java.util.Locale;
+
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
+ DEFAULT_REFERENCE + ":" + DEFAULT_SPECIES);
reference = DEFAULT_REFERENCE; // default to GRCh37 if not specified
}
- reference = reference.toLowerCase();
+ reference = reference.toLowerCase(Locale.ROOT);
/*
* for a non-human species, or other assembly identifier,
String[] tokens = token.split("=");
if (tokens.length == 2)
{
- if (reference.contains(tokens[0].trim().toLowerCase()))
+ if (reference.contains(tokens[0].trim().toLowerCase(Locale.ROOT)))
{
vcfAssembly = tokens[1].trim();
break;
String[] tokens = token.split("=");
if (tokens.length == 2)
{
- if (reference.contains(tokens[0].trim().toLowerCase()))
+ if (reference.contains(tokens[0].trim().toLowerCase(Locale.ROOT)))
{
vcfSpecies = tokens[1].trim();
break;
{
for (Pattern p : filters)
{
- if (p.matcher(id.toUpperCase()).matches())
+ if (p.matcher(id.toUpperCase(Locale.ROOT)).matches())
{
return true;
}
{
try
{
- patterns.add(Pattern.compile(token.toUpperCase()));
+ patterns.add(Pattern.compile(token.toUpperCase(Locale.ROOT)));
} catch (PatternSyntaxException e)
{
System.err.println("Invalid pattern ignored: " + token);
*/
String consequence = getConsequenceForAlleleAndFeature(variant, CSQ_FIELD,
altAlleleIndex, csqAlleleFieldIndex,
- csqAlleleNumberFieldIndex, seq.getName().toLowerCase(),
+ csqAlleleNumberFieldIndex, seq.getName().toLowerCase(Locale.ROOT),
csqFeatureFieldIndex);
/*
{
String featureIdentifier = csqFields[featureFieldIndex];
if (featureIdentifier.length() > 4
- && seqName.indexOf(featureIdentifier.toLowerCase()) > -1)
+ && seqName.indexOf(featureIdentifier.toLowerCase(Locale.ROOT)) > -1)
{
/*
* feature (transcript) matched - now check for allele match
package jalview.javascript.log4j;
+import java.util.Locale;
+
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
{
return defaultLevel;
}
- String s = sArg.toUpperCase();
+ String s = sArg.toUpperCase(Locale.ROOT);
if (s.equals(ALL_NAME))
{
*/
package jalview.json.binding.biojson.v1;
+import java.util.Locale;
+
import jalview.datamodel.AnnotatedCollectionI;
import jalview.schemes.Blosum62ColourScheme;
import jalview.schemes.BuriedColourScheme;
public static ColourSchemeI getJalviewColourScheme(
String colourSchemeName, AnnotatedCollectionI annotCol)
{
- switch (colourSchemeName.toUpperCase())
+ switch (colourSchemeName.toUpperCase(Locale.ROOT))
{
case "ZAPPO":
return csZappo;
*/
package jalview.project;
+import java.util.Locale;
+
import static jalview.math.RotatableMatrix.Axis.X;
import static jalview.math.RotatableMatrix.Axis.Y;
import static jalview.math.RotatableMatrix.Axis.Z;
final PDBEntry pdbentry = bindingModel.getPdbEntry(peid);
final String pdbId = pdbentry.getId();
if (!pdbId.equals(entry.getId())
- && !(entry.getId().length() > 4 && entry.getId().toLowerCase()
- .startsWith(pdbId.toLowerCase())))
+ && !(entry.getId().length() > 4 && entry.getId().toLowerCase(Locale.ROOT)
+ .startsWith(pdbId.toLowerCase(Locale.ROOT))))
{
/*
* not interested in a binding to a different PDB entry here
for (int i = 0; i < colours.length; i++)
{
Colour col = new Colour();
- col.setName(ResidueProperties.aa[i].toLowerCase());
+ col.setName(ResidueProperties.aa[i].toLowerCase(Locale.ROOT));
col.setRGB(jalview.util.Format.getHexString(colours[i]));
// jbucs.addColour(col);
jbucs.getColour().add(col);
*/
package jalview.schemes;
+import java.util.Locale;
+
import jalview.xml.binding.jalview.JalviewUserColours;
import java.awt.Color;
Color color = new Color(
Integer.parseInt(jucs.getColour().get(i).getRGB(), 16));
- if (name.toLowerCase().equals(name))
+ if (name.toLowerCase(Locale.ROOT).equals(name))
{
caseSensitive = true;
lowerCase[index] = color;
*/
package jalview.schemes;
+import java.util.Locale;
+
import jalview.api.AlignViewportI;
import jalview.datamodel.AnnotatedCollectionI;
import jalview.datamodel.SequenceCollectionI;
* name is lower-case for non-case-sensitive lookup
* (name in the colour keeps its true case)
*/
- String lower = name.toLowerCase();
+ String lower = name.toLowerCase(Locale.ROOT);
if (schemes.containsKey(lower))
{
System.err
{
if (name != null)
{
- schemes.remove(name.toLowerCase());
+ schemes.remove(name.toLowerCase(Locale.ROOT));
}
}
{
return null;
}
- ColourSchemeI cs = schemes.get(name.toLowerCase());
+ ColourSchemeI cs = schemes.get(name.toLowerCase(Locale.ROOT));
return cs == null ? null
: cs.getInstance(viewport, forData);
}
{
return false;
}
- return schemes.containsKey(name.toLowerCase());
+ return schemes.containsKey(name.toLowerCase(Locale.ROOT));
}
}
*/
package jalview.schemes;
+import java.util.Locale;
+
import jalview.api.FeatureColourI;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.features.FeatureMatcher;
"Expected either 'label' or a colour specification in the line: "
+ descriptor);
}
- if (nextToken.toLowerCase().startsWith(LABEL))
+ if (nextToken.toLowerCase(Locale.ROOT).startsWith(LABEL))
{
byLabel = true;
// get the token after the next delimiter:
mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null);
mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null);
}
- else if (nextToken.toLowerCase().startsWith(SCORE))
+ else if (nextToken.toLowerCase(Locale.ROOT).startsWith(SCORE))
{
mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null);
mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null);
}
- else if (nextToken.toLowerCase().startsWith(ATTRIBUTE))
+ else if (nextToken.toLowerCase(Locale.ROOT).startsWith(ATTRIBUTE))
{
byAttribute = true;
attName = (gcol.hasMoreTokens() ? gcol.nextToken() : null);
}
gcol.nextToken(); // skip next '|'
- if (tok.toLowerCase().startsWith(ABSOLUTE))
+ if (tok.toLowerCase(Locale.ROOT).startsWith(ABSOLUTE))
{
minval = gcol.nextToken();
gcol.nextToken(); // skip next '|'
{
// threshold type and possibly a threshold value
ttype = gcol.nextToken();
- if (ttype.toLowerCase().startsWith(BELOW))
+ if (ttype.toLowerCase(Locale.ROOT).startsWith(BELOW))
{
featureColour.setBelowThreshold(true);
}
- else if (ttype.toLowerCase().startsWith(ABOVE))
+ else if (ttype.toLowerCase(Locale.ROOT).startsWith(ABOVE))
{
featureColour.setAboveThreshold(true);
}
else
{
- if (!ttype.toLowerCase().startsWith("no"))
+ if (!ttype.toLowerCase(Locale.ROOT).startsWith("no"))
{
System.err.println(
"Ignoring unrecognised threshold type : " + ttype);
*/
package jalview.schemes;
+import java.util.Locale;
+
import jalview.analysis.GeneticCodes;
import java.awt.Color;
{
continue;
}
- nuc = nuc.toUpperCase();
+ nuc = nuc.toUpperCase(Locale.ROOT);
if (!result.contains(nuc))
{
result.add(nuc);
{
continue;
}
- res = res.toUpperCase();
+ res = res.toUpperCase(Locale.ROOT);
if (!result.contains(res))
{
result.add(res);
return '0';
}
Integer index = ResidueProperties.aa3Hash
- .get(threeLetterCode.toUpperCase());
+ .get(threeLetterCode.toUpperCase(Locale.ROOT));
return index == null ? '0' : aa[index].charAt(0);
}
}
*/
package jalview.schemes;
+import java.util.Locale;
+
import jalview.api.AlignViewportI;
import jalview.datamodel.AnnotatedCollectionI;
import jalview.util.ColorUtils;
continue;
}
- if (residue.equals(residue.toLowerCase()))
+ if (residue.equals(residue.toLowerCase(Locale.ROOT)))
{
if (lowerCaseColours == null)
{
c = lowerCaseColours[index];
if (c != null && !c.equals(Color.white))
{
- residue = residue.toLowerCase();
+ residue = residue.toLowerCase(Locale.ROOT);
if (colours.get(c) == null)
{
colours.put(c, new ArrayList<String>());
*/
package jalview.structure;
+import java.util.Locale;
+
import jalview.datamodel.PDBEntry;
import jalview.datamodel.PDBEntry.Type;
String defaultStructureFileFormat)
{
StructureImportSettings.defaultStructureFileFormat = PDBEntry.Type
- .valueOf(defaultStructureFileFormat.toUpperCase());
+ .valueOf(defaultStructureFileFormat.toUpperCase(Locale.ROOT));
}
public static String getDefaultPDBFileParser()
public static void setDefaultPDBFileParser(String defaultPDBFileParser)
{
StructureImportSettings.defaultPDBFileParser = StructureParser
- .valueOf(defaultPDBFileParser.toUpperCase());
+ .valueOf(defaultPDBFileParser.toUpperCase(Locale.ROOT));
}
}
*/
package jalview.structures.models;
+import java.util.Locale;
+
import java.awt.Color;
import java.io.File;
import java.io.IOException;
for (String reply : replies)
{
// return this error (Chimera only) to the user
- if (reply.toLowerCase().contains("unequal numbers of atoms"))
+ if (reply.toLowerCase(Locale.ROOT).contains("unequal numbers of atoms"))
{
error += "; " + reply;
}
* want to preserve case, but do not want to duplicate upper and lower case
* variants
*/
+import java.util.Locale;
+
public final class CaseInsensitiveString
{
String value;
public int hashCode()
{
return value == null ? super.hashCode()
- : value.toUpperCase().hashCode();
+ : value.toUpperCase(Locale.ROOT).hashCode();
}
}
package jalview.util;
+import java.util.Locale;
+
import java.awt.Color;
import java.util.HashMap;
import java.util.Map;
return null;
}
Color col = null;
- name = name.toLowerCase();
+ name = name.toLowerCase(Locale.ROOT);
// or make a static map; or use reflection on the field name
switch (name)
*/
package jalview.util;
+import java.util.Locale;
+
import java.util.ArrayList;
import java.util.BitSet;
import java.util.HashMap;
// guarantee we always have lowercase entries for canonical string lookups
for (String k : canonicalSourceNameLookup.keySet())
{
- canonicalSourceNameLookup.put(k.toLowerCase(),
+ canonicalSourceNameLookup.put(k.toLowerCase(Locale.ROOT),
canonicalSourceNameLookup.get(k));
}
}
HashSet<String> srcs = new HashSet<String>();
for (String src : sources)
{
- srcs.add(src.toUpperCase());
+ srcs.add(src.toUpperCase(Locale.ROOT));
}
int nrefs = dbrefs.size();
{
DBRefEntry dbr = dbrefs.get(ib);
String source = getCanonicalName(dbr.getSource());
- if (srcs.contains(source.toUpperCase()))
+ if (srcs.contains(source.toUpperCase(Locale.ROOT)))
{
res.add(dbr);
}
{
return null;
}
- String canonical = canonicalSourceNameLookup.get(source.toLowerCase());
+ String canonical = canonicalSourceNameLookup.get(source.toLowerCase(Locale.ROOT));
return canonical == null ? source : canonical;
}
*/
public static String getStringOrReturn(String keyroot, String name)
{
- String smkey = keyroot + name.toLowerCase().replaceAll(" ", "");
+ String smkey = keyroot + name.toLowerCase(Locale.ROOT).replaceAll(" ", "");
try
{
name = rb.getString(smkey);
*/
package jalview.util;
+import java.util.Locale;
+
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
return;
}
StringBuilder sb = new StringBuilder(description.length());
- if (description.toUpperCase().indexOf("<HTML>") == -1)
+ if (description.toUpperCase(Locale.ROOT).indexOf("<HTML>") == -1)
{
htmlContent = false;
}
token = token.substring(0, startTag);
}
- if (tag != null && tag.toUpperCase().startsWith("A HREF="))
+ if (tag != null && tag.toUpperCase(Locale.ROOT).startsWith("A HREF="))
{
if (token.length() > 0)
{
*/
package jalview.util;
+import java.util.Locale;
+
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
}
if (s.length() <= 1)
{
- return s.toUpperCase();
+ return s.toUpperCase(Locale.ROOT);
}
- return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
+ return s.substring(0, 1).toUpperCase(Locale.ROOT) + s.substring(1).toLowerCase(Locale.ROOT);
}
/**
{
return null;
}
- String tmp2up = text.toUpperCase();
+ String tmp2up = text.toUpperCase(Locale.ROOT);
int startTag = tmp2up.indexOf("<HTML>");
if (startTag > -1)
{
*/
package jalview.util.matcher;
+import java.util.Locale;
+
import java.util.Objects;
/**
patternType = PatternType.String;
}
- uppercasePattern = pattern == null ? null : pattern.toUpperCase();
+ uppercasePattern = pattern == null ? null : pattern.toUpperCase(Locale.ROOT);
// if we add regex conditions (e.g. matchesPattern), then
// pattern should hold the raw regex, and
boolean matchesString(String compareTo)
{
boolean matched = false;
- String upper = compareTo.toUpperCase().trim();
+ String upper = compareTo.toUpperCase(Locale.ROOT).trim();
switch(condition) {
case Matches:
matched = upper.equals(uppercasePattern);
*/
package jalview.ws;
+import java.util.Locale;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
*/
void addSeqId(SequenceI seq, String key)
{
- key = key.toUpperCase();
+ key = key.toUpperCase(Locale.ROOT);
Vector<SequenceI> seqs;
if (seqRefs.containsKey(key))
DBRefEntry upref = uprefs.get(j);
addSeqId(sequence, upref.getAccessionId());
queries.addElement(
- upref.getAccessionId().toUpperCase());
+ upref.getAccessionId().toUpperCase(Locale.ROOT));
}
}
else
"Validated ID against PICR... (for what its worth):"
+ token);
addSeqId(sequence, token);
- queries.addElement(token.toUpperCase());
+ queries.addElement(token.toUpperCase(Locale.ROOT));
}
else
{
// System.out.println("Not querying source with
// token="+token+"\n");
addSeqId(sequence, token);
- queries.addElement(token.toUpperCase());
+ queries.addElement(token.toUpperCase(Locale.ROOT));
}
}
}
DBRefEntry ref = entryRefs.get(j);
String accessionId = ref.getAccessionId();
// match up on accessionId
- if (seqRefs.containsKey(accessionId.toUpperCase()))
+ if (seqRefs.containsKey(accessionId.toUpperCase(Locale.ROOT)))
{
Vector<SequenceI> seqs = seqRefs.get(accessionId);
for (int jj = 0; jj < seqs.size(); jj++)
// sequenceMatches now contains the set of all sequences associated with
// the returned db record
final String retrievedSeqString = retrievedSeq.getSequenceAsString();
- String entrySeq = retrievedSeqString.toUpperCase();
+ String entrySeq = retrievedSeqString.toUpperCase(Locale.ROOT);
for (int m = 0; m < sequenceMatches.size(); m++)
{
sequence = sequenceMatches.elementAt(m);
boolean remoteEnclosesLocal = false;
String nonGapped = AlignSeq
.extractGaps("-. ", sequence.getSequenceAsString())
- .toUpperCase();
+ .toUpperCase(Locale.ROOT);
int absStart = entrySeq.indexOf(nonGapped);
if (absStart == -1)
{
String ngAlsq = AlignSeq
.extractGaps("-. ",
alseqs[alsq].getSequenceAsString())
- .toUpperCase();
+ .toUpperCase(Locale.ROOT);
int oldstrt = alseqs[alsq].getStart();
alseqs[alsq].setStart(sequence.getSequenceAsString()
- .toUpperCase().indexOf(ngAlsq) + sequence.getStart());
+ .toUpperCase(Locale.ROOT).indexOf(ngAlsq) + sequence.getStart());
if (oldstrt != alseqs[alsq].getStart())
{
alseqs[alsq].setEnd(
package jalview.ws.dbsources;
+import java.util.Locale;
+
import java.io.File;
import java.io.IOException;
try
{
reply = dbFetch.fetchDataAsFile(
- dbName.toLowerCase() + ":" + query.trim(), null, "gz");
+ dbName.toLowerCase(Locale.ROOT) + ":" + query.trim(), null, "gz");
} catch (Exception e)
{
stopQuery();
throw new Exception(
String.format("EBI EMBL retrieval failed for %s:%s",
- dbName.toLowerCase(), query.trim()),
+ dbName.toLowerCase(Locale.ROOT), query.trim()),
e);
}
return getEmblSequenceRecords(dbName, query, reply);
*/
package jalview.ws.dbsources;
+import java.util.Locale;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
try
{
reply = dbFetch.fetchDataAsFile(
- emprefx.toLowerCase() + ":" + query.trim(), "display=xml",
+ emprefx.toLowerCase(Locale.ROOT) + ":" + query.trim(), "display=xml",
"xml");
} catch (Exception e)
{
stopQuery();
throw new Exception(
String.format("EBI EMBL XML retrieval failed for %s:%s",
- emprefx.toLowerCase(), query.trim()),
+ emprefx.toLowerCase(Locale.ROOT), query.trim()),
e);
}
return getEmblSequenceRecords(emprefx, query, reply);
*/
package jalview.ws.dbsources;
+import java.util.Locale;
+
import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
startQuery();
try
{
- queries = queries.toUpperCase().replaceAll(
+ queries = queries.toUpperCase(Locale.ROOT).replaceAll(
"(UNIPROT\\|?|UNIPROT_|UNIREF\\d+_|UNIREF\\d+\\|?)", "");
AlignmentI al = null;
*/
package jalview.ws.dbsources;
+import java.util.Locale;
+
import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
startQuery();
try
{
- queries = queries.toUpperCase().replaceAll(
+ queries = queries.toUpperCase(Locale.ROOT).replaceAll(
"(UNIPROT\\|?|UNIPROT_|UNIREF\\d+_|UNIREF\\d+\\|?)", "");
AlignmentI al = null;
*/
package jalview.ws.dbsources;
+import java.util.Locale;
+
import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
{
rcds.getSequenceAt(s).addDBRef(new DBRefEntry(getXfamSource(),
// getDbSource(),
- getDbVersion(), queries.trim().toUpperCase()));
+ getDbVersion(), queries.trim().toUpperCase(Locale.ROOT)));
if (!getDbSource().equals(getXfamSource()))
{ // add the specific ref too
rcds.getSequenceAt(s).addDBRef(new DBRefEntry(getDbSource(),
- getDbVersion(), queries.trim().toUpperCase()));
+ getDbVersion(), queries.trim().toUpperCase(Locale.ROOT)));
}
}
stopQuery();
String getURL(String queries)
{
- return getURLPrefix() + "/family/" + queries.trim().toUpperCase()
+ return getURLPrefix() + "/family/" + queries.trim().toUpperCase(Locale.ROOT)
+ getURLSuffix();
}
*/
package jalview.ws.ebi;
+import java.util.Locale;
+
import jalview.datamodel.DBRefSource;
import jalview.util.MessageManager;
import jalview.util.Platform;
|| database.equalsIgnoreCase(DBRefSource.EMBLCDS))
{
url = "https://www.ebi.ac.uk/ena/browser/api/embl/"
- + ids.toLowerCase() + "?download=true&gzip=true";
+ + ids.toLowerCase(Locale.ROOT) + "?download=true&gzip=true";
}
else
{
url = "https://www.ebi.ac.uk/Tools/dbfetch/dbfetch/"
- + database.toLowerCase() + "/" + ids.toLowerCase()
+ + database.toLowerCase(Locale.ROOT) + "/" + ids.toLowerCase(Locale.ROOT)
+ (format != null ? "/" + format : "");
}
return url;
*/
package jalview.ws.io.mime;
+import java.util.Locale;
+
import jalview.io.packed.DataProvider.JvDataType;
/**
*/
public static JvDataType getTypeOf(String mimeType)
{
- String mt = mimeType.toLowerCase();
+ String mt = mimeType.toLowerCase(Locale.ROOT);
for (int i = 0; i < typemap.length; i += 2)
{
if (typemap[i].equals(mt))
*/
package jalview.ws.jws1;
+import java.util.Locale;
+
import jalview.analysis.AlignSeq;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentView;
private String getPredictionName(String webServiceName)
{
- if (webServiceName.toLowerCase()
+ if (webServiceName.toLowerCase(Locale.ROOT)
.indexOf("secondary structure prediction") > -1)
{
return webServiceName;
*/
package jalview.ws.jws1;
+import java.util.Locale;
+
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentView;
import jalview.gui.AlignFrame;
wsInfo.setProgressText(((submitGaps) ? "Re-alignment" : "Alignment")
+ " of " + altitle + "\nJob details\n");
- String jobtitle = WebServiceName.toLowerCase();
+ String jobtitle = WebServiceName.toLowerCase(Locale.ROOT);
if (jobtitle.endsWith("alignment"))
{
if (submitGaps && (!jobtitle.endsWith("realignment")
*/
package jalview.ws.jws2;
+import java.util.Locale;
+
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
wsInfo.setProgressText(((submitGaps) ? "Re-alignment" : "Alignment")
+ " of " + altitle + "\nJob details\n");
- String jobtitle = WebServiceName.toLowerCase();
+ String jobtitle = WebServiceName.toLowerCase(Locale.ROOT);
if (jobtitle.endsWith("alignment"))
{
if (submitGaps && (!jobtitle.endsWith("realignment")
*/
package jalview.ws.jws2;
+import java.util.Locale;
+
import jalview.api.AlignCalcWorkerI;
import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
worker.updateParameters(this.preset, paramset);
}
}
- if (sh.action.toLowerCase().contains("disorder"))
+ if (sh.action.toLowerCase(Locale.ROOT).contains("disorder"))
{
// build IUPred style client. take sequences, returns annotation per
// sequence.
*/
package jalview.ws.rest;
+import java.util.Locale;
+
import jalview.ws.params.ArgumentI;
import jalview.ws.params.InvalidArgumentException;
import jalview.ws.params.OptionI;
{
valid = false;
warnings.append("Invalid value for parameter "
- + mtch.group(1).toLowerCase() + " '" + mtch.group(2)
+ + mtch.group(1).toLowerCase(Locale.ROOT) + " '" + mtch.group(2)
+ "' (expected an integer)\n");
}
*/
package jalview.ws.rest;
+import java.util.Locale;
+
import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
*/
String f;
StringBuffer content = new StringBuffer(f = EntityUtils.toString(en));
- f = f.toLowerCase();
+ f = f.toLowerCase(Locale.ROOT);
int body = f.indexOf("<body");
if (body > -1)
{
*/
package jalview.ws.sifts;
+import java.util.Locale;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
}
String siftsFileName = SiftsSettings.getSiftDownloadDirectory()
- + pdbId.toLowerCase() + ".xml.gz";
+ + pdbId.toLowerCase(Locale.ROOT) + ".xml.gz";
File siftsFile = new File(siftsFileName);
if (siftsFile.exists())
{
BackupFiles.moveFileToFile(siftsFile, oldSiftsFile);
try
{
- siftsFile = downloadSiftsFile(pdbId.toLowerCase());
+ siftsFile = downloadSiftsFile(pdbId.toLowerCase(Locale.ROOT));
oldSiftsFile.delete();
return siftsFile;
} catch (IOException e)
}
try
{
- siftsFile = downloadSiftsFile(pdbId.toLowerCase());
+ siftsFile = downloadSiftsFile(pdbId.toLowerCase(Locale.ROOT));
} catch (IOException e)
{
throw new SiftsException(e.getMessage());
public static boolean deleteSiftsFileByPDBId(String pdbId)
{
File siftsFile = new File(SiftsSettings.getSiftDownloadDirectory()
- + pdbId.toLowerCase() + ".xml.gz");
+ + pdbId.toLowerCase(Locale.ROOT) + ".xml.gz");
if (siftsFile.exists())
{
return siftsFile.delete();
for (MapRegion mapRegion : mapRegions)
{
accessions
- .add(mapRegion.getDb().getDbAccessionId().toLowerCase());
+ .add(mapRegion.getDb().getDbAccessionId().toLowerCase(Locale.ROOT));
}
}
}
HashSet<String> dbRefAccessionIdsString = new HashSet<String>();
for (DBRefEntry dbref : seq.getDBRefs())
{
- dbRefAccessionIdsString.add(dbref.getAccessionId().toLowerCase());
+ dbRefAccessionIdsString.add(dbref.getAccessionId().toLowerCase(Locale.ROOT));
}
- dbRefAccessionIdsString.add(sourceDBRef.getAccessionId().toLowerCase());
+ dbRefAccessionIdsString.add(sourceDBRef.getAccessionId().toLowerCase(Locale.ROOT));
curDBRefAccessionIdsString = dbRefAccessionIdsString;
curSourceDBRef = sourceDBRef.getAccessionId();
{
boolean isStrictMatch = true;
return isStrictMatch ? curSourceDBRef.equalsIgnoreCase(accession)
- : curDBRefAccessionIdsString.contains(accession.toLowerCase());
+ : curDBRefAccessionIdsString.contains(accession.toLowerCase(Locale.ROOT));
}
private boolean isFoundInSiftsEntry(String accessionId)
{
Set<String> siftsDBRefs = getAllMappingAccession();
return accessionId != null
- && siftsDBRefs.contains(accessionId.toLowerCase());
+ && siftsDBRefs.contains(accessionId.toLowerCase(Locale.ROOT));
}
/**
*/
package jalview.analysis;
+import java.util.Locale;
+
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Sequence;
ps = new PrintStream(new File(args[6]));
}
- boolean nucleotide = args[0].toLowerCase().startsWith("n");
+ boolean nucleotide = args[0].toLowerCase(Locale.ROOT).startsWith("n");
int width = Integer.parseInt(args[1]);
int height = Integer.parseInt(args[2]);
long randomSeed = Long.valueOf(args[3]);
*/
package jalview.analysis;
+import java.util.Locale;
+
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertFalse;
import static org.testng.AssertJUnit.assertNull;
char second = bases.charAt(j);
boolean result = Rna.isCanonicalOrWobblePair(first, second);
String pair = new String(new char[] { first, second })
- .toUpperCase();
+ .toUpperCase(Locale.ROOT);
if (pair.equals("AT") || pair.equals("TA") || pair.equals("AU")
|| pair.equals("UA") || pair.equals("GC")
|| pair.equals("CG") || pair.equals("GT")
char second = bases.charAt(j);
boolean result = Rna.isCanonicalPair(first, second);
String pair = new String(new char[] { first, second })
- .toUpperCase();
+ .toUpperCase(Locale.ROOT);
if (pair.equals("AT") || pair.equals("TA") || pair.equals("AU")
|| pair.equals("UA") || pair.equals("GC")
|| pair.equals("CG"))
*/
package jalview.commands;
+import java.util.Locale;
+
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertSame;
import static org.testng.AssertJUnit.assertTrue;
assertEquals("abcdefghjk", seqs[0].getSequenceAsString());
assertEquals("fghjZ-xYopq", seqs[1].getSequenceAsString());
// Dataset Sequence should always be uppercase
- assertEquals("fghjZxYopq".toUpperCase(),
+ assertEquals("fghjZxYopq".toUpperCase(Locale.ROOT),
seqs[1].getDatasetSequence().getSequenceAsString());
assertEquals("qrstuvwxyz", seqs[2].getSequenceAsString());
assertEquals("1234567890", seqs[3].getSequenceAsString());
assertEquals(1, seq.getStart());
assertEquals(8, seq.getEnd());
// Dataset sequence always uppercase
- assertEquals("ABxyZDEF".toUpperCase(),
+ assertEquals("ABxyZDEF".toUpperCase(Locale.ROOT),
seq.getDatasetSequence().getSequenceAsString());
assertEquals(8, seq.getDatasetSequence().getEnd());
assertEquals(1, seq.getStart());
assertEquals(8, seq.getEnd());
// dataset sequence should be Uppercase
- assertEquals("ABxyZDEF".toUpperCase(),
+ assertEquals("ABxyZDEF".toUpperCase(Locale.ROOT),
seq.getDatasetSequence().getSequenceAsString());
assertEquals(8, seq.getDatasetSequence().getEnd());
// and ds is preserved
assertTrue(dsseq == seqs[1].getDatasetSequence());
// and it is unchanged and UPPERCASE !
- assertEquals("fghjklmnopq".toUpperCase(), dsseq.getSequenceAsString());
+ assertEquals("fghjklmnopq".toUpperCase(Locale.ROOT), dsseq.getSequenceAsString());
// and that alignment sequence start has been adjusted
assertEquals(5, seqs[1].getStart());
assertEquals(11, seqs[1].getEnd());
// and ds is preserved
assertTrue(dsseq == seqs[1].getDatasetSequence());
// and it is unchanged AND UPPERCASE !
- assertEquals("fghjklmnopq".toUpperCase(), dsseq.getSequenceAsString());
+ assertEquals("fghjklmnopq".toUpperCase(Locale.ROOT), dsseq.getSequenceAsString());
// and that alignment sequence start has been adjusted
assertEquals(5, seqs[1].getStart());
assertEquals(11, seqs[1].getEnd());
*/
package jalview.datamodel;
+import java.util.Locale;
+
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
ResidueCount rc = new ResidueCount(false);
// expected characters (upper or lower case):
String aas = "ACDEFGHIKLMNPQRSTVWXY";
- String lower = aas.toLowerCase();
+ String lower = aas.toLowerCase(Locale.ROOT);
for (int i = 0; i < aas.length(); i++)
{
rc.put(aas.charAt(i), i);
ResidueCount rc = new ResidueCount(true);
// expected characters (upper or lower case):
String nucs = "ACGTUN";
- String lower = nucs.toLowerCase();
+ String lower = nucs.toLowerCase(Locale.ROOT);
for (int i = 0; i < nucs.length(); i++)
{
rc.put(nucs.charAt(i), i);
*/
package jalview.datamodel;
+import java.util.Locale;
+
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertFalse;
import static org.testng.AssertJUnit.assertNotNull;
} catch (IllegalArgumentException e)
{
// TODO Jalview error/exception class for raising implementation errors
- assertTrue(e.getMessage().toLowerCase()
+ assertTrue(e.getMessage().toLowerCase(Locale.ROOT)
.contains("implementation error"));
}
assertTrue(sq.getSequenceFeatures().isEmpty());
*/
package jalview.ext.ensembl;
+import java.util.Locale;
+
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertFalse;
import static org.testng.AssertJUnit.assertNull;
assertTrue(testee.retainFeature(sf, accId));
// test is not case-sensitive
- assertTrue(testee.retainFeature(sf, accId.toLowerCase()));
+ assertTrue(testee.retainFeature(sf, accId.toLowerCase(Locale.ROOT)));
// feature with wrong parent is not retained
sf.setValue("Parent", "XYZ");
*/
package jalview.ext.ensembl;
+import java.util.Locale;
+
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertFalse;
import static org.testng.AssertJUnit.assertTrue;
SequenceFeature sf3 = new SequenceFeature("NMD_transcript_variant", "",
22000, 22500, 0f, null);
// id matching should not be case-sensitive
- sf3.setValue("Parent", geneId.toLowerCase());
+ sf3.setValue("Parent", geneId.toLowerCase(Locale.ROOT));
sf3.setValue("id", "transcript3");
genomic.addSequenceFeature(sf3);
*/
package jalview.ext.paradise;
+import java.util.Locale;
+
import static org.testng.AssertJUnit.assertTrue;
import jalview.datamodel.AlignmentI;
{
{
SequenceI struseq = null;
- String sq_ = sq.getSequenceAsString().toLowerCase();
+ String sq_ = sq.getSequenceAsString().toLowerCase(Locale.ROOT);
for (SequenceI _struseq : pdbf.getSeqsAsArray())
{
final String lowerCase = _struseq.getSequenceAsString()
- .toLowerCase();
+ .toLowerCase(Locale.ROOT);
if (lowerCase.equals(sq_))
{
struseq = _struseq;
package jalview.io;
+import java.util.Locale;
+
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotEquals;
for (FileFormatI ff : FileFormat.values())
{
assertSame(ff, formats.forName(ff.getName()));
- assertSame(ff, formats.forName(ff.getName().toUpperCase()));
- assertSame(ff, formats.forName(ff.getName().toLowerCase()));
+ assertSame(ff, formats.forName(ff.getName().toUpperCase(Locale.ROOT)));
+ assertSame(ff, formats.forName(ff.getName().toLowerCase(Locale.ROOT)));
}
assertNull(formats.forName(null));
assertNull(formats.forName("rubbish"));
*/
package jalview.ws.gui;
+import java.util.Locale;
+
import jalview.bin.Cache;
import jalview.gui.JvOptionPane;
import jalview.gui.WsJobParameters;
public static List<String> presetTests = new ArrayList<String>();
static
{
- serviceTests.add("AAConWS".toLowerCase());
+ serviceTests.add("AAConWS".toLowerCase(Locale.ROOT));
}
public static Jws2Discoverer disc = null;
for (Jws2Instance service : disc.getServices())
{
if (serviceTests.size() == 0
- || serviceTests.contains(service.serviceType.toLowerCase()))
+ || serviceTests.contains(service.serviceType.toLowerCase(Locale.ROOT)))
{
List<Preset> prl = null;
Preset pr = null;
*/
package jalview.ws.jabaws;
+import java.util.Locale;
+
import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertTrue;
iupreds = new ArrayList<Jws2Instance>();
for (Jws2Instance svc : disc.getServices())
{
- if (svc.getServiceTypeURI().toLowerCase().contains("iupredws"))
+ if (svc.getServiceTypeURI().toLowerCase(Locale.ROOT).contains("iupredws"))
{
iupreds.add(svc);
}
*/
package jalview.ws.jabaws;
+import java.util.Locale;
+
import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertTrue;
for (Jws2Instance svc : disc.getServices())
{
- if (svc.getServiceTypeURI().toLowerCase().contains("rnaalifoldws"))
+ if (svc.getServiceTypeURI().toLowerCase(Locale.ROOT).contains("rnaalifoldws"))
{
rnaalifoldws = svc;
}
*/
package jalview.ws.jws2;
+import java.util.Locale;
+
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertFalse;
import static org.testng.AssertJUnit.assertTrue;
@BeforeClass(alwaysRun = true)
public static void setUpBeforeClass() throws Exception
{
- serviceTests.add("AAConWS".toLowerCase());
+ serviceTests.add("AAConWS".toLowerCase(Locale.ROOT));
Cache.loadProperties("test/jalview/io/testProps.jvprops");
Cache.initLogger();
disc = JalviewJabawsTestUtils.getJabawsDiscoverer();
public boolean isForTesting(Jws2Instance service)
{
return serviceTests.size() == 0
- || serviceTests.contains(service.serviceType.toLowerCase());
+ || serviceTests.contains(service.serviceType.toLowerCase(Locale.ROOT));
}
@Test(groups = { "Network" })
*/
package junit.extensions;
+import java.util.Locale;
+
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
{
return false;
}
- if (className.startsWith(className.substring(0, 1).toUpperCase()))
+ if (className.startsWith(className.substring(0, 1).toUpperCase(Locale.ROOT)))
{
return true;
}