projectlombok / lombok

Very spicy additions to the Java programming language.
https://projectlombok.org/
Other
12.93k stars 2.4k forks source link

[BUG] [Eclipse] @SuperBuilder Type mismatch: cannot convert from List<String> to List<E> when using @Size #3714

Open danibs opened 3 months ago

danibs commented 3 months ago

Eclipse complains with Type mismatch: cannot convert from List<String> to List<E> when using @Size and constant.

@SuperBuilder( toBuilder = true )
public abstract class AAA {
}
@Value
@SuperBuilder( toBuilder = true )       //<-- here
@EqualsAndHashCode( callSuper = true )
public class Internal extends AAA {
    private static final int DESCRIPTION_SHORT = 100;

    List<@NotBlank @Size( max = DESCRIPTION_SHORT ) String> exemptions;
}

If I replace:

@Size( max = DESCRIPTION_SHORT ) 

with:

@Size( max = 100 ) 

no errors are reported.

Version info:

Rawi01 commented 1 month ago

I cannot reproduce this issue. Please check that you use the latests lombok version in eclipse and have not removed anything else from your example code that is important.

danibs commented 1 month ago

@Rawi01 just checked. I create exactly the two classes above.

Same problem using Lombok v1.18.35

immagine