View Javadoc
1   /*
2   IllegalCatch
3   illegalClassNames = java.lang.Error, java.lang.Exception, NullPointerException, \
4                       OneMoreException, RuntimeException, SQLException
5   
6   
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.coding.illegalcatch;
10  
11  public class InputIllegalCatchCheckMultipleExceptions {
12      public void foo() throws OneMoreException {
13          try {
14                  foo1();
15          } catch (RuntimeException | SQLException e) {} // 2 violations
16          try {
17                  foo1();
18          } catch (RuntimeException | SQLException | OneMoreException e) {} // 3 violations
19          try {
20                  foo1();
21          } catch (OneMoreException | RuntimeException | SQLException e) {} // 3 violations
22          try {
23                  foo1();
24          } catch (OneMoreException | SQLException | RuntimeException e) {} // 3 violations
25  
26      }
27  
28      private void foo1() throws RuntimeException, SQLException, OneMoreException {
29  
30      }
31  
32      private class SQLException extends Exception {
33  
34      }
35  
36      private class OneMoreException extends Exception {
37  
38      }
39  }