For value mappings a source value can only be mapped once. For example
import org.mapstruct.Mapper;
import org.mapstruct.ValueMapping;
@Mapper
public interface ValueMapper {
enum A {
A,B
}
enum B {
A,B
}
@ValueMapping(source = "A", target = "B")
@ValueMapping(source = "A", target = "A")
A from(B b);
}
Currently the plugin does not recognize this as an error. An inspection should be added for this.
For value mappings a source value can only be mapped once. For example
is invalide as source
Ais mapped twice. MapStruct report this asCurrently the plugin does not recognize this as an error. An inspection should be added for this.
For normal mappings there is already an inspection implemented and could be used as an example: https://github.com/mapstruct/mapstruct-idea/blob/main/src/main/java/org/mapstruct/intellij/inspection/TargetPropertyMappedMoreThanOnceInspection.java.