Lombok: Nullable is not a repeatable annotation type in 1.18.4

Created on 27 Nov 2018  路  2Comments  路  Source: projectlombok/lombok

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

Most helpful comment

it breaks backward compatibility.
fix could be "don't apply non-repeatable (or the same) annotation if it's already there"

All 2 comments

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"

Was this page helpful?
0 / 5 - 0 ratings