Tagged articles
2 articles
Page 1 of 1
Programmer DD
Programmer DD
Mar 24, 2023 · Backend Development

Why Lombok @Data + @Builder Removes No‑Args Constructor and How to Fix It

This article explains why combining Lombok's @Data and @Builder annotations eliminates the default no‑argument constructor, demonstrates the compilation issues it causes, and provides two practical solutions—including using @Tolerate or separating constructors with @RequiredArgsConstructor and @NoArgsConstructor—while also detailing Lombok's compilation mechanism and a custom annotation example.

Builder PatternCompilationJava
0 likes · 6 min read
Why Lombok @Data + @Builder Removes No‑Args Constructor and How to Fix It
Java High-Performance Architecture
Java High-Performance Architecture
Oct 25, 2022 · Backend Development

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

This article explains why using Lombok's @Data and @Builder together removes the default no‑argument constructor, demonstrates the compilation behavior, and provides two practical solutions—including @Tolerate and combining @RequiredArgsConstructor with @NoArgsConstructor—while also detailing Lombok's annotation‑processing mechanism.

Annotation ProcessingBuilder PatternJava
0 likes · 6 min read
Why Lombok @Data + @Builder Breaks No‑Arg Constructors and How to Fix It