You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: proposals/enum-entries.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ Apart from that, most of the API being written leverages Collections API, not ar
34
34
35
35
*[HttpStatus.resolve allocates HttpStatus.values() once per invocation](https://github.com/spring-projects/spring-framework/issues/26842)
36
36
*[Kotlin standard library](https://github.com/JetBrains/kotlin/blob/92d200e093c693b3c06e53a39e0b0973b84c7ec5/libraries/stdlib/jvm/src/kotlin/text/CharCategoryJVM.kt#L170)
*[MySQL JDBC Remove Enum.values() calls to avoid unnecessary array](https://github.com/Microsoft/mssql-jdbc/pull/1065)
39
39
40
40
## Proposal
@@ -87,7 +87,7 @@ Various languages use different notations to refer to enumeration elements, maki
87
87
We have considered the following alternatives:
88
88
89
89
*`values` property. While being the most familiar one, it carries the burdens of the existing `values()` API:
90
-
* It is easy to misspel it with `values()` and fall into the same trap.
90
+
* It is easy to misspell it with `values()` and fall into the same trap.
91
91
* Introduction of `values` property adds an unfixable method reference ambiguity for all the callers of `E::values`.
92
92
* Java language [refers](https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.9.1) to enum elements as `constants`.
93
93
* The risks of introducing widely-used API named `constants` with the potential clashes with [Kotlin constant evaluation](https://youtrack.jetbrains.com/issue/KT-14652) outweighs the benefits of the straightforward name.
@@ -184,7 +184,7 @@ as well as artificial de-prioritization of `entries` member for multiple additio
184
184
### Developers familiarity with `values`
185
185
186
186
The second risk is the education disturbance and a new name for developers to get familiar with — `entries`, opposed to already well-known `values`.
187
-
It is mitigated by indefinitely long [soft decommision](#decommission-of-enumvalues) instead of a regular deprecation cycle, as well as by our learning materials, official recommendations and overall adoption over official tools and libraries.
187
+
It is mitigated by indefinitely long [soft decommission](#decommission-of-enumvalues) instead of a regular deprecation cycle, as well as by our learning materials, official recommendations and overall adoption over official tools and libraries.
0 commit comments