Skip to content

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

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)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions