如何抑制此警告?

How do I suppress this warning?

如何让 intellij 关闭“Class can be a record”警告? 它建议的快速修复只是使 class 成为记录。

由于没有明确的@SuppressWarnings子句,隐藏这个警告只能在你的IDE.

中直接配置

事实上,IntelliJ IDEA 有专门的设置。

  • Settings window 中搜索 Inspections "Can be a record".
  • Can be a record 检查的严重性切换为 No highlighting, only fix