diff options
Diffstat (limited to 'src/test/resources/com/puppycrawl/tools/checkstyle/checks/suppresswarningsholder/InputSuppressWarningsHolder5.java')
-rw-r--r-- | src/test/resources/com/puppycrawl/tools/checkstyle/checks/suppresswarningsholder/InputSuppressWarningsHolder5.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/suppresswarningsholder/InputSuppressWarningsHolder5.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/suppresswarningsholder/InputSuppressWarningsHolder5.java new file mode 100644 index 000000000..bdf134927 --- /dev/null +++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/suppresswarningsholder/InputSuppressWarningsHolder5.java @@ -0,0 +1,50 @@ +package com.puppycrawl.tools.checkstyle.checks.suppresswarningsholder; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +import java.util.Map; + + +public class InputSuppressWarningsHolder5{ + + public static Object foo1(@SuppressWarnings("unsused") Object str) { + String myString = (@SuppressWarnings("unsused") String) str; + Object object = new @SuppressWarnings("unsused") Object(); + try { + return null; + + } catch (@SuppressWarnings("unsused") Exception ex) { + return ""; + } + } + + void foo2() throws @SuppressWarnings("unsused") Exception { } + + public void foo3() { + Map.@SuppressWarnings("unsused") Entry entry; + MyObject myObject = new MyObject(); + myObject.<@SuppressWarnings("unsused") String>myMethod(); + myObject.new @SuppressWarnings("unsused") MyObject2(); + } + + public static <T> void foo4(Object str) { + List<@SuppressWarnings("unsused") ? extends Comparable<T>> unchangeable; + } + + abstract class UnmodifiableList<T> + implements @SuppressWarnings("unsused") List<@SuppressWarnings("unsused") T> { + } + + class MyObject{ + + public void myMethod(){}; + + class MyObject2{} + } + + @Target(ElementType.TYPE_USE) + @interface SuppressWarnings { + String value(); + } +} |