Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Novice
Description
According to the serialized form of DecimalFormatSymbols, the DecimalFormatSymbols itself should be responsible for initializing the currency from the intlCurrencySymbol field. But Harmony only leave it as null.
The following test case reproduces this bug:
public void test_serialization() {
DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.FRANCE);
Currency currency = symbols.getCurrency();
assertNotNull(currency);
try
{ // serialize ByteArrayOutputStream byteOStream = new ByteArrayOutputStream(); ObjectOutputStream objectOStream = new ObjectOutputStream( byteOStream); objectOStream.writeObject(symbols); // and deserialize ObjectInputStream objectIStream = new ObjectInputStream( new ByteArrayInputStream(byteOStream.toByteArray())); DecimalFormatSymbols symbolsD = (DecimalFormatSymbols) objectIStream .readObject(); // The associated currency will not persist currency = symbolsD.getCurrency(); }catch (Exception e1)
{ fail("Errors occur during serialization"); }try
{ assertNotNull(currency); }catch (Exception e)
{ fail("currency should not be null"); }}
Pass on RI(Sun JDK1.5.0_06)
Rail on Harmony