Tagged articles
2 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
Programmer DD
Programmer DD
Oct 12, 2022 · Backend Development

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

This article explains why combining Lombok's @Data and @Builder annotations removes the automatically generated no‑argument constructor, demonstrates the compilation process behind Lombok, and provides two practical solutions using @Tolerate or @RequiredArgsConstructor/@NoArgsConstructor to restore the missing constructor.

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