View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="IllegalThrows">
5         <property name="illegalClassNames" value="NullPointerException"/>
6       </module>
7     </module>
8   </module>
9   */
10  package com.puppycrawl.tools.checkstyle.checks.coding.illegalthrows;
11  
12  // xdoc section -- start
13  public class Example2 {
14    void f1() throws RuntimeException {}
15    void f2() throws Exception {}
16    void f3() throws Error {}
17    void f4() throws Throwable {}
18    void f5() throws NullPointerException {} // violation
19    @Override
20    public String toString() throws Error {
21      String str = "";
22      return str;
23    }
24  }
25  // xdoc section -- end