Well, the motivation (backwards compatibility) is both an advantage and a disadvantage. It is disadvantage because we all would prefer to have reifiable types, but the price to pay was high. Consider the design choices in C#. They have reifiable types, but now they have duplicate APIs. So, imagine a Java API where we also had duplicate APIs for every parameterized class. Now, picture yourself porting thousands of lines of code from legacy classes to the new generic classes. Now, who would not consider duplicate APIs a disadvantage? But hey, they have reifiable types!
So, the major motivation was "evolution, not revolution". And logically, every decision has tradeoffs.
Besides the other disadvantages mentioned, we could also add the fact that type erasure can be difficult to reason about at compile time, since it is not evident that certain types will be removed, and this leads to very weird and hard to find errors.
The existence of bridge methods (this compiler syntactically-generated methods to keep binary compatibility) can also be seen as disadvantage. And these can be precisely one of the reasons of errors I mentioned in the previous paragraph.
Major disadvantages derive from the already obvious fact that there is a single class and not multiple classes for generic types. As another example consider that overloading a method with same generic class fails in Java:
public void doSomething(List<One>);
public void doSomething(List<Two>);
Something that could be seen as a disadvantage of reifiable types (at least in C#) is the fact that they cause code explosion. For instance List<int>
is one class, and a List<double>
is another totally different, as it is a List<string>
and a List<MyType>
. So classes have to be defined at runtime, causing an explosion of classes and consuming valuable resources while they are being generated.
Regarding the fact that it is not possible to define a new T()
in Java, mentioned in another answer, it is also interesting to consider that this is not only a matter of type erasure. It also requires the existence of a default constructor, that is why C# requires a "new constraint" for this. (See Why new T() is not possible in Java, by Alex Buckley).