bugs.java.com
Bug ID: JDK-4106143 About polymorphism: changing the return type...
The following code give an example with the two classes aboveWe would get a simpler interface and better error messages when the method throws a ParseException. Actually, the parseObject method has no way to produce better error messages than "Parse failed".