View Javadoc
1   //start line index in expected file is 2
2   package com.puppycrawl.tools.checkstyle.grammar;
3   
4   import java.lang.annotation.ElementType;
5   import java.lang.annotation.Retention;
6   import java.lang.annotation.RetentionPolicy;
7   import java.lang.annotation.Target;
8   import java.util.ArrayList;
9   import java.util.Collections;
10  import java.util.Comparator;
11  import java.util.Map;
12  import java.util.List;
13  import java.util.function.IntBinaryOperator;
14  import java.util.function.Predicate;
15  import java.util.function.Supplier;
16  
17  public class InputRegressionJava8Class2 {
18      static class Inner1 { static class Inner2<V> { public void m() {} } }
19      static class Inner3<T> { public void m() {} }
20  
21      public void m1(@MyAnnotation String @MyAnnotation ... vararg) {}
22      public String m2() @MyAnnotation [] @MyAnnotation [] { return null; }
23  
24      public void instructions() {
25          // annotations
26          Map.@MyAnnotation Entry e;
27          String str = (@MyAnnotation String) "";
28          (new Inner3()).<@MyAnnotation String>m();
29          Object arr = new @MyAnnotation String @MyAnnotation [3];
30          for (String a @MyAnnotation [] : m2()) {}
31          Object arr2 = new @MyAnnotation int[3];
32      }
33  }
34  
35  @Retention(RetentionPolicy.CLASS)
36  @Target({ ElementType.TYPE_USE })
37  @interface MyAnnotation {
38  }