View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="ThrowsCount">
5         <property name="ignorePrivateMethods" value="false"/>
6       </module>
7     </module>
8   </module>
9   */
10  
11  package com.puppycrawl.tools.checkstyle.checks.design.throwscount;
12  
13  // xdoc section -- start
14  public class Example3 {
15    // violation below, 'Throws count is 5 (max allowed is 4)'
16    public void myFunction() throws CloneNotSupportedException,
17                                  ArrayIndexOutOfBoundsException,
18                                  StringIndexOutOfBoundsException,
19                                  IllegalStateException,
20                                  NullPointerException {
21    }
22  
23    public void myFunc() throws ArithmeticException,
24                                  NumberFormatException,
25                                  NullPointerException {
26    }
27    // violation below, 'Throws count is 5 (max allowed is 4)'
28    private void privateFunc() throws CloneNotSupportedException,
29                                  ClassNotFoundException,
30                                  IllegalAccessException,
31                                  ArithmeticException,
32                                  ClassCastException {
33    }
34  
35    private void func() throws IllegalStateException,
36                                  NullPointerException {
37    }
38  }
39  // xdoc section -- end