1
2
3
4
5
6
7
8
9
10 package com.puppycrawl.tools.checkstyle.checks.whitespace.nowhitespaceafter;
11
12 import java.lang.annotation.ElementType;
13 import java.lang.annotation.Retention;
14 import java.lang.annotation.RetentionPolicy;
15 import java.lang.annotation.Target;
16 import java.util.Map;
17
18 @Target(ElementType.TYPE_USE)
19 @interface NonNull {}
20
21 @Retention(RetentionPolicy.CLASS)
22 @Target({ElementType.TYPE_USE})
23 @interface MyAnnotation {
24 }
25 public class InputNoWhitespaceAfterArrayDeclarationsAndAnno {
26
27 @NonNull int @NonNull[] @NonNull[] field1;
28 @NonNull int @NonNull [] @NonNull [] field2;
29 int[] array[] = new int[2][2];
30 int array2[][][] = new int[3][3][3];
31
32 public void foo(final char @NonNull [] param) {}
33
34 public void m1(@NonNull String @NonNull ... vararg) {
35 }
36
37 public String m2()@NonNull[]@NonNull[] {
38 return null;
39 }
40
41 public void instructions() {
42
43 Map.@MyAnnotation Entry e;
44 String str = (@MyAnnotation String)"";
45 (new Inner3()).<@MyAnnotation String>m();
46 Object arr = new @MyAnnotation String@MyAnnotation[3];
47 for (String a@MyAnnotation[] : m2()) {
48 }
49 Object arr2 = new @MyAnnotation int[3];
50 }
51
52 static class Inner3<T> {
53 public void m() {
54 }
55 }
56
57 }