Skip to content

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

Open
@filiphr

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions