View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="SuppressWarnings"/>
5     </module>
6   </module>
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.annotation.suppresswarnings;
10  
11  // xdoc section -- start
12  // violation below 'The warning '' cannot be suppressed at this location'
13  @SuppressWarnings("")
14  class Example1 {
15    // violation below 'The warning '' cannot be suppressed at this location'
16    @SuppressWarnings("")
17    final int num1 = 1;
18    // ok below as default format only checks for a blank or empty string
19    @SuppressWarnings("all")
20    final int num2 = 2;
21    // ok below as default format only checks for a blank or empty string
22    @SuppressWarnings("unused")
23    final int num3 = 3;
24  
25    void foo1(@SuppressWarnings("unused") int param) {}
26  
27    @SuppressWarnings("all")
28    void foo2(int param) {}
29    @SuppressWarnings("unused")
30    void foo3(int param) {}
31    @SuppressWarnings(true?"all":"unused")
32    void foo4(int param) {}
33  }
34  // ok below as default format only checks for a blank or empty string
35  @SuppressWarnings("unchecked")
36  class Test1 {}
37  // xdoc section -- end