The same can't be said for Java. Case in point is its generics implementation. For those of you who don't know, Java's generics is done through type erasure. That means that when you have some parameterized type like List
Why is this an issue? Namely it has led to very restrictive uses of the parameterized type in actual code. If I define a method or class to take a parameterized type of T, I can basically use that in places where a type normally might be found, but only as long as I don't try to do anything with the type itself. What this means is that using T in variable declarations is fine, but I can't work with T directly.
Normally this restriction is not a big deal. But what if you want to write a generic method that dispatches based on an argument and the generic type comes into play? An instance of this might be a generic equal() method that does nothing more than check if the argument to the method is a compatible type with T. Well, you can't do that. Try doing T.class or T.getClass() and see the lovely error message the Java compiler tosses you.
Now I can understand not allowing this if I was asking for random methods off the type. But getClass() is defined on Object, the base object type that all objects inherit from! There is no chance (to my knowledge) of setting a parameterized type to an object that does not inherit from Object! So why the hell can't I call methods that are on all objects on a generic type?!?
I eventually got around it by declaring a protected attribute that held a Class object and explicitly set it to what the type parameter is for subclasses. That's really hackish and stupid thing to have to do.
And within a short amount of time after that I had AspectJ and Eclipse piss me off. My work involves taking existing Java applications, applying AspectJ to them externally, and then running them with some extra stuff to the JVM (sorry for being vague, but I am holding off until I have a publication to really go into detail about what I am working on so I have something to point people to). Trying to get Eclipse projects to compile and weaving together turned out to be quite the hassle. So much so, in fact, that I am going to learn Apache Ant properly and use that for weaving and executing my AspectJ projects. It also doesn't help that Eclipse's AJDT plug-in does weaving MUCH slower than doing it through the command-line.
Overall a frustrating week. I am now behind where I wanted to be thanks to having wrestle with this crap. Bah.