View Javadoc
1   package com.google.checkstyle.test.chapter4formatting.rule413emptyblocks;
2   
3   import java.io.IOException;
4   
5   public class InputEmptyCatchBlockViolationsByVariableName
6   {
7       private void foo() {
8           try {
9               throw new RuntimeException();
10          } catch (Exception expected) //ok
11          {
12              
13          }
14      }
15      
16      private void foo1() {
17          try {
18              throw new RuntimeException();
19          } catch (Exception e) //warn
20          {}
21          
22      }
23      
24      private void foo2() {
25          try {
26              throw new IOException();
27          } catch (IOException | NullPointerException | ArithmeticException expected) //ok 
28          {
29          }
30      }
31      
32      private void foo3() { // comment
33          try {
34              throw new IOException();
35          } catch (IOException | NullPointerException | ArithmeticException e) //warn
36          {
37          }
38      }
39      
40      private void foo4() {
41          try {
42              throw new IOException();
43          } catch (IOException | NullPointerException | ArithmeticException expected) //ok
44          {
45          }
46      }
47      
48      private void foo5() {
49          try {
50              throw new IOException();
51          } catch (IOException | NullPointerException | ArithmeticException e) //warn
52          {
53          }
54      }
55      private void some() {
56          try {
57              throw new IOException();
58          } catch (IOException e) //warn
59          {
60              
61          }
62      }
63  }