Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lombok should delete @Singlular annotation from a field when a constructor is annotated with @Builder. #1377

Closed
ajagtian opened this issue May 5, 2017 · 1 comment
Assignees
Labels
accepted The issue/enhancement is valid, sensible, and explained in sufficient detail bug
Milestone

Comments

@ajagtian
Copy link

ajagtian commented May 5, 2017

Example

@Accessors(fluent = true)
@AllArgsConstructor(access = PACKAGE)
@FieldDefaults(makeFinal = true, level = PRIVATE)
public class Book {
    @NonNull
    @Getter
    String name;
    @Getter
    @NonNull
    @Singular
    Set<Author> authors;
    int numberOfAuthors;
  
   @Builder
   public Book(String name, @Singular Set<Author> authors) {
       this(name, authors, authors.size());
   }
}

This does not fail during compile time or delomboking, but fails at javadoc generation because Lombok does not detect and delete @Singular from the field authors

@elreydetodo
Copy link

I can confirm that this is still an issue in lombok 1.18.28. My delombok'd class still has the @Singular annotation, and it causes my javadoc task to fail with the following error:

> Task :javadoc FAILED
/Users/martin/src/jumpstart/build/generated/sources/delombok/java/main/com/integralblue/demo/jumpstart/model/SomeRecord.java:6: error: cannot find symbol
public record SomeRecord(Integer id, @Singular List<String> lists, @Singular Map<String, String> maps) {
                                      ^
  symbol:   class Singular
  location: class SomeRecord
/Users/martin/src/jumpstart/build/generated/sources/delombok/java/main/com/integralblue/demo/jumpstart/model/SomeRecord.java:6: error: cannot find symbol
public record SomeRecord(Integer id, @Singular List<String> lists, @Singular Map<String, String> maps) {
                                                                    ^
  symbol:   class Singular
  location: class SomeRecord
2 errors

@rzwitserloot rzwitserloot self-assigned this Sep 16, 2023
@rzwitserloot rzwitserloot added bug accepted The issue/enhancement is valid, sensible, and explained in sufficient detail labels Sep 16, 2023
@rzwitserloot rzwitserloot added this to the next-version milestone Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The issue/enhancement is valid, sensible, and explained in sufficient detail bug
Projects
None yet
Development

No branches or pull requests

3 participants