How to use Intellij to detect unused fields in a Java record?


IDE version: 2023.2.5 Ultimate Edition

As of right now, I can't seem to find a way to perform any kind of unused code detection for Java records.

Field name grey-out on unused code does not seem to work on the record's constructor, and code analysis shows nothing in its radar either.

1 comment
Official comment

Hello, “Unused declaration” inspection will report an unused record's constructor, but not fields. Please see the reasoning here

Please sign in to leave a comment.