1.18.4 introduced a bug in handling annotations present both in base class and builder,
for example this code:
@Builder(builderClassName = "Builder")
@Getter
public class Boo {
@Nullable private final String foo;
public static class Builder {
@Nullable private String foo;
}
}
causing this compilation error:
Boo.java:8: error: Nullable is not a repeatable annotation type
@Builder(builderClassName = "Builder")
Once you remove @Nullable from either base class or builder it compiles fine.
Bug is introduced in 1.18.4, in 1.18.2 everything works without issues
I woudn't say this is a bug... This happens because of #1634 and therefore you don't need to put annotation to builder field anymore - lombok will copy one from class field.
it breaks backward compatibility.
fix could be "don't apply non-repeatable (or the same) annotation if it's already there"
Most helpful comment
it breaks backward compatibility.
fix could be "don't apply non-repeatable (or the same) annotation if it's already there"