Search |
||
Raw type, rare type and preparing the futurePosted by forax on November 4, 2008 at 6:49 AM PST
We live in a post-generics world,
recently, October 30th, 2008,
J2SE 1.4.2 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
(bug
6753718) because it generates too many warnings.
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 generics 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.
Cheers,
»
Related Topics >>
Open JDK Comments
Comments are listed in date ascending order (oldest first)
Submitted by cowwoc on Wed, 2008-11-05 22:15.
Forget warnings. Javac should begin issuing *errors* for raw types. Developers have had over half a decade to migrate, and doing so is easy.
Let's make the jump already!
|
||
|
|