RSS

Tag Archives: declarations

Method Exception Signature

In short, all interface methods, if they throw anything, should be declared to throw ‘java.lang.Exception’ and never a specialized exception class.  Find this surprising? then please read on.  The original goal to allow methods to declare the type of exceptions they might throw was a valiant attempt to clarify program behavior, but unfortunately it was misguided, does not work, and if used incorrectly can turn into a maintenance nightmare. Read the rest of this entry »

 
3 Comments

Posted by on April 4, 2013 in Coding, Design

 

Tags: , , , , , ,