mapstruct-idea icon indicating copy to clipboard operation
mapstruct-idea copied to clipboard

Multi-line Java expression flagged as invalid code

Open arnaldop opened this issue 3 years ago • 0 comments

This code snipped is flagged by IntelliJ:

    @Mapping(target = "field",
             expression = "java(EnumClass1.ENUM_VALUE_1 == dto.getEnumValue1()"
                          + " ? someValidCode()"
                          + " : otherValidCode())")

IntelliJ sees the end of the expression line as dto.getEnumValue1()" and believes that the java(...) wrapper is missing its closing parethesis.

Perhaps support for Java Text Blocks should be considered as well. See https://github.com/mapstruct/mapstruct/issues/2837.

arnaldop avatar Apr 30 '22 21:04 arnaldop