Idea使用lombok时warn:Generating equals/hashCode implementation but without a call

错误

Idea使用lombok时warn:Generating equals/hashCode implementation but without a call_第1张图片

Warning:(15, 1) java: Generating equals/hashCode implementation but without a call to superclass, even though this class does not extend java.lang.Object. If this is intentional, add '@EqualsAndHashCode(callSuper=false)' to your type.

原因

子类实体的equals/hasCode方法无法继承父类属性

解决方法一

@EqualsAndHashCode(callSuper = true)

Idea使用lombok时warn:Generating equals/hashCode implementation but without a call_第2张图片

解决方法二

加lombok.config配置文件
内容

config.stopBubbling=true
lombok.equalsAndHashCode.callSuper=call

Idea使用lombok时warn:Generating equals/hashCode implementation but without a call_第3张图片

你可能感兴趣的:(Idea,Idea)