|
Re: What Features Would You Remove from Java?
|
Posted: Jun 12, 2007 11:07 AM
|
|
>The generic type of the underlying object is irrelevant/illusionary
That's an excellent way of expressing what I was trying to say! As I type the code I'm thinking "they use erasure, this is all an illusion, pay no attention to the man behind the curtain", yet I am required to go along with the illusion to make the compiler happy. It's jarring, and, if the types in the <> are long, tedious.
Maybe add static methods to the implementing types that mimic Collections.emptyList() in that they automatically fit the type? e.g.
List<Foo> fooList = ArrayList.new();
|
|