RFR: 8257639: Update usage of "type" terminology in java.lang.Enum & java.lang.Record
Julia Boes
jboes at openjdk.java.net
Tue Dec 8 10:44:14 UTC 2020
On Mon, 7 Dec 2020 18:22:33 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> This change applies a stricter semantic distinction of 'type' versus 'class and interface'. This is based on the JLS changes described in the "Consistent Class and Interface Terminology" document: https://download.java.net/java/early_access/jdk16/docs/specs/class-terminology-jls.html.
>>
>> The following rules were applied:
>> - 'class' and/or 'interface' are used when referring to the class/interface itself
>> - 'type' is used when referring to the type of a variable or expression
>
> src/java.base/share/classes/java/lang/Enum.java line 62:
>
>> 60: * java.util.EnumMap map} implementations are available.
>> 61: *
>> 62: * @param <E> The enum class subclass
>
> I wonder about this one, given that `<E>` is a type. It sounds strange to me - even though I understand that what is meant is that this type should point to a class (a subclass of `java.lang.Enum`).
Makes sense. I suggest the following instead: `The type of enum subclass`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1670
More information about the core-libs-dev
mailing list