목차

Lombok

Gradle-Lombok

javac 메모리 문제

Disable Field

Maven 설정

주의점

PMD 문제 회피

Checkstyle 문제 회피

equals & hashCode Code Coverage

Custom Handler

Default Value Builder & ETC

Delombok

Boolean 필드 문제

Upgrade 주의점

1.16.20 @ConstructorProperties

BREAKING CHANGE: lombok config key lombok.anyConstructor.suppressConstructorProperties is now deprecated and defaults to true, that is, by default lombok no longer automatically generates @ConstructorProperties annotations. New config key lombok.anyConstructor.addConstructorProperties now exists; set it to true if you want the old behavior. Oracle more or less broke this annotation with the release of JDK9, necessitating this breaking change.

1.18.4 field annotation 들이 getter/setter 로 복제됨

BREAKING CHANGE: Lombok will now always copy specific annotations around (from field to getter, from field to builder 'setter', etcetera): A specific curated list of known annotations where that is the right thing to do (generally, @NonNull style annotations from various libraries), as well as any annotations you explicitly list in the lombok.copyableAnnotations config key in your lombok.config file. Also, lombok is more consistent about copying these annotations. (Previous behaviour: Lombok used to copy any annotation whose simple name was NonNull, Nullable, or CheckForNull). Issue #1570 and Issue #1634

구버전

@JsonProperty("isXxx")
private int isXxx;
 
-> 진짜 생성은
 
@JsonProperty("isXxx")
private int isXxx;
 
public void setXxx(int xxx) {
    this.isXxx = xxx;
}
 
-> 이로 인해서 JSON 에 ''isXxx'', ''xxx'' 두개의 필드가 존재하게 됨.

신 버전 Lombok

@JsonProperty("isXxx")
private int isXxx;
 
-> 진짜 생성은
 
@JsonProperty("isXxx")
private int isXxx;
 
// 아래 setter 에도 @JsonProperty 가 붙어버림
@JsonProperty("isXxx")
public void setXxx(int isXxx) {
    this.isXxx = isXxx;
}