Class SignatureDeclareThrowsExceptionRule

  • All Implemented Interfaces:
    JavaParserVisitor, ImmutableLanguage, PropertySource, Rule

    public class SignatureDeclareThrowsExceptionRule
    extends AbstractJavaRule
    A method/constructor shouldn't explicitly throw java.lang.Exception, since it is unclear which exceptions that can be thrown from the methods. It might be difficult to document and understand such vague interfaces. Use either a class derived from RuntimeException or a checked exception.

    This rule uses PMD's type resolution facilities, and can detect if the class implements or extends TestCase class

    Since:
    1.2
    Version:
    1.0
    Author:
    Trond Andersen