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