Open Access. Powered by Scholars. Published by Universities.®

Physical Sciences and Mathematics Commons

Open Access. Powered by Scholars. Published by Universities.®

PDF

Mathematics, Physics, and Computer Science Faculty Articles and Research

2008

Genericity

Articles 1 - 1 of 1

Full-Text Articles in Physical Sciences and Mathematics

The Java 5 Generics Compromise Orthogonality To Keep Compatibility, Atanas Radenski, Jeff Furlong, Vladimir Zanev Jan 2008

The Java 5 Generics Compromise Orthogonality To Keep Compatibility, Atanas Radenski, Jeff Furlong, Vladimir Zanev

Mathematics, Physics, and Computer Science Faculty Articles and Research

In response to a long-lasting anticipation by the Java community, version 1.5 of the Java 2 platform - referred to as Java 5 - introduced generic types and methods to the Java language. The Java 5 generics are a significant enhancement to the language expressivity because they allow straightforward composition of new generic classes from existing ones while reducing the need for a plethora of type casts. While the Java 5 generics are expressive, the chosen implementation method, type erasure, has triggered undesirable orthogonality violations. This paper identifies six cases of orthogonality violations in the Java 5 generics and demonstrates …