atos1990 / orika

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

Boolean fields not mapped when using 'is' getter methods instead of 'get' #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Steps to reproduce: Run the attached unit test.

From what I gather this is a bug in one of the JDK introspector classes - 
java.beans.PropertyDescriptor.getReadMethod - which in 1.5.0 recognizes 'is' 
getters only for boolean types (forgetting its big brother - Boolean).

It would be nice if Orika included some sort of workaround for this issue. 

Original issue reported on code.google.com by lighteater on 29 Mar 2012 at 1:20

Attachments:

GoogleCodeExporter commented 9 years ago
the convention is "get" for Boolean and not "is", only primitive boolean has 
"is",
in the 1.1 we can extend the default propertyResolvingStrategy to lookup for 
accessors and mutators other than Introspector's getter and setter

Original comment by elaat...@gmail.com on 29 Mar 2012 at 11:32

GoogleCodeExporter commented 9 years ago
Oh, I didn't realize that. 
Either way this becomes a problem when dealing with some tools that don't 
respect this convention. xjc is a good example of that, the classes it 
generates by default break this rule. 

Thanks.

Original comment by lighteater on 30 Mar 2012 at 11:23

GoogleCodeExporter commented 9 years ago
Done in the 1.1.0

Original comment by elaat...@gmail.com on 20 Apr 2012 at 2:59