February 10, 2005

astronaut monkeys?

Cedric suggests that the inconsistencies in Java 5 collections are there to preserve compatibility. Until I see an example, I won't be conviced (nudge, nudge...) ;)

Unless I'm way off base, binary compatibility wouldn't be broken. For an inside look, see Euxx.

After all, the runtime signature for
boolean remove(E element) is boolean remove(Object element) and for E[] toArray() it's Object[] toArray()

Source compatibility is not broken, either. If you're doing stuff like:

List list = new ArrayList();
list.add("hello");
list.remove(new Integer(1));

your code will still compile in Java 5.

And if you want to take advantage of generics, well, you have to abide by the new rules. Is that too much to ask for?

I'm starting to think astronaut monkeys may be the culprits ;)

0 Comments:

Post a Comment

<< Home