'Enum.values()' is recommended to be replaced by 'Enum.entries' since 1.9
Reports calls from Kotlin to
values() method in enum classes that can be replaced with
entries property read.
Enum.entries may improve performance of your code.
The quick-fix replaces
entries property type is different from the return type of
values() method (
EnumEntries<T> which inherits from
List<T> instead of
Array<T>). Due to this in some cases quick fix inserts extra
.toTypedArray() conversion to not break the code, but for most common cases replacement will be done without it (e.g. in
After the quick-fix is applied:
IntelliJ IDEA 2023.3, Qodana for JVM 2023.3