import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
String line;
while ((line = nextLine()) != null)
{
- if (line.toUpperCase().startsWith(ENDFILTERS))
+ // TODO: use .trim().equalsIgnoreCase here instead ?
+ if (line.toUpperCase(Locale.ROOT).startsWith(ENDFILTERS))
{
return;
}
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
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));
}
/**
import java.io.File;
import java.io.IOException;
+import java.util.Locale;
/**
* Additional formatting methods used by the application in a number of places.
public boolean getCacheSuffixDefault(FileFormatI format)
{
- return Cache.getDefault(format.getName().toUpperCase() + "_JVSUFFIX",
+ return Cache.getDefault(format.getName().toUpperCase(Locale.ROOT) + "_JVSUFFIX",
true);
}
import java.io.File;
import java.io.IOException;
+import java.util.Locale;
/**
* DOCUMENT ME!
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;
import java.io.IOException;
import java.util.Hashtable;
+import java.util.Locale;
import java.util.StringTokenizer;
import java.util.Vector;
// 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 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"))
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import java.util.Locale;
import java.util.StringTokenizer;
/**
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++)
{
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
+import java.util.Locale;
public class ParsePackedSet
{
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)
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
{
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);