Entries from March 2007 ↓

RE: Generics Microbenchmark

After the popularity of my “How’d this String get into my List<Integer>?!” post I decided to follow up with a few small benchmarks. I got the idea from Geoffrey Wiseman who read my previous post and wondered about Generics performance. Continue reading →

How’d this String get into my List<Integer>?!

I was having a discussion with some co-workers at the No Fluff Just Stuff conference this weekend about Java and incorrect types getting put into generic collection classes. Generics were introduced in Java 5 in 2004 to add a compile time type safety to allow a type or method to perform operations on objects of various uniform or related types. The discussion we had focused on the fact that generics do not accomplish what the language specification says they will accomplish by allowing objects of a different type into a generic object. Continue reading →