1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 01:29:38 +02:00

Use Locale.US when doing String operations

on machine readable output. The default locale may not provide the
wanted mapping. See also
http://developer.android.com/reference/java/util/Locale.html#default_locale

SMACK-467
This commit is contained in:
Florian Schmaus 2014-04-03 22:50:13 +02:00
parent 94adaf8e50
commit d8a5610d7b
24 changed files with 67 additions and 39 deletions

View file

@ -34,6 +34,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;
@ -180,7 +181,7 @@ public class AgentRoster {
synchronized (entries) {
for (Iterator<String> i = entries.iterator(); i.hasNext();) {
String entry = i.next();
if (entry.toLowerCase().equals(jid.toLowerCase())) {
if (entry.toLowerCase(Locale.US).equals(jid.toLowerCase())) {
return true;
}
}
@ -248,7 +249,7 @@ public class AgentRoster {
private String getPresenceMapKey(String user) {
String key = user;
if (!contains(user)) {
key = StringUtils.parseBareAddress(user).toLowerCase();
key = StringUtils.parseBareAddress(user).toLowerCase(Locale.US);
}
return key;
}
@ -322,7 +323,7 @@ public class AgentRoster {
synchronized (entries) {
for (Iterator<String> i = entries.iterator(); i.hasNext();) {
String entry = i.next();
if (entry.toLowerCase().equals(StringUtils.parseBareAddress(key).toLowerCase())) {
if (entry.toLowerCase(Locale.US).equals(StringUtils.parseBareAddress(key).toLowerCase())) {
fireEvent(EVENT_PRESENCE_CHANGED, packet);
}
}
@ -343,7 +344,7 @@ public class AgentRoster {
synchronized (entries) {
for (Iterator<String> i = entries.iterator(); i.hasNext();) {
String entry = (String)i.next();
if (entry.toLowerCase().equals(StringUtils.parseBareAddress(key).toLowerCase())) {
if (entry.toLowerCase(Locale.US).equals(StringUtils.parseBareAddress(key).toLowerCase())) {
fireEvent(EVENT_PRESENCE_CHANGED, packet);
}
}

View file

@ -194,7 +194,7 @@ public class WorkgroupQueue {
if (type == null) {
return null;
}
type = type.toLowerCase();
type = type.toLowerCase(Locale.US);
if (OPEN.toString().equals(type)) {
return OPEN;
}