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

Can't initialize the selma mapper into field declaration of the custom mapper. #53

Closed
seblm opened this Issue Apr 11, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@seblm

seblm commented Apr 11, 2015

Given a mapper SelmaMapper that declares a custom mapper CustomSelmaMapper.
Given this CustomSelmaMapper wants to use SelmaMapper again.
If CustomSelmaMapper initialize SelmaMapper into a field declaration,
When SelmaMapper is first used and initialized,
Then there is a StackOverflowError.

You can find a failing test on this project.

@slemesle

This comment has been minimized.

Show comment
Hide comment
@slemesle

slemesle Apr 22, 2015

I see 2 possible solutions for this to work correctly as a supported feature in Selma:

  • Add the source mapper as a parameter of the custom mapper either in constructor or mapping method
  • Use an abstract class for the mapper contract instead of an interface and consider non abstract methods as custom mapping methods.

The second one will be supported one day it is a feature we want to implement in Selma but the first one is not expected for now.

Any idea would be appreciated, also please tell me what would be your preferred solution.

slemesle commented Apr 22, 2015

I see 2 possible solutions for this to work correctly as a supported feature in Selma:

  • Add the source mapper as a parameter of the custom mapper either in constructor or mapping method
  • Use an abstract class for the mapper contract instead of an interface and consider non abstract methods as custom mapping methods.

The second one will be supported one day it is a feature we want to implement in Selma but the first one is not expected for now.

Any idea would be appreciated, also please tell me what would be your preferred solution.

@seblm

This comment has been minimized.

Show comment
Hide comment
@seblm

seblm May 4, 2015

I also prefer the second one. I think that this issue is not a blocker at all. I can close it without any esitation

seblm commented May 4, 2015

I also prefer the second one. I think that this issue is not a blocker at all. I can close it without any esitation

slemesle added a commit that referenced this issue Nov 11, 2015

@slemesle slemesle added this to the 0.13 milestone Nov 18, 2015

@slemesle slemesle closed this Nov 18, 2015

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