-
-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Milestone
Description
Plugin Information
- Plugin Version: 1.6.1
- Mapstruct Version: 1.5.5
- Lombok Version: 1.18.28
- Java Version: 17
- IDE Version: Intellij IDEA Ultimate 2023.2.5
Problem Description
The code completion feature of the MapStruct Support plugin is not working properly when using the lombok @SuperBuilder (lombok.experimental.SuperBuilder) annotation.
Steps to Reproduce
- Create a new Java class.
- Add the lombok
@SuperBuilderannotation to the class. - Try to use code completion for any field in
@Mapperannotation.
Expected Behavior
When using the @SuperBuilder annotation, the code completion feature should suggest the available fields.
Actual Behavior
The code completion feature does not suggest any fields or methods.
Screenshots and Code Snippets
// Class with annotation
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
public class Builder {
private Integer bar;
}// Class without annotation
@Getter
@Setter
public class WithoutBuilder {
private Integer foo;
private Builder innerBuilder; // To show that autocompletion works for inner builders
}// Mapper with broken code completion
@Mapper
public interface BuilderMapper {
@Mapping(target = "", source = "")
Builder map(WithoutBuilder builder);
}Doesn't work for class with @SuperBuilder:

But works for class without @SuperBuilder:

Even works for class with @SuperBuilder which inside a class without @SuperBuilder:

Additional Information
Generated class for @Mapping(target = "bar", source = "foo") to show that it is valid mapper:
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2023-11-13T17:06:33+0700",
comments = "version: 1.5.5.Final, compiler: javac, environment: Java 17.0.8 (BellSoft)"
)
public class BuilderMapperImpl implements BuilderMapper {
@Override
public Builder map(WithoutBuilder builder) {
if ( builder == null ) {
return null;
}
Builder builder1 = new Builder();
builder1.setBar( builder.getFoo() );
return builder1;
}
}Metadata
Metadata
Assignees
Labels
No labels