Tagged articles
1 articles
Page 1 of 1
Java Backend Technology
Java Backend Technology
Aug 31, 2023 · Backend Development

Why Lombok @Data + @Builder Breaks No‑Args Constructors and How to Fix It

When Lombok's @Data and @Builder annotations are used together, the generated no‑argument constructor disappears, causing compilation errors; this article explains the root cause, demonstrates the problem with code examples, and provides two reliable solutions using @Tolerate or a combination of @RequiredArgsConstructor and @NoArgsConstructor.

@DataBuilderJava
0 likes · 6 min read
Why Lombok @Data + @Builder Breaks No‑Args Constructors and How to Fix It