atos1990 / orika

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

MappingException when enum toString() is overridden #49

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create a enum and override toString method. 
2.Create a object with the enum field.
2.Map this object to another object with corresponding enum field.

What is the expected output? What do you see instead?
Filled object is  expected. I see MappingException instead.

What version of the product are you using? On what operating system?
Orika 1.2.0. Windows 7 and Ubuntu 12.0.4

Please provide any additional information below.
see attached test and log.

Original issue reported on code.google.com by dkhomya...@gmail.com on 11 Sep 2012 at 12:13

Attachments:

GoogleCodeExporter commented 9 years ago
Ok, in this case, I guess we have to just to skip it, and let the user specify 
a custom converter instead of automatic mapping?

Original comment by elaat...@gmail.com on 11 Sep 2012 at 12:19

GoogleCodeExporter commented 9 years ago
Unfortunally, custom converter isn't suitable for me. I need to develop api 
with automatic entity-dto mapping. I suppose,  cause of the problem is Orika 
use Enum.toString()(not final) instead of Enum.name()(final).  That seems easy 
for fix.

Original comment by dkhomya...@gmail.com on 11 Sep 2012 at 1:25

GoogleCodeExporter commented 9 years ago
Of course, I was mission the point.
I was thinking that when you have different literal names (between two 
Enumerations) .
This can will be shipped wihin next release (in the next few days)

Original comment by elaat...@gmail.com on 11 Sep 2012 at 2:17

GoogleCodeExporter commented 9 years ago
Of course, I was mission the point.
I was thinking that when you have different literal names (between two 
Enumerations) .
This can will be shipped wihin next release (in the next few days)

Original comment by elaat...@gmail.com on 11 Sep 2012 at 2:17

GoogleCodeExporter commented 9 years ago

Original comment by elaat...@gmail.com on 11 Sep 2012 at 7:11

GoogleCodeExporter commented 9 years ago
With your permission I will include your test to Orika,

Thanks in advance 

Original comment by elaat...@gmail.com on 11 Sep 2012 at 7:52

GoogleCodeExporter commented 9 years ago
Thanks for responsiveness!

Original comment by dkhomya...@gmail.com on 12 Sep 2012 at 6:50

GoogleCodeExporter commented 9 years ago
A fix has been shipped within 1.2.1 release
this release ship some performance improvements!

Original comment by elaat...@gmail.com on 15 Sep 2012 at 3:55