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