#519 IllegalThrows: allow forbidden exceptions on method override

open
nobody
Check (274)
5
2012-10-10
2009-05-15
Paul Holser
No

It would be nice if IllegalThrows had a facility to allow forbidden exceptions in throws clauses of methods that are overrides (class)/implementations (interface) of methods that themselves declare forbidden exceptions in their throws. For example, if I am creating a java.lang.reflect.InvocationHandler, it might be perfectly fine to declare my implement invoke() as "throws Throwable", since the interface method I'm implementing does -- but I may wish to still disallow indiscriminate "throws Throwable" clauses elsewhere.

Discussion