Providing runtime information about generic types---that is, reifying generics---is a challenging problem studied in several research papers in the last years. However, the quest for finding effective and efficient solutions specifically targeted to the Java programming language is still open. In particular, the new mechanism of wildcards introduced in Java 5.0 significantly complicates the overall semantics of generics: its reification aspects are currently unexplored and pose serious implementation issues. In this paper we analyse such issues and study how they have been supported in the context of the EGO compiler. EGO is an approach for efficiently supporting runtime generics at compile-time in Java: synthetic code is automatically added to the source code by the compiler, so as to create generic runtime type information on a by-need basis, store it into object instances, and retrieve it when necessary in type-dependent operations. We show how the design of EGO has been completely and successfully extended to represent wildcard types, and how we deal with subtle issues concerning subtyping, capture conversion and wildcards capture in method calls.
M. Cimadamore, M. Viroli (2007). Reifying Wildcards in Java Using the EGO Approach. NEWYORK : ACM.
Reifying Wildcards in Java Using the EGO Approach
CIMADAMORE, MAURIZIO;VIROLI, MIRKO
2007
Abstract
Providing runtime information about generic types---that is, reifying generics---is a challenging problem studied in several research papers in the last years. However, the quest for finding effective and efficient solutions specifically targeted to the Java programming language is still open. In particular, the new mechanism of wildcards introduced in Java 5.0 significantly complicates the overall semantics of generics: its reification aspects are currently unexplored and pose serious implementation issues. In this paper we analyse such issues and study how they have been supported in the context of the EGO compiler. EGO is an approach for efficiently supporting runtime generics at compile-time in Java: synthetic code is automatically added to the source code by the compiler, so as to create generic runtime type information on a by-need basis, store it into object instances, and retrieve it when necessary in type-dependent operations. We show how the design of EGO has been completely and successfully extended to represent wildcard types, and how we deal with subtle issues concerning subtyping, capture conversion and wildcards capture in method calls.I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.