[JSR308] Wrapper types
mernst at csail.mit.edu
Tue Mar 4 02:59:58 EST 2008
A type system is a useful verification tool, but like any other tool has
its limitations. Badly-written code may not pass the type system -- maybe
because it's not safe!
When a container is used heterogeneously, there is no way, in general, for
a static analysis to know the specific type of each element; typically, the
analysis makes conservative assumptions about the contents. Furthermore,
if you want static guarantees about the code, then you also need to avoid
constructs like casts and reflection that circumvent the type system; a
static checker could warn about these.
More information about the JSR308