Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassLevelFieldMappingGenerator should ignore synthetic fields #763

Closed
dimitarp opened this issue Jul 24, 2019 · 3 comments
Closed

ClassLevelFieldMappingGenerator should ignore synthetic fields #763

dimitarp opened this issue Jul 24, 2019 · 3 comments

Comments

@dimitarp
Copy link

  • Dozer version: 6.5.0
  • JDK version: 1.8.0_212

Steps to reproduce:

  1. Mapping "declared fields accessible" classes
  2. Run unit tests coverage with jacoco maven plugin

Observed Results:

ERROR c.g.d.core.MappingProcessor - Field mapping error -->
  MapId: null
  Type: null
  Source parent class: A
  Source field name: $jacocoData
  Source field type: class [Z
  Source field value: [Z@16be6b36
  Dest parent class: B
  Dest field name: $jacocoData
  Dest field type: [Z
java.lang.OutOfMemoryError: Java heap space

Expected Results:

Dozer should ignore the synthetic jacoco fields. From jacoco FAQ:

My code uses reflection. Why does it fail when I execute it with JaCoCo?
To collect execution data JaCoCo instruments the classes under test which adds two members to the classes: A private static field $jacocoData and a private static method $jacocoInit(). Both members are marked as synthetic.
Please change your code to ignore synthetic members. This is a good practice anyways as also the Java compiler creates synthetic members in certain situation.

@johannschenkl
Copy link
Contributor

@garethahealy Has this been fixed or is this a not a dozer issue? We're currently seeing excessive memory (OOM) usage after upgrading to dozer 6.5.0 when jacoco is enabled. Thanks!

@garethahealy
Copy link
Collaborator

@johannschenkl ; no, I've not had time to investigate (and won't have any in the coming months). if you want to investigate/raise a PR, happy to review/merge.

@johannschenkl
Copy link
Contributor

@garethahealy ok, perfect. it seems like just ignoring synthetic fields fixes the issues. I'll test a bit more and then try to raise a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants