1
2
3
4
5
6
7
8 package com.puppycrawl.tools.checkstyle.checks.suppresswarningsholder;
9
10 import java.lang.annotation.ElementType;
11 import java.lang.annotation.Target;
12 import java.util.List;
13 import java.util.Map;
14
15
16 public class InputSuppressWarningsHolder5{
17
18 public static Object foo1(@SuppressWarnings("unused") Object str) {
19 String myString = (@SuppressWarnings("unused") String) str;
20 Object object = new @SuppressWarnings("unused") Object();
21 try {
22 return null;
23
24 } catch (@SuppressWarnings("unused") Exception ex) {
25 return "";
26 }
27 }
28
29 void foo2() throws @SuppressWarnings("unused") Exception { }
30
31 public void foo3() {
32 Map.@SuppressWarnings("unused") Entry entry;
33 MyObject myObject = new MyObject();
34 myObject.<@SuppressWarnings("unused") String>myMethod();
35 myObject.new @SuppressWarnings("unused") MyObject2();
36 }
37
38 public static <T> void foo4(Object str) {
39 List<@SuppressWarnings("unused") ? extends Comparable<T>> unchangeable;
40 }
41
42 abstract class UnmodifiableList<T>
43 implements @SuppressWarnings("unused") List<@SuppressWarnings("unused") T> {
44 }
45
46 class MyObject{
47
48 public void myMethod(){};
49
50 class MyObject2{}
51 }
52
53 @Target(ElementType.TYPE_USE)
54 @interface SuppressWarnings {
55 String value();
56 }
57 }