Skip to content

Diagnostics show up on non-Mapper types #598

Description

@agudian

Suppose I have these types:

public interface BaseEntityMapper<E extends AbstractEntity, D extends AbstractDto> {
    E toEntity(D src);
    D toDto(E src);
}

@Mapper
public interface CarEntityMapper extends BaseEntityMapper<Car, CarDto> {
// nothing
}

If Car and CarDto map nicely, then CarEntityMapperImpl will be generated as one would expect and it works great.

However, if they don't map nicely, e.g. due to unmapped target properties, the diagnostics are generated with the locations of the methods in BaseEntityMapper. If that type is located in an already created jar, the marker might not be visible in some IDEs or in javac.

I think that, generally, if we create a diagnostic for some mapper to generate, we should only use locations within that mapper. In this case, an "unmapped target property" could be located at "extends BaseEntityMapper".

WDYT?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions