-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Milestone
Description
Expected behavior
I have a value object making use of Immutables, which requires a customized builder class. It's defined like this:
@Value.Immutable
public abstract class ValueObject {
public abstract String getFoo();
public abstract Long getId();
public static class Builder extends ImmutableValueObject.Builder {
//some additional builder methods here
}
}And a POJO entity class like this:
public class ValueEntity {
private String foo;
protected Long id;
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
public String getFoo() { return foo; }
public void setFoo(String foo) { this.foo = foo; }
}And a simple Mapper definition that maps ValueEntity to ValueObject:
@Mapper
public abstract class Converter {
public abstract ValueObject convert(ValueEntity valueEntity);
}Expectation: The mapper implementation ConverterImpl is generated successfully and uses the builder generated by Immutables to create the ValueObject.
Actual behavior
Generating the mapper fails with a StackOverflowError in the annotation processor:
at org.mapstruct.ap.spi.ImmutablesBuilderProvider.findBuilderInfoForImmutables(ImmutablesBuilderProvider.java:58)
at org.mapstruct.ap.spi.ImmutablesBuilderProvider.findBuilderInfo(ImmutablesBuilderProvider.java:40)
at org.mapstruct.ap.spi.DefaultBuilderProvider.findBuilderInfo(DefaultBuilderProvider.java:96)
at org.mapstruct.ap.spi.DefaultBuilderProvider.findBuilderInfo(DefaultBuilderProvider.java:185)
at org.mapstruct.ap.spi.ImmutablesBuilderProvider.findBuilderInfoForImmutables(ImmutablesBuilderProvider.java:58)
at org.mapstruct.ap.spi.ImmutablesBuilderProvider.findBuilderInfo(ImmutablesBuilderProvider.java:40)
at org.mapstruct.ap.spi.DefaultBuilderProvider.findBuilderInfo(DefaultBuilderProvider.java:96)
Steps to reproduce the problem
Clone https://github.com/creckord/mapstruct-immutables-mcve and run ./gradlew clean classes
MapStruct Version
1.5.5