1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 12:02:05 +01:00

Use Locale.US in XMPPError.Type ↔ String conversion

Fixes SMACK-719
This commit is contained in:
Florian Schmaus 2016-04-12 15:03:23 +02:00
parent 8235e8417d
commit 58d9f4e749

View file

@ -19,6 +19,7 @@ package org.jivesoftware.smack.packet;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -240,13 +241,11 @@ public class XMPPError extends AbstractError {
@Override @Override
public String toString() { public String toString() {
// Locale.US not required, since Type consists only of ASCII chars return name().toLowerCase(Locale.US);
return name().toLowerCase();
} }
public static Type fromString(String string) { public static Type fromString(String string) {
// Locale.US not required, since Type consists only of ASCII chars string = string.toUpperCase(Locale.US);
string = string.toUpperCase();
return Type.valueOf(string); return Type.valueOf(string);
} }
} }