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

Documentation on type erasure is wrong

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u212
    • Fix Version/s: None
    • Component/s: docs
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux_ubuntu

      Description

      A DESCRIPTION OF THE PROBLEM :
      When explaining the hazards of type erasure and bridge methods, the documentation(https://docs.oracle.com/javase/tutorial/java/generics/bridgeMethods.html) says that a ClassCastException is thrown at a certain statement, when it actually gets thrown in the previous statement. It is not just a typo, the last statement is purposefully used to demonstrate the issue, but the issue is actually in the assignment that the compiler generates in the bridge method.

      Please see this Stack Overflow question from 2016 for further details https://stackoverflow.com/questions/35970031/type-erasure-tutorial-on-java.


        Attachments

          Activity

            People

            Assignee:
            rgallard Raymond Gallardo
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: