忽略Lombok构建警告

警告: 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.

  • 原因:@Data 自动生成的 equals 和 hashCode 方法未调用父类的实现
  • 配置方法:lombok.equalsAndHashCode.callSuper=call
  • 解决原理:设置@Data生成的 equals 和 hashCode 方法包含对父类字段的处理

警告: @Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. If it is not supposed to be settable during building, make the field final.

  • 原因:@Builder 不会给字段进行默认值赋值
  • 配置方法:没有配置项,只能在需要的字段上加上 @Builder.Default
  • 解决:设置 build 方法赋值字段默认值

lombok.config可以放在项目文件夹外面,比如D盘根目录,这样编译也是生效的

相关推荐
无限聚核13 分钟前
PHP 对接美团、抖音团购核销接口:预核销、核销、重试和撤销一份代码跑通,无限聚核
开发语言·php·美团·团购核销接口
爪哇碎碎念22 分钟前
【Java】从一次 cache.get(key) 进去:缓存击穿一瞬间打出 200 次 DB,JDK 17 实测三种解法
java·redis·缓存
csdn_aspnet23 分钟前
Java 使总距离最短的最佳点位置(Optimum location of point to minimize total distance)
java·算法
源码_空间29 分钟前
基于Springboot的在线编程练习判题平台(源码+文档)
java·spring boot·后端
向科→向总工→空间动态计系统2 小时前
动态零轴融合三铁律
大数据·开发语言·人工智能·python·机器人
小手cool2 小时前
二分查找:在有序数组中查找最接近 target 的元素索引
java·数据结构·算法
李白的手机2 小时前
深入理解 Spring @RefreshScope:从入门用法到源码原理,再到举一反三实战扩展
java·后端·spring
深入云栈2 小时前
Netty 4.2.x 源码深度解析 (二十五):PoolThreadCache 与引用计数 —— 线程缓存与内存泄漏检测
java·后端·架构
砚底藏山河3 小时前
量化行情横截面中性化闭式与回归实现
android·java·python·金融·kotlin
西西弗Sisyphus3 小时前
C++ 最小 Agentic Loop 实现 - 开始实现 完整的内容
开发语言·c++