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

Wrong usage of mappers factory should be able to remove static initializer #183

Open
filiphr opened this issue Mar 16, 2024 · 0 comments
Open

Comments

@filiphr
Copy link
Member

filiphr commented Mar 16, 2024

Why reviewing PR #179 @hduelme pointed out that the Wrong usage of mappers factory does not work (i.e. it does not remove it) with the following code:

@Mapper(componentModel = "spring")
abstract class WrongComponentModelMapper {

    static {
        Mappers.getMapper(WrongComponentModelMapper.class);
    }
    
    Target map(Target source);
}

or

@Mapper(config = MyConfig.class, componentModel = "spring")
interface WrongComponentModelMapper {


    WrongComponentModelMapper INSTANCE = () -> {
        return Mappers.getMapper(WrongComponentModelMapper.class);
    };

    Target map(Target source);
}

We need to see if we can support this.

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

No branches or pull requests

1 participant