IntelliJ识别Lombok @Data(staticConstructor="of")语法错误求助
Lombok @Data(staticConstructor="of") 代码可正常构建运行,但IntelliJ IDEA提示语法错误
使用Lombok的@Data(staticConstructor="of")注解后,代码能正常生成、构建并运行,但IntelliJ IDEA却提示该静态构造方法存在语法错误,推测是IDE索引功能异常。
IntelliJ IDEA版本信息
IntelliJ IDEA 2023.1 (Community Edition) Build #IC-231.8109.175, built on March 28, 2023 Runtime version: 17.0.6+10-b829.5 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 12.6 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 10 Metal Rendering is ON Registry: debugger.new.tool.window.layout=true ide.experimental.ui=true Kotlin: 231-1.8.20-IJ8109.175
已尝试的解决操作
- 执行
Invalidate & Clear Cache & Restart - 删除全局
.gradle目录 - 删除项目下的
/build、.gradle、.idea目录
以上操作均未解决问题。
示例代码
@Data(staticConstructor = "of") @ApiModel public class Student { private final String id; private final StudentDetails details; }
内容的提问来源于stack exchange,提问作者leon
相关产品推荐
相关产品推荐

