The cost of erasure in Java generics type system

  • Authors:
  • Jaime Niño

  • Affiliations:
  • University of New Orleans, New Orleans, LA

  • Venue:
  • Journal of Computing Sciences in Colleges
  • Year:
  • 2007

Quantified Score

Hi-index 0.01

Visualization

Abstract

Java generics in versions 1.5 and later, are implemented by generating only one byte code representation of a generic type or method via type erasure. The essence of type erasure is the removal at compilation of all information that is related to generic type parameters and corresponding type arguments. From the point of view of the student, (s)he is left to negotiate a series of compiler and run-time errors that have little to do with programming errors but a lot to do with the Java generics implementation choice leaving sometimes with no alternative but to live with unclean compiles and a seemingly weaker type system.