Inspectopedia
 
2024.3

Array can be replaced with enum values

Info
New
Last modified: 03 December 2024

Reports arrays of enum constants that can be replaced with a call to EnumType.values().

Usually, when updating such an enum, you have to update the array as well. However, if you use EnumType.values() instead, no modifications are required.

Example:

After the quick-fix is applied:

New in 2019.1