Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8257637

Update usage of "type" terminology in java.lang.annotation



    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 16
    • 16
    • core-libs
    • None
    • b29



        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.annotation should be reviewed to avoid inappropriate use of the term "type". For example, the frequently-used "annotation type" should be replaced with "annotation interface".

        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."


          Issue Links



                jboes Julia Boes (Inactive)
                dlsmith Dan Smith
                0 Vote for this issue
                3 Start watching this issue