JDK-8257639 : Update usage of "type" terminology in java.lang.Enum & java.lang.Record
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-12-02
  • Updated: 2020-12-17
  • Resolved: 2020-12-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b28Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
JLS changes for JDK-8246772 include those described in the "Consistent Class and Interface Terminology" document: https://download.java.net/java/early_access/jdk16/docs/specs/class-terminology-jls.html

This imposes a stricter discipline for distinguishing between *classes and interfaces* vs. *types*. A similar discipline should be applied, where possible, to key Java SE API specs. (Obviously, class and method names used by the APIs themselves must remain unchanged.)

java.lang.Enum and java.lang.Record should be reviewed to avoid inappropriate use of the term "type". For example, the terms "enum type" and "record type" should be replaced, respectively, with "enum class" and "record class".

The summary of the "Consistent Class and Interface Terminology" document is reproduced here:

"The following terminology is preferred: a class declaration or an interface declaration is a syntactic structure that introduces a class or an interface, respectively. Various class and interface declarations have different syntactic forms, and can appear in different contexts, per the grammar. An enum declaration introduces a special kind of class, an enum class. An annotation declaration introduces a special kind of interface, an annotation interface."

"A class type or an interface type is the type of a variable or an expression, where the type names a class or interface. The word type should be avoided when talking about a class or interface itself, or its declaration. For example, "member type" is not appropriate. (As an exception, we continue to use type name to describe a name that refers to a class, interface, or type parameter.)"

"Each class has a direct superclass type and direct superinterface types. These can be mapped to a direct superclass and direct superinterfaces when the extra information supplied by types (e.g., type arguments) is irrelevant. Through transitive closure, we can talk more generally about superclass types, superinterface types, superclasses, and superinterfaces."

Comments
Changeset: 5bdce9b9 Author: Julia Boes <jboes@openjdk.org> Date: 2020-12-09 09:32:22 +0000 URL: https://git.openjdk.java.net/jdk/commit/5bdce9b9
09-12-2020

java.lang.Record is mostly good already, although I notice "Record Type" in a JLS cross-reference.
02-12-2020