mauriciorodrigues / memcached-session-manager

Automatically exported from code.google.com/p/memcached-session-manager
0 stars 0 forks source link

msm-javolution-serializer: java.util.Currency gets deserialized with ReflectionFormat #34

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
java.util.Currency gets serialized and deserialized with the
ReflectionFormat which always creates new instances during deserialization.

The transient field defaultFractionDigits is then always zero and a
comparision with equals may return false even if the currencyCode is equal
since it is just Object.equals(). Only one instance should exist for each
currencyCode.

This applies to all Versions up to and including 1.2-SNAPSHOT.

I've added a patch that provides a special XMLFormat for Currency that
resolves the issue.

Thomas

Original issue reported on code.google.com by beckmann...@gmail.com on 10 Feb 2010 at 11:13

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by martin.grotzke on 10 Feb 2010 at 4:09

GoogleCodeExporter commented 8 years ago

Original comment by martin.grotzke on 10 Feb 2010 at 4:33

GoogleCodeExporter commented 8 years ago
Patch applied, added test case.

Additionally made these changes:
- Exclude currencies from reference handling as the XMLCurrencyFormat uses 
Currency.getInstance
- Support serialization of currency as an attribute (using currency code)

Changes are merged to develop branch, this will be released with 1.2

Original comment by martin.grotzke on 12 Feb 2010 at 10:40