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

Support reified generics

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8.0pe
    • specification
    • None
    • generic
    • generic

      The Java language and Java SE should support reified generic types (aka 'true' generics)
      rather than the current scheme of type erasure. Intuitively, a programmer expects to
      be able to use a generic type wherever a non-generic type can be used. This is not
      the case with type erasure. Some advantages of reified generics are

      1. Getting rid of the unchecked warnings from javac attendant upon
      assigning objects of raw type to objects of the corresponding generic
      type and the cryptic ClassCastExceptions that can result therefrom at
      runtime.

      2. Allowing arrays of generic types and parametric cast, instanceof
      and catch operations.

      3. Allowing 'new' operations on parametric types, e.g., 'new T()'.

      4. Allowing the definition of per-instantiated-generic-type static
      fields.

            darcy Joe Darcy
            phh Paul Hohensee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: