-
-
Notifications
You must be signed in to change notification settings - Fork 842
Open
Labels
Description
Describe the bug
java.util.Locale script field in the is missing after deserialization with Kryo5, when we execute below UT method. we expect to get sr_RS_#Cyrl but actually we get the sr_RS which script is lost
expected [sr_RS_#Cyrl] but found [sr_RS]
java.lang.AssertionError: expected [sr_RS_#Cyrl] but found [sr_RS]
To Reproduce
@Test
public void testLocaleScript() {
Kryo kryo = new Kryo();
kryo.setRegistrationRequired(false);
Locale locale = new Locale.Builder().setLanguage("sr").setScript("Cyrl").setRegion("RS").build();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (Output output = new Output(baos)) {
kryo.writeClassAndObject(output, locale);
}
Object deserializedLocale;
try (Input input = new Input(baos.toByteArray())){
deserializedLocale = kryo.readClassAndObject(input);
}
assertEquals(deserializedLocale.toString(), "sr_RS_#Cyrl");
}
Environment:
- OS: Windows/OSX/Ubuntu
- JDK Version: JDK17
- Kryo Version: 5.5.0