-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Serializing and Deserializing Locale.ROOT #1123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This might not be backwards compatible, but in Java 7+ you can use Locale.forLanguageTag(String) to deserialize and Locale.toLanguageTag() to serialize. |
@hookumsnivy thank you for reporting this & for the suggestion of fix. I'll have to think about the solution; my main concern is just that while we are moving to require JDK7 baseline, there is bit of transition where we try to keep runtime JDK6 compatible. But adding special handling for "" seems simple enough even using a work-around. |
@cowtowncoder It looks like FromStringDeserializer already has special handling for "" in the case of URIs. |
@hookumsnivy right, that's not a problem from my perspective, can add it once I have time to work on this. |
Ok... so the problem really is the special handling for empty String. Gotcha. |
Serializing and Deserializing Locale objects seems to work just fine, until you try on the Root Locale.
It writes it out as an empty string and when it reads it in, the value is null
Here is the output:
Root Locale: '""'
java.lang.AssertionError:
Expected :
Actual :null
The text was updated successfully, but these errors were encountered: