Inspectopedia
 
2024.3

Record pattern can be used

Warning
New
Last modified: 03 December 2024

Reports patterns that can be replaced with record patterns.

Example:

After the quick-fix is applied:

This inspection depends on the Java feature 'Pattern guards and record patterns', which is available since Java 21.

New in 2023.1