View Javadoc
1   package com.puppycrawl.tools.checkstyle.checks.modifier.redundantmodifier;
2   
3   import java.io.BufferedReader;
4   import java.io.FileReader;
5   import java.io.IOException;
6   import java.io.InputStreamReader;
7   import java.lang.annotation.ElementType;
8   import java.lang.annotation.Target;
9   
10  public class InputRedundantModifierFinalInTryWithResource {
11      public static void test() {
12          try {
13          }
14          catch (RuntimeException e) {
15          }
16  
17          try (@NotNull BufferedReader br = new BufferedReader(new InputStreamReader(null, "utf-8"))) {
18          }
19          catch (IOException e) {
20          }
21  
22          try (final BufferedReader br = new BufferedReader(new InputStreamReader(null, "utf-8"))) {
23          }
24          catch (IOException e) {
25          }
26  
27          try (final BufferedReader br = new BufferedReader(new InputStreamReader(null, "utf-8"));
28                  final BufferedReader br2 = new BufferedReader(new InputStreamReader(null, "utf-8"))) {
29          }
30          catch (IOException e) {
31          }
32      }
33  }
34  
35  @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})
36  @interface NotNull {
37  }