Skip to content

Inspection "Target property must not be mapped more than once" incorrectly flags multiple mappings to "." #241

@PRiewe

Description

@PRiewe

If the target class includes properties from multiple source sub-classes then this mapping is legal:

  @Mapping(target = ".", source = "key")
  @Mapping(target = ".", source = "foo")
  @Mapping(target = ".", source = "bar")
  public abstract MyClass toMyClass (MyClassInternal internal);

It is only illegal if there is overlap in the properties (i.e. if MyClass has property X and both foo and bar contains X)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions