Raw type, rare type and preparing the future
We live in a post-generics world,
recently, October 30th, 2008,
has reach its
End Of Service Life.
I think it's a coincidence but Maurizio Cimadamore
decide to introduce
a long requested feature in javac,
it now emit a warning for all usages of raw types
(a parameterized type without '<>').
And frankly, we (all Java developers) seem not ready for that.
To take an example, just after putback that change into jdk
workspace, the Xlint:rawtypes
was disable by default when the JDK is compiled
6753718) because it generates too many warnings.
Only JMX Team takes time to
browse its workspace and remove all raw types
Though we was warned by the JLS (4.8)
The use of raw types is allowed only as a concession
to compatibility of legacy code.
The use of raw types in code written after the introduction of genericity
into the Java programming language is strongly discouraged.
It is possible that future versions of the Java programming language
will disallow the use of raw types
we are not ready :(
So why should we remove those warnings. To prepare the future.
Lot of people whine (and i'm one of those) because
are not reify at runtime. But generics
can't be reified
until you're code contains raw types.
So to prepare the future, please fix all these raw type
warnings in your code.