File tree Expand file tree Collapse file tree 4 files changed +130
-0
lines changed
testlib/src/main/resources/java/formatannotations Expand file tree Collapse file tree 4 files changed +130
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Annotations in the wrong order. The preferred order is:
2
+ // * declaration annotations
3
+ // * access modifiers such as `public`
4
+ // * type annotations
5
+ // * type
6
+
7
+ class FormatAnnotationsAccessModifiers {
8
+
9
+ @Nullable public Object myMethod1() {
10
+ return null;
11
+ }
12
+
13
+ @Nullable
14
+ public Object myMethod2() {
15
+ return null;
16
+ }
17
+
18
+ @Nullable
19
+ public
20
+ Object myMethod3() {
21
+ return null;
22
+ }
23
+
24
+ @Nullable
25
+ @Deprecated
26
+ public Object myMethod4() {
27
+ return null;
28
+ }
29
+
30
+ @Override
31
+ @Nullable
32
+ @Deprecated
33
+ public Object myMethod5() {
34
+ return null;
35
+ }
36
+
37
+ @Nullable @Deprecated public Object myMethod6() {
38
+ return null;
39
+ }
40
+ }
41
+
42
+ @Deprecated
43
+ @Interned
44
+ @MustCall("close")
45
+ @SuppressWarnings
46
+ public class MyClass3 {
47
+ // No body
48
+ }
49
+
50
+ public
51
+ @Deprecated
52
+ @SuppressWarnings
53
+ @Interned
54
+ @MustCall("close")
55
+ class MyClass4 {
56
+ // No body
57
+ }
Original file line number Diff line number Diff line change
1
+ // Annotations in the wrong order. The preferred order is:
2
+ // * declaration annotations
3
+ // * access modifiers such as `public`
4
+ // * type annotations
5
+ // * type
6
+
7
+ class FormatAnnotationsAccessModifiers {
8
+
9
+ @Nullable public Object myMethod1() {
10
+ return null;
11
+ }
12
+
13
+ @Nullable
14
+ public Object myMethod2() {
15
+ return null;
16
+ }
17
+
18
+ @Nullable
19
+ public
20
+ Object myMethod3() {
21
+ return null;
22
+ }
23
+
24
+ @Nullable
25
+ @Deprecated
26
+ public Object myMethod4() {
27
+ return null;
28
+ }
29
+
30
+ @Override
31
+ @Nullable
32
+ @Deprecated
33
+ public Object myMethod5() {
34
+ return null;
35
+ }
36
+
37
+ @Nullable @Deprecated public Object myMethod6() {
38
+ return null;
39
+ }
40
+ }
41
+
42
+ @Deprecated
43
+ @Interned
44
+ @MustCall("close")
45
+ @SuppressWarnings
46
+ public class MyClass3 {
47
+ // No body
48
+ }
49
+
50
+ public
51
+ @Deprecated
52
+ @SuppressWarnings
53
+ @Interned
54
+ @MustCall("close")
55
+ class MyClass4 {
56
+ // No body
57
+ }
Original file line number Diff line number Diff line change @@ -75,3 +75,12 @@ class FormatAnnotationsTest {
75
75
@Localized
76
76
String localized;
77
77
}
78
+
79
+ @Deprecated
80
+ @SuppressWarnings
81
+ public
82
+ @Interned
83
+ @MustCall("close")
84
+ class MyClass1 {
85
+ // No body
86
+ }
Original file line number Diff line number Diff line change @@ -49,3 +49,10 @@ class FormatAnnotationsTest {
49
49
50
50
@Localized String localized;
51
51
}
52
+
53
+ @Deprecated
54
+ @SuppressWarnings
55
+ public
56
+ @Interned @MustCall("close") class MyClass1 {
57
+ // No body
58
+ }
You can’t perform that action at this time.
0 commit comments