jmapper-framework / jmapper-core

Elegance, high performance and robustness all in one java bean mapper
http://jmapper-framework.github.io/jmapper-core
Apache License 2.0
231 stars 41 forks source link

Static and synthetic fields should be ignored by global mapping #15

Closed francism-spaggetti closed 9 years ago

francism-spaggetti commented 9 years ago

When using the JGlobalMap annotation on a class which implements Serializable and has a serialVersionUID field, I get an exception complaining about there not being a getter or setter for "serialVersionUID". Similarly, when using the Jacoco plugin to measure test coverage for my code, I get an exception on classes marked with JGlobalMap complaining that there isn't a mapping for the "$jacocoData" field (a synthetic field generated by Jacoco when it instruments the bytecode). I believe this behaviour is incorrect.

My workaround for now is to put both those field names in the "excluded" attribute of the JGlobalMap annotation, but this feels like an ugly solution (especially for Jacoco - my source classes shouldn't know or care that I might want to measure their test coverage!).

avurro commented 9 years ago

Hi, thank you for reporting this issue. The synthetic fields aren't handled for now, but it's very easy to fix. I'll let you know as soon as possible

avurro commented 9 years ago

i have committed the fix, can you try to use the project with this last update? you need a quick release or can you wait?

francism-spaggetti commented 9 years ago

That seems to have done the trick, thanks :) I will update to the next version as soon as it's released.

On 05/08/2015 14:10, avurro wrote:

i have committed the fix, can you try to use the project with this last update?

— Reply to this email directly or view it on GitHub https://github.com/jmapper-framework/jmapper-core/issues/15#issuecomment-127992671.