Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.6.1 (Evans SR1)
-
Fix Version/s: 1.5.5 (Dijkstra SR5), 1.6.2 (Evans SR2), 1.7 RC1 (Fowler)
-
Component/s: Mapping / Conversion
-
Labels:None
-
Pull Request URL:
-
Sprint:55 - Evans SR2
Description
I have an enum with rather long names and shorter per-value "tags" that I want to use for serialization. I've implemented a Converter pair that maps the values back and forth. They work properly when saving a Set of the enum.
However, when saving a Map<MyEnum,?>, the converter method is skipped; the enum's name is still used as the map key saved to Mongo. This would be frustrating but work-aroundable, but the proper converter is applied on reads. This means that when I save an object with a non-empty map and immediately attempt to read it, I get an exception when calling the read converter (since it's being supplied an invalid argument).
The problem appears to be at MappingMongoConverter:644, where the conversion service is explicitly skipped. This means that converters are applied to all types on read, and to all instances except map keys on write.