TypeError enum Type methods should not use default user locales

The methods toString and fromString in enum Type in class XMPPError do not handle well some of the locales like Turkish.

There are some comments in the source code saying the Locale.US is not needed but that is not true.

// Locale.US not required, since Type consists only of ASCII chars

For example, if user is using Turkish language in the system and if Smack receives some error IQ with type “wait”, the method fromString will convert it to “WAİT” which will result in IllegalArgumentException as there is no enum with Type.WAİT

Just to confirm my words: https://ideone.com/4cXJTs

In my opinion both methods should use Locale.US as in the rest places of the Smack’s code.

Thanks for reporting: SMACK-719.

I’ve uploaded Smack 4.1.7-SNAPSHOT to Maven Central’s snapshot repositories. Could you check that it fixes the issue and report back?

Yes, now it’s working as expected, thanks.