Skip to content

Commit a7e5c40

Browse files
committed
Add type annotations test, always run gradle tests
1 parent 52cf4cc commit a7e5c40

4 files changed

Lines changed: 132 additions & 0 deletions

File tree

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ test {
187187
provider.launchers.put(k, v)
188188
}
189189
jvmArgumentProviders << provider
190+
191+
// Always run tests
192+
outputs.upToDateWhen { false }
190193
}
191194

192195
jar {

test/org/jetbrains/java/decompiler/SingleClassesTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,8 @@ private void registerDefault() {
737737

738738
// TODO: for loop shouldn't be made here
739739
register(JAVA_8, "TestWhileLoopPromotion");
740+
741+
register(JAVA_8, "TestTypeAnnotations");
740742
}
741743

742744
private void registerEntireClassPath() {
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
package pkg;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Target;
5+
6+
public class TestTypeAnnotations {
7+
@TestTypeAnnotations.Anno
8+
public TestTypeAnnotations.Inner a;
9+
public TestTypeAnnotations.Inner b;
10+
@TestTypeAnnotations.Anno
11+
public TestTypeAnnotations.InnerStatic c;
12+
public TestTypeAnnotations[] d;
13+
@TestTypeAnnotations.Anno
14+
public TestTypeAnnotations[] e;
15+
16+
@TestTypeAnnotations.Anno
17+
public TestTypeAnnotations.Inner a() {
18+
return null;// 27
19+
}
20+
21+
public TestTypeAnnotations.Inner b() {
22+
return null;// 31
23+
}
24+
25+
@TestTypeAnnotations.Anno
26+
public TestTypeAnnotations.InnerStatic c() {
27+
return null;// 35
28+
}
29+
30+
public TestTypeAnnotations[] d() {
31+
return null;// 39
32+
}
33+
34+
@TestTypeAnnotations.Anno
35+
public TestTypeAnnotations[] e() {
36+
return null;// 43
37+
}
38+
39+
@Target(ElementType.TYPE_USE)
40+
public @interface Anno {
41+
}
42+
43+
public class Inner {
44+
}
45+
46+
public static class InnerStatic {
47+
}
48+
}
49+
50+
class 'pkg/TestTypeAnnotations' {
51+
method 'a ()Lpkg/TestTypeAnnotations$Inner;' {
52+
0 17
53+
1 17
54+
}
55+
56+
method 'b ()Lpkg/TestTypeAnnotations$Inner;' {
57+
0 21
58+
1 21
59+
}
60+
61+
method 'c ()Lpkg/TestTypeAnnotations$InnerStatic;' {
62+
0 26
63+
1 26
64+
}
65+
66+
method 'd ()[Lpkg/TestTypeAnnotations;' {
67+
0 30
68+
1 30
69+
}
70+
71+
method 'e ()[Lpkg/TestTypeAnnotations;' {
72+
0 35
73+
1 35
74+
}
75+
}
76+
77+
Lines mapping:
78+
27 <-> 18
79+
31 <-> 22
80+
35 <-> 27
81+
39 <-> 31
82+
43 <-> 36
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package pkg;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Target;
5+
6+
public class TestTypeAnnotations {
7+
@Target(ElementType.TYPE_USE)
8+
public @interface Anno {
9+
10+
}
11+
12+
public class Inner {
13+
14+
}
15+
16+
public static class InnerStatic {
17+
18+
}
19+
20+
public @Anno TestTypeAnnotations.Inner a;
21+
public TestTypeAnnotations.@Anno Inner b;
22+
public TestTypeAnnotations.@Anno InnerStatic c;
23+
public @Anno TestTypeAnnotations[] d;
24+
public TestTypeAnnotations @Anno [] e;
25+
26+
public @Anno TestTypeAnnotations.Inner a() {
27+
return null;
28+
}
29+
30+
public TestTypeAnnotations.@Anno Inner b() {
31+
return null;
32+
}
33+
34+
public TestTypeAnnotations.@Anno InnerStatic c() {
35+
return null;
36+
}
37+
38+
public @Anno TestTypeAnnotations[] d() {
39+
return null;
40+
}
41+
42+
public TestTypeAnnotations @Anno [] e() {
43+
return null;
44+
}
45+
}

0 commit comments

Comments
 (0)