View Javadoc
1   /*
2   SuppressWarnings
3   format = (default)^\s*+$
4   tokens = (default)CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF, \
5            ENUM_CONSTANT_DEF, PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF, CTOR_DEF, \
6            COMPACT_CTOR_DEF, RECORD_DEF
7   
8   
9   */
10  
11  package com.puppycrawl.tools.checkstyle.checks.annotation.suppresswarnings;
12  
13  public class InputSuppressWarningsHolder {
14      static final String UN_U = "UN_U";
15  
16      @SuppressWarnings(UN_U)
17      int a;
18      @SuppressWarnings(InputSuppressWarningsHolder.UN_U)
19      int b;
20      @SuppressWarnings(
21  com.puppycrawl.tools.checkstyle.checks.annotation.suppresswarnings.InputSuppressWarningsHolder.UN_U)
22      int c;
23      @SuppressWarnings(value = UN_U)
24      int d;
25      @SuppressWarnings(value = InputSuppressWarningsHolder.UN_U)
26      int e;
27      @SuppressWarnings(value =
28  com.puppycrawl.tools.checkstyle.checks.annotation.suppresswarnings.InputSuppressWarningsHolder.UN_U)
29      int f;
30      @SuppressWarnings((1 != 1) ? "" : "UN_U") // violation
31      int g;
32      @SuppressWarnings("un" + "used")
33      int h;
34      @SuppressWarnings((String) "UN_U")
35      int i;
36      @SuppressWarnings({}) // violation
37      int j;
38      @SuppressWarnings({UN_U})
39      int k;
40  }
41  
42  class CustomSuppressWarnings {
43      @SuppressWarnings // violation
44      private @interface SuppressWarnings {
45      }
46  }