Artigo Revisado por pares

The cost of erasure in Java generics type system

2007; Consortium for Computing Sciences in Colleges; Volume: 22; Issue: 5 Linguagem: Inglês

ISSN

1937-4771

Autores

Jaime Niño,

Tópico(s)

Software Engineering and Design Patterns

Resumo

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.

Referência(s)