Lombok and Google Errorprone not working together

898 views Asked by At

I'm using lombok-1.18.18 and google error_prone_core-2.11.0 in my spring boot application. When using @EqualsAndHashCode and @NoArgsConstructor from Lombok getting build error in Google Errorprone. Error telling is telling something like below:

For @EqualsAndHashCode:

error: [MissingBraces] The Google Java Style Guide requires braces to be u
sed with if, else, for, do and while statements, even when the body is empty or contains only a single statement.
@EqualsAndHashCode(onlyExplicitlyIncluded = true)

For @NoArgsConstructor (there is constructor like public MyEntity(int someparam)):

error: [UngroupedOverloads] Overloads should be grouped toge
ther, even when modifiers such as static or private differ between the methods; found ungrouped constructor overloads on line(s): 36
@NoArgsConstructor
^
    (see https://errorprone.info/bugpattern/UngroupedOverloads)
  Did you mean '@Setter'?

My Entity class looks like this:

@Entity
@Getter
@Setter
@NoArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@ToString(onlyExplicitlyIncluded = true)
@Table(name = "my_entity")
public class MyEntity implements Serializable {

Lombok Config:

lombok.copyableAnnotations += org.springframework.beans.factory.annotation.Qualifier
lombok.copyableAnnotations += org.springframework.context.annotation.Lazy
lombok.copyableAnnotations += org.springframework.beans.factory.annotation.Value
lombok.addLombokGeneratedAnnotation = true
0

There are 0 answers