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

Fix custom converter params not being thread-safe #755

Conversation

grubeninspekteur
Copy link
Contributor

@grubeninspekteur grubeninspekteur commented May 1, 2019

Issue link

#753 Custom converter param not thread safe

Purpose

see issue

Approach

Thread local param for all instances of CustomConverter.

Open Questions and Pre-Merge TODOs

  • Issue created
  • Unit tests pass
  • Documentation updated
  • Travis build passed

@garethahealy
Copy link
Collaborator

@idyedov ; can you test this PR to see if it fixes your issue please

@idyedov
Copy link

idyedov commented May 3, 2019

looked over the fix and the included unit test - looks good to me!

longer-term, I would suggest to move parameter to be immutable and set at initialization of the field mapping configuration rather than at runtime

@grubeninspekteur
Copy link
Contributor Author

@idyedov problem is, the same converter instance may be reused by multiple mappings with different parameters (we do this in our production code). A better solution would be adding the parameter to the mapping method, but this is an incompatible interface change.

@garethahealy garethahealy merged commit b1a23e7 into DozerMapper:master May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants