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

Documentation on type erasure is wrong

XMLWordPrintable

    • x86
    • linux_ubuntu

      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.


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

              Created:
              Updated:
              Resolved: