JDK-8226563 : Documentation on type erasure is wrong
  • Type: Bug
  • Component: docs
  • Sub-Component: tutorial
  • Affected Version: 8u212
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_ubuntu
  • CPU: x86
  • Submitted: 2019-06-20
  • Updated: 2021-02-25
  • Resolved: 2021-02-25
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.