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

15.12.2.6: Clarify the return type of 'getClass'

    XMLWordPrintable

Details

    Description

      The longstanding special-case rule for invocations of 'getClass' has been that the return type is 'Class<? extends |T|>'. See 4.3.2.

      15.12.2.6 was modified in JLS 8 to mention this explicitly, but accidentally left off the erasure: 'Class<? extends T>'. There is some interest in making this language change (see JDK-6184881; compare JDK-5004321), but that was not the intent in JLS 8. It's simply a typo, and inconsistent with 4.3.2.

      Attachments

        Issue Links

          Activity

            People

              abuckley Alex Buckley
              dlsmith Dan Smith
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: