|
Brian Goetz recently posted about exception handling in Java (Remove checked exceptions?), and offered an excellent suggestion for eliminating duplicate code when catching multiple exception types. His idea is to allow disjunctive type bounds on catch clauses, so you could do something like this: public void addInstance(String className) { Not only is it prettier, it would also make code easier to read and maintain. |