404-not-find / orika

Automatically exported from code.google.com/p/orika
2 stars 0 forks source link

.converter(id) ignores id and uses default one instead #174

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Implement ConfigurableMapper in custom class
2. Register multiple convertors for same datatypes with different id's
3. Try using them with method .converter("id")

What is the expected output? What do you see instead?
Converter with provided name should be used, instead the first one defined is 
used

What version of the product are you using? On what operating system?
Issue is present with versions > 1.4.3

Please provide any additional information below.
Test class can be found in an attachment

Original issue reported on code.google.com by Nikolajs...@gmail.com on 16 Sep 2014 at 3:08

Attachments:

GoogleCodeExporter commented 8 years ago
The problem is coming from UsedConvertersContext who use the class type for the 
key in the map usedConverters.

To fix the issue, I've created a new method which take in consideration the 
converterId. I've change both Convert and SourceCodeContext to make them use 
that new method. 

See attached class.

Original comment by sdesche...@opnworks.com on 15 Oct 2014 at 6:08

Attachments: