Previous article

next article

On Access Restriction with Java Wildcards

Mirko Viroli, DEIS, Alma Mater Studiorum - Università di Bologna, Italy
Giovanni Rimassa, Whitestein Technologies AG, Zurich, Switzerland


PDF Version


Java wildcards is a new programming mechanism shipped with the Java 5.0 release, introduced to provide a flexible subtyping mechanism for generic types. Safety is retained by providing rather peculiar and non-trivial mechanisms to restrict access to a class functionalities (methods and fields), which are currently not deeply described in the Java Language Specification. In this paper we develop on the theory of variant parametric types from which wildcards originated, and study a framework to describe these access restriction issues in detail, promoting the understanding and fruitful exploitation of this new programming concept.

Our work is both technical and conceptual. On the one hand, we provide an abstract characterisation of formal rules to access restriction, then instantiated to the particular implementation of wildcards in current Java. On the other hand, we show that such a characterisation induces a natural description and understanding of access restriction in terms of the ability of (instances of) a generic class to produce/consume elements of the abstracted type.

Note: Due to the typographical sophistication of this article, no HTML version is available. Please use the PDF version.


About the authors


Mirko Viroli is a researcher associated with DEIS department, Alma Mater Studiorum - Università di Bologna, Italy. His interests cover advanced features of object-oriented programming languages, and engineering of concurrent and agent-based systems. He can be reached at See also˜mviroli.


Giovanni Rimassa is employed by Whitestein Technologies AG, Switzerland, in a senior researcher position. He leads the development of infrastructures and APIs for agent-based systems. He can be reached at

Cite this article as follows: Mirko Viroli and Giovanni Rimassa: “On Access Restriction with Java Wildcards”, in Journal of Object Technology, vol. 4, no. 10, Special Issue: OOPS Track at SAC 2005, Santa Fe USA, December 2005, pp. 117-139

Previous article

next article