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