mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-27 00:21:29 +00:00
Compare commits
1379 Commits
script_run
...
v1.0.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc89385f08 | ||
|
|
66095904ff | ||
|
|
95c63f8cd8 | ||
|
|
a7645ade35 | ||
|
|
3721618718 | ||
|
|
cc86d79c6f | ||
|
|
3aae9904f7 | ||
|
|
dfadd17d05 | ||
|
|
0780de8df8 | ||
|
|
09d857b86d | ||
|
|
f9860cb0ed | ||
|
|
94f899107c | ||
|
|
d8078fbdd1 | ||
|
|
900c677d19 | ||
|
|
e8afbf19af | ||
|
|
2ce3418271 | ||
|
|
4dcb9c48f9 | ||
|
|
fde8006ba9 | ||
|
|
ce51dd54b8 | ||
|
|
37099358ac | ||
|
|
faf64ee887 | ||
|
|
1941e175e9 | ||
|
|
23b56e6736 | ||
|
|
7e54673690 | ||
|
|
d5f24582e4 | ||
|
|
37a21f7ddd | ||
|
|
eb61c3985f | ||
|
|
ca06b5ceb3 | ||
|
|
14e677ff83 | ||
|
|
999660d0e2 | ||
|
|
974bbe797f | ||
|
|
a780a34ebd | ||
|
|
a0f99a3210 | ||
|
|
6856a7c36b | ||
|
|
c8b30d3310 | ||
|
|
6ef66e7736 | ||
|
|
6177b2bd2d | ||
|
|
c4b772abc8 | ||
|
|
7e9a2090bf | ||
|
|
5f2d3c42d8 | ||
|
|
4cb2127127 | ||
|
|
c611f9b2db | ||
|
|
880e183d84 | ||
|
|
550b1c0bea | ||
|
|
3954c71af2 | ||
|
|
89ba634972 | ||
|
|
19ce4cb967 | ||
|
|
461c29de50 | ||
|
|
f78b8b4272 | ||
|
|
91444c59ff | ||
|
|
c60c5afd95 | ||
|
|
e2e761ed95 | ||
|
|
ecad1c38e0 | ||
|
|
84c4ff7afb | ||
|
|
f7b5d34ebb | ||
|
|
1b0757f1e2 | ||
|
|
b7c54e5a70 | ||
|
|
7c188b38d6 | ||
|
|
ecae5c6b57 | ||
|
|
aac8e94c1f | ||
|
|
ec7a21a57d | ||
|
|
3beb65d78a | ||
|
|
ed77d57094 | ||
|
|
b857df261f | ||
|
|
bc17859654 | ||
|
|
8830ff7263 | ||
|
|
7ae9b6b3da | ||
|
|
23961eefbe | ||
|
|
be2adafde4 | ||
|
|
07643ce8c7 | ||
|
|
30dd52e2a1 | ||
|
|
3891d76d22 | ||
|
|
eec4b1b860 | ||
|
|
22c7ee5fa7 | ||
|
|
d5f7c3fc0d | ||
|
|
f64d60e50b | ||
|
|
d952dbd768 | ||
|
|
48faf4a8e9 | ||
|
|
a1f91cab83 | ||
|
|
a300d2c7f6 | ||
|
|
01742aacbf | ||
|
|
ed34ec0a7f | ||
|
|
5f50ab6a0e | ||
|
|
5e9eab9948 | ||
|
|
d8101198fd | ||
|
|
f95a3d1aa3 | ||
|
|
a0b477a552 | ||
|
|
973e2a8987 | ||
|
|
f01daf4ffa | ||
|
|
c3c4e7dc6c | ||
|
|
db24fe86cf | ||
|
|
9bfbdd9f83 | ||
|
|
4e696c7723 | ||
|
|
845d1742a3 | ||
|
|
28a1b44845 | ||
|
|
74ef68c2d8 | ||
|
|
41c4957125 | ||
|
|
2eee4b0738 | ||
|
|
5aa114133f | ||
|
|
00e925549f | ||
|
|
1daee05332 | ||
|
|
76109453c0 | ||
|
|
36b0b52632 | ||
|
|
0d89dc37f6 | ||
|
|
53079c1ef8 | ||
|
|
f2e5d3c2c1 | ||
|
|
64a7fccc44 | ||
|
|
6dd7e4c221 | ||
|
|
b625d75da1 | ||
|
|
0a27a99680 | ||
|
|
1b6c96cdee | ||
|
|
b96f97831b | ||
|
|
0d63004e29 | ||
|
|
c7ae2e91eb | ||
|
|
0fb8f49938 | ||
|
|
cd3f6d6c63 | ||
|
|
a3eebe3561 | ||
|
|
ad4c7d54f5 | ||
|
|
3ee20d9a71 | ||
|
|
67543b061d | ||
|
|
dfa4b7f1bc | ||
|
|
21e24a1624 | ||
|
|
1f34c8d649 | ||
|
|
9c8605f59e | ||
|
|
3ab6f88e1d | ||
|
|
85ce65c5d3 | ||
|
|
670e651f39 | ||
|
|
b4cee026d5 | ||
|
|
2eff9cd4a7 | ||
|
|
76a35a7e5b | ||
|
|
0617df933b | ||
|
|
d583809ed7 | ||
|
|
a61bce207c | ||
|
|
f9a2c3a669 | ||
|
|
1eb279830c | ||
|
|
ccd1c11f1f | ||
|
|
43400200c0 | ||
|
|
bd126420b6 | ||
|
|
65cfb6062d | ||
|
|
f21a8c1681 | ||
|
|
dd50c29cad | ||
|
|
0c43ff0068 | ||
|
|
d975f21e99 | ||
|
|
d6d3846137 | ||
|
|
cf1bdba2cf | ||
|
|
467d0fd10f | ||
|
|
bb370f1732 | ||
|
|
1391e597b4 | ||
|
|
9686344ade | ||
|
|
a9c77e1d69 | ||
|
|
3ced8a677f | ||
|
|
02a3e6bafe | ||
|
|
b248b2062f | ||
|
|
6e72dc83bc | ||
|
|
f4fc8f13c1 | ||
|
|
e6067d595d | ||
|
|
df9c825726 | ||
|
|
a14d7cee28 | ||
|
|
0ff95846fb | ||
|
|
ed8e2e49ac | ||
|
|
948a4b6157 | ||
|
|
3eecf78307 | ||
|
|
649b93833c | ||
|
|
4591f134d7 | ||
|
|
be31262f0e | ||
|
|
7a06a91f41 | ||
|
|
27ec053f93 | ||
|
|
71c8dfb57a | ||
|
|
82dcbf36e5 | ||
|
|
0a684aa1d1 | ||
|
|
17ad807b82 | ||
|
|
7180961212 | ||
|
|
32c461a7a7 | ||
|
|
1214513498 | ||
|
|
5cadbb2d20 | ||
|
|
8baf9ce3a0 | ||
|
|
9e6812408c | ||
|
|
bd2763a797 | ||
|
|
8bc65875ff | ||
|
|
16fe13fbb3 | ||
|
|
41cf8680af | ||
|
|
970ac5a508 | ||
|
|
c427f1f7ef | ||
|
|
ade959ef0c | ||
|
|
3caea45918 | ||
|
|
c6ff1b2c32 | ||
|
|
eb0bc8cab3 | ||
|
|
0ca207acb8 | ||
|
|
df375f3f1b | ||
|
|
8a38ec01a5 | ||
|
|
17cc7be30e | ||
|
|
11b4c387ff | ||
|
|
290124b3fe | ||
|
|
a7a97b6aaf | ||
|
|
3f472143f2 | ||
|
|
3edb91c98d | ||
|
|
f3d1e7c5ae | ||
|
|
26d3a3dd76 | ||
|
|
405d966ec2 | ||
|
|
013d605dca | ||
|
|
3d59603fa8 | ||
|
|
53775140e2 | ||
|
|
ebdda7a0ad | ||
|
|
25f414c099 | ||
|
|
b9d2d17602 | ||
|
|
d47dbfd163 | ||
|
|
d6fb46c969 | ||
|
|
71720af295 | ||
|
|
f918756ad8 | ||
|
|
8f76445ea7 | ||
|
|
22f3bd994d | ||
|
|
d680ebde03 | ||
|
|
a06e5b207e | ||
|
|
ca083757aa | ||
|
|
7af981c274 | ||
|
|
074e9620a7 | ||
|
|
2ac07f4a41 | ||
|
|
7cab3f102b | ||
|
|
1d74fd56ab | ||
|
|
f420c8fb9f | ||
|
|
a535daba1e | ||
|
|
d639d4099d | ||
|
|
87f93fda26 | ||
|
|
f849cf993d | ||
|
|
a662feb39b | ||
|
|
de0012086a | ||
|
|
3a894fdb65 | ||
|
|
b9ff03b510 | ||
|
|
c592e3f90f | ||
|
|
362b393b8d | ||
|
|
0d9633cff8 | ||
|
|
9549d623d0 | ||
|
|
5696c3b667 | ||
|
|
e1316ff069 | ||
|
|
4e5092e2a6 | ||
|
|
a7582f6f0b | ||
|
|
af053ef160 | ||
|
|
c5243e323c | ||
|
|
ce4f220bd9 | ||
|
|
7a1d7c4af5 | ||
|
|
7b1bd21366 | ||
|
|
a204c0a4c7 | ||
|
|
9ac897f36c | ||
|
|
8c40d4aadd | ||
|
|
1bcb3eda93 | ||
|
|
0cfcef2279 | ||
|
|
a33c4b8f03 | ||
|
|
2d66aa54b3 | ||
|
|
375c3b9214 | ||
|
|
3e478f096b | ||
|
|
c354cdef5b | ||
|
|
763fa7d193 | ||
|
|
ae50e1f766 | ||
|
|
033ee0953e | ||
|
|
56869950c8 | ||
|
|
fbb9b09870 | ||
|
|
5dc7975b95 | ||
|
|
026134e7e0 | ||
|
|
08201ddb9f | ||
|
|
c544ed1b70 | ||
|
|
a245ec691d | ||
|
|
e933f8ebcd | ||
|
|
69309a038e | ||
|
|
51aa31c5a5 | ||
|
|
7606b1db1f | ||
|
|
5ac31268c8 | ||
|
|
94d3b4c2de | ||
|
|
7b2857f261 | ||
|
|
76ac6d1571 | ||
|
|
4b09de89a0 | ||
|
|
a1394bc39c | ||
|
|
28bb9ea90c | ||
|
|
e0d7f78bd4 | ||
|
|
f34c9ba5c6 | ||
|
|
32c6eac1f6 | ||
|
|
5ccd5246eb | ||
|
|
29da38a9d2 | ||
|
|
8a6fe3c1b7 | ||
|
|
886a36da8f | ||
|
|
67022ab0f8 | ||
|
|
78a983c952 | ||
|
|
96612cae72 | ||
|
|
861a6821a6 | ||
|
|
4f466b168c | ||
|
|
0db13823e1 | ||
|
|
e2a9c956bf | ||
|
|
767329fcab | ||
|
|
74e6d59885 | ||
|
|
7a4c9ab1f2 | ||
|
|
150b1c2640 | ||
|
|
ae39a58614 | ||
|
|
45d82f1cb7 | ||
|
|
f7830a5843 | ||
|
|
aa50374705 | ||
|
|
7fcc7795ad | ||
|
|
f7d162476a | ||
|
|
7fa096bc43 | ||
|
|
908debe7eb | ||
|
|
134824549a | ||
|
|
b4f3df9224 | ||
|
|
b8e96c48e2 | ||
|
|
4c7a42ad29 | ||
|
|
266f9d0d40 | ||
|
|
49a3ef35a7 | ||
|
|
7f6be5b0bd | ||
|
|
8f13c84e7c | ||
|
|
7044348086 | ||
|
|
042fc0d3b8 | ||
|
|
7219904a87 | ||
|
|
56c7786756 | ||
|
|
5d47fdf557 | ||
|
|
679867bff9 | ||
|
|
208798d4b0 | ||
|
|
56c9d7ecac | ||
|
|
3d67f8432e | ||
|
|
a7e4e2d5b0 | ||
|
|
24b5be3ebe | ||
|
|
f6f5af9baa | ||
|
|
dd30bd5749 | ||
|
|
dc8c19590e | ||
|
|
19389093c2 | ||
|
|
3af7494d94 | ||
|
|
57f721bb6e | ||
|
|
9795864e30 | ||
|
|
4b825509ca | ||
|
|
c808fc368f | ||
|
|
167a83970d | ||
|
|
7a06d4dfe2 | ||
|
|
535ca5ddd4 | ||
|
|
7397e05aa4 | ||
|
|
cc5a3caf55 | ||
|
|
c51ec9a67d | ||
|
|
a8a021306e | ||
|
|
28eb5c8d8e | ||
|
|
207b609f95 | ||
|
|
d65a31bea1 | ||
|
|
bf1af18dd6 | ||
|
|
bf68d4286a | ||
|
|
9a4a7cadac | ||
|
|
d5e8b7ab18 | ||
|
|
6455c838c5 | ||
|
|
c0ed8b0158 | ||
|
|
2fefba0802 | ||
|
|
57c3f90ff2 | ||
|
|
985c78ea56 | ||
|
|
945e7e7889 | ||
|
|
5baa962dde | ||
|
|
e8e2d89314 | ||
|
|
2cddd4220a | ||
|
|
43d37ff0a4 | ||
|
|
62e5fdac78 | ||
|
|
186409902f | ||
|
|
a7a01654d7 | ||
|
|
d19e81716c | ||
|
|
83f38a03d9 | ||
|
|
02c7528cb2 | ||
|
|
d94b98dbc0 | ||
|
|
f67f051b8f | ||
|
|
0c0c8364ae | ||
|
|
d9715cc286 | ||
|
|
8466158c0d | ||
|
|
95592e83b0 | ||
|
|
8237c71aa4 | ||
|
|
8384e2fe76 | ||
|
|
27b44e7383 | ||
|
|
24d3bc60ec | ||
|
|
8903350918 | ||
|
|
8e3d8169b7 | ||
|
|
515570c935 | ||
|
|
8bdca3b31e | ||
|
|
7d2fbd683d | ||
|
|
63435b4d77 | ||
|
|
68af26c994 | ||
|
|
feab6f3262 | ||
|
|
7d9aa0449f | ||
|
|
d448a920ec | ||
|
|
5fc797a3ef | ||
|
|
47fd9906d5 | ||
|
|
0589b4829a | ||
|
|
57eb4c1fcb | ||
|
|
501f2d199b | ||
|
|
5c3e65da8c | ||
|
|
c1c53b42d6 | ||
|
|
3e807149d9 | ||
|
|
f05364c8f9 | ||
|
|
919ef3c8ad | ||
|
|
54e81bc6b9 | ||
|
|
ed8601797d | ||
|
|
f326b95703 | ||
|
|
2c7d02fb7d | ||
|
|
9cc7591f90 | ||
|
|
491210db1e | ||
|
|
ce9fc1030a | ||
|
|
62f21eef3a | ||
|
|
0e0d818006 | ||
|
|
c930b4f7c1 | ||
|
|
cd37eded97 | ||
|
|
88ce657e1b | ||
|
|
03b32e74fa | ||
|
|
4c015924c5 | ||
|
|
33a787f4ae | ||
|
|
a50ad588ad | ||
|
|
2c4128b50c | ||
|
|
bb6414a217 | ||
|
|
cb510a993e | ||
|
|
bcf3db7979 | ||
|
|
39e0cb9cd4 | ||
|
|
90180172bc | ||
|
|
bc8953b957 | ||
|
|
81c5211007 | ||
|
|
67465fda94 | ||
|
|
289b8682a9 | ||
|
|
e4c7395950 | ||
|
|
5232af595c | ||
|
|
4755596301 | ||
|
|
f1d463fd80 | ||
|
|
af53d56d47 | ||
|
|
2f93710e92 | ||
|
|
8824c1fa0d | ||
|
|
d581e4a08c | ||
|
|
52979fd215 | ||
|
|
a29ef253bf | ||
|
|
50f9dc364b | ||
|
|
e5ecad7379 | ||
|
|
f47cd6e9d5 | ||
|
|
28261f651b | ||
|
|
4c7d96160d | ||
|
|
f8b0dafb04 | ||
|
|
d940b1138b | ||
|
|
e0dbef4dd5 | ||
|
|
314615c8fa | ||
|
|
0ceabd434f | ||
|
|
6392b1cb8d | ||
|
|
7f1e28ad94 | ||
|
|
be56010608 | ||
|
|
2ac8a66ad9 | ||
|
|
2629d5502b | ||
|
|
9e6f4bf5d7 | ||
|
|
731a6704ab | ||
|
|
4df0432d83 | ||
|
|
bf00a7c0e3 | ||
|
|
f1ee066bd5 | ||
|
|
bc70b0d822 | ||
|
|
0de42d9660 | ||
|
|
216c7c04b1 | ||
|
|
d9818bd3a5 | ||
|
|
7bdf55646e | ||
|
|
904a18cf08 | ||
|
|
ba5760c913 | ||
|
|
59fcab987c | ||
|
|
b5a0cef907 | ||
|
|
fa8d62c834 | ||
|
|
a9bfb336f9 | ||
|
|
536f5f04d1 | ||
|
|
4722752fd0 | ||
|
|
03d3035efe | ||
|
|
d0d66f7719 | ||
|
|
06bab7aa15 | ||
|
|
1e018388b6 | ||
|
|
fffec436a5 | ||
|
|
f389c17c30 | ||
|
|
73ec2163b6 | ||
|
|
54d61dc86b | ||
|
|
38341e0acd | ||
|
|
5cafae59e1 | ||
|
|
ce0c43c59a | ||
|
|
b620099f32 | ||
|
|
f316973e12 | ||
|
|
df64f5ff19 | ||
|
|
8c22e8588a | ||
|
|
3ddd48472a | ||
|
|
00ccd3eccb | ||
|
|
c2ac753758 | ||
|
|
a51d3fc12a | ||
|
|
47073b5381 | ||
|
|
7b54ad0ec9 | ||
|
|
c0d5df15f7 | ||
|
|
917cd22327 | ||
|
|
2cbabcc50f | ||
|
|
313aab24d6 | ||
|
|
34f8371613 | ||
|
|
51d30a036a | ||
|
|
dda9ae3d41 | ||
|
|
792d33f1f6 | ||
|
|
3ec6e94955 | ||
|
|
1f3b0ee950 | ||
|
|
af6c73156e | ||
|
|
25e8fea4fd | ||
|
|
2ede98f430 | ||
|
|
d7158cab88 | ||
|
|
f143c8a40a | ||
|
|
d0b4c29c9e | ||
|
|
543c6bc6a1 | ||
|
|
0ad8c53706 | ||
|
|
7b761dcf55 | ||
|
|
4983b787d8 | ||
|
|
c1faed5ab9 | ||
|
|
29a7bfed09 | ||
|
|
828f4bfada | ||
|
|
eb05a7a493 | ||
|
|
b6a9e2da16 | ||
|
|
db2de7f55f | ||
|
|
d518fe67a6 | ||
|
|
887e334517 | ||
|
|
0a9e48dd6a | ||
|
|
87f7a1b784 | ||
|
|
f2eb7a5c59 | ||
|
|
607020e781 | ||
|
|
60a3f2b268 | ||
|
|
0780c5d9b8 | ||
|
|
fe8d0a8578 | ||
|
|
1a6c7a6bf8 | ||
|
|
3a1db42b6a | ||
|
|
6af3635ba8 | ||
|
|
e0b551443a | ||
|
|
3ae5d3ad08 | ||
|
|
be1241bf6d | ||
|
|
eeada69515 | ||
|
|
0ddc79dc0f | ||
|
|
38adac8612 | ||
|
|
737a1d0dbf | ||
|
|
2b697a69e2 | ||
|
|
a27c3f506b | ||
|
|
59da76d7d1 | ||
|
|
121b3db2e9 | ||
|
|
0d5090c41d | ||
|
|
3cd8a15477 | ||
|
|
3798f3932e | ||
|
|
162f7a4e40 | ||
|
|
4d651fd54a | ||
|
|
63cdf5955a | ||
|
|
127fbcd85e | ||
|
|
8f130495e3 | ||
|
|
f792b19cae | ||
|
|
d2b22c37a2 | ||
|
|
1c11f8a75e | ||
|
|
945938ef8b | ||
|
|
790330f804 | ||
|
|
9ac01d633a | ||
|
|
f4e7c7b940 | ||
|
|
11b62d0cad | ||
|
|
659f916086 | ||
|
|
7ca54b9011 | ||
|
|
9199bafe10 | ||
|
|
6b68377954 | ||
|
|
b8ac43c9d9 | ||
|
|
8a6e761bdb | ||
|
|
5a1860833b | ||
|
|
c352822539 | ||
|
|
4423daa9e1 | ||
|
|
14a74446f3 | ||
|
|
3495c0fe86 | ||
|
|
5f3ef4f6cf | ||
|
|
e544013a4c | ||
|
|
a63d5956f6 | ||
|
|
6dc1c67900 | ||
|
|
6c6c7b246b | ||
|
|
b9e3b9ef46 | ||
|
|
205a95a03d | ||
|
|
6b79c09ad2 | ||
|
|
60ae115f33 | ||
|
|
62c6a599c1 | ||
|
|
d4e2da0b3c | ||
|
|
f418af9c74 | ||
|
|
4d108f4aec | ||
|
|
08827a5177 | ||
|
|
6045b9d934 | ||
|
|
f29dc71a32 | ||
|
|
a88e2e1db7 | ||
|
|
3c711dddee | ||
|
|
8df12e5933 | ||
|
|
35591839e5 | ||
|
|
41118ceb13 | ||
|
|
8e10b99037 | ||
|
|
6fd9b29157 | ||
|
|
3bdb4fd376 | ||
|
|
9fe233b312 | ||
|
|
54a039de77 | ||
|
|
aa5401ceed | ||
|
|
de73cdd117 | ||
|
|
06018b9ca8 | ||
|
|
a1fa8ebe81 | ||
|
|
cf43eba70c | ||
|
|
febe3d4380 | ||
|
|
3042f31cd0 | ||
|
|
a5d1b7f503 | ||
|
|
c7ec2e7eb6 | ||
|
|
648cc1cf9e | ||
|
|
8c7319aaea | ||
|
|
b78a16d9e9 | ||
|
|
5660709c2d | ||
|
|
c2ad32135e | ||
|
|
d4d97eb950 | ||
|
|
84596d92e4 | ||
|
|
a460c3b107 | ||
|
|
310e17f938 | ||
|
|
df38d90d65 | ||
|
|
43c476f26f | ||
|
|
ea01e3c142 | ||
|
|
8b0350a021 | ||
|
|
216ac9cbc4 | ||
|
|
5397e11940 | ||
|
|
bc4c013e03 | ||
|
|
75f6b7fcd8 | ||
|
|
3641ad6cf7 | ||
|
|
a3a2e573de | ||
|
|
b53d8da648 | ||
|
|
2852f44951 | ||
|
|
78212a4ade | ||
|
|
f417b05769 | ||
|
|
1266950809 | ||
|
|
3529499282 | ||
|
|
64114b0762 | ||
|
|
80e923fe46 | ||
|
|
7e4b93f06e | ||
|
|
3999709bda | ||
|
|
37acb3cd30 | ||
|
|
1b6a6c510a | ||
|
|
181ac887e3 | ||
|
|
c2e7847134 | ||
|
|
133fa036c6 | ||
|
|
04301828c8 | ||
|
|
dfca1c2b61 | ||
|
|
b62aaebe5c | ||
|
|
d0a389997f | ||
|
|
6c685ec295 | ||
|
|
60f348824d | ||
|
|
f0bc904526 | ||
|
|
a8666865cb | ||
|
|
2aa68a0f3f | ||
|
|
5725c196ff | ||
|
|
8834f0ad44 | ||
|
|
639d6a71b1 | ||
|
|
33af8ba5a5 | ||
|
|
9de22c3549 | ||
|
|
c03e50c5a1 | ||
|
|
44cabf8376 | ||
|
|
d101281b36 | ||
|
|
fd96c02be0 | ||
|
|
e93c85aa54 | ||
|
|
c2129365cb | ||
|
|
729690e055 | ||
|
|
6beb99db9e | ||
|
|
8e631b6810 | ||
|
|
4475fc022a | ||
|
|
af63b58b6f | ||
|
|
d763308431 | ||
|
|
73fbc093b7 | ||
|
|
8628f9ee37 | ||
|
|
bda39e3f77 | ||
|
|
c0959496dd | ||
|
|
0133aef038 | ||
|
|
dd476563a3 | ||
|
|
cad99e5ba0 | ||
|
|
a44d149b4f | ||
|
|
ebb1c758d9 | ||
|
|
3256366ffe | ||
|
|
0a98a2a9cb | ||
|
|
ca14643834 | ||
|
|
feb84aa443 | ||
|
|
19edf0f939 | ||
|
|
bff7c57c2b | ||
|
|
264dacb5ba | ||
|
|
8372b76d4e | ||
|
|
bdc299cc8a | ||
|
|
60c3abcc3e | ||
|
|
709082f0af | ||
|
|
07af0b1c8b | ||
|
|
ccb096ed99 | ||
|
|
528f144858 | ||
|
|
d38a0b6e43 | ||
|
|
6da82ee964 | ||
|
|
a8fd840fa3 | ||
|
|
6db295524a | ||
|
|
c36b63dea9 | ||
|
|
3807c507b7 | ||
|
|
4d12a242ab | ||
|
|
53c2dfa49b | ||
|
|
d8209d796d | ||
|
|
fa66bce9a5 | ||
|
|
7f8938e074 | ||
|
|
93b2e1ed8b | ||
|
|
7514bbb3c9 | ||
|
|
3fa335d6d0 | ||
|
|
ad540b6f90 | ||
|
|
9197aec478 | ||
|
|
c2704bdba7 | ||
|
|
9fd23fa175 | ||
|
|
4771a6cdec | ||
|
|
b9328df0d5 | ||
|
|
c137cf681a | ||
|
|
d48d1afd5e | ||
|
|
ff89622e61 | ||
|
|
b1198265d7 | ||
|
|
ff44894d61 | ||
|
|
46efbac984 | ||
|
|
6f172094ac | ||
|
|
9ea0abc121 | ||
|
|
4671252943 | ||
|
|
d107ccaa97 | ||
|
|
c5bab0d8c4 | ||
|
|
2dadf0b1a4 | ||
|
|
176768dd3a | ||
|
|
3cc15546f9 | ||
|
|
4fa27a7262 | ||
|
|
4bb21c71ed | ||
|
|
cbd9165008 | ||
|
|
734552ad91 | ||
|
|
ed848e74f2 | ||
|
|
d8fd2c3cd1 | ||
|
|
608acdb373 | ||
|
|
3184238b9f | ||
|
|
e73789dc3e | ||
|
|
48bb3ad965 | ||
|
|
0255b2d9da | ||
|
|
868b04f36b | ||
|
|
1142d2888f | ||
|
|
a39ef7f6ca | ||
|
|
5322539179 | ||
|
|
9f2d789c36 | ||
|
|
cfa0a79405 | ||
|
|
16558a4d32 | ||
|
|
c0bb933988 | ||
|
|
893fe7af11 | ||
|
|
ae8d9612ae | ||
|
|
d8f092b06f | ||
|
|
24237097e2 | ||
|
|
7c3a69f8e0 | ||
|
|
230b46cbcd | ||
|
|
d8b3c359bf | ||
|
|
d4132e767f | ||
|
|
d4fa597245 | ||
|
|
d3a44cd4d1 | ||
|
|
4819247450 | ||
|
|
f18b0aab93 | ||
|
|
9589e2c491 | ||
|
|
e79cfa6f08 | ||
|
|
b860846c0c | ||
|
|
2c2c9bdefc | ||
|
|
ea0313106a | ||
|
|
0c0c113460 | ||
|
|
28a414514c | ||
|
|
a02699f2b9 | ||
|
|
2f42f12197 | ||
|
|
422795694e | ||
|
|
d109c728a2 | ||
|
|
a9d95014ae | ||
|
|
57dcb8e1de | ||
|
|
ff63ddeffd | ||
|
|
af9f195af0 | ||
|
|
a3a36085b4 | ||
|
|
2a5e79117c | ||
|
|
0a09e49b84 | ||
|
|
4fba98b9a6 | ||
|
|
4bf5b65350 | ||
|
|
ab8ed97571 | ||
|
|
9b265625b5 | ||
|
|
0ddfd34c06 | ||
|
|
8303e4e852 | ||
|
|
612fc08825 | ||
|
|
630a635beb | ||
|
|
c3b4a73afd | ||
|
|
b6c8f47e67 | ||
|
|
5beb05a805 | ||
|
|
530dde8f8f | ||
|
|
9a6916931d | ||
|
|
30c1b1307f | ||
|
|
8efe1689f9 | ||
|
|
ee0f264f21 | ||
|
|
fdbca65489 | ||
|
|
df32ad8f28 | ||
|
|
73b3869756 | ||
|
|
1f3a7a0c39 | ||
|
|
7d17bd8d43 | ||
|
|
ba563ec448 | ||
|
|
99b24227ce | ||
|
|
ffa04e11a8 | ||
|
|
31e8fe51a6 | ||
|
|
7cc6b9b910 | ||
|
|
ed23aa9bc0 | ||
|
|
b09b5a9a28 | ||
|
|
a084c1d395 | ||
|
|
af1b26b993 | ||
|
|
00d8c26160 | ||
|
|
21a32408cf | ||
|
|
3321e904b3 | ||
|
|
5e85e85a29 | ||
|
|
765bd44207 | ||
|
|
a77f4dfb8e | ||
|
|
c3e38dd594 | ||
|
|
21952a64d3 | ||
|
|
602b19bf90 | ||
|
|
6804bd6985 | ||
|
|
2044bc9f94 | ||
|
|
0aa70fc3b5 | ||
|
|
6356957bfb | ||
|
|
9a50a0b4b9 | ||
|
|
2eaaf9c14a | ||
|
|
9a17999750 | ||
|
|
7d501714a3 | ||
|
|
761116563d | ||
|
|
f2e5d4b699 | ||
|
|
2db7562920 | ||
|
|
7e2865f500 | ||
|
|
8069aca614 | ||
|
|
4dbac59c6e | ||
|
|
32ee3f2934 | ||
|
|
b2851cdba8 | ||
|
|
7c9a94d674 | ||
|
|
cc90e80794 | ||
|
|
fad9a9decb | ||
|
|
3c88ac45f6 | ||
|
|
cd460987dc | ||
|
|
9c80f87794 | ||
|
|
477b1cf151 | ||
|
|
53e6139def | ||
|
|
0c6602ab84 | ||
|
|
ca66f1f29b | ||
|
|
e195ae2516 | ||
|
|
ac8c749af8 | ||
|
|
15b39f7427 | ||
|
|
2e38fbd274 | ||
|
|
e923f2ed42 | ||
|
|
2ffad4b5fa | ||
|
|
18d6427ff2 | ||
|
|
9fa7e0bc96 | ||
|
|
d4f28855d5 | ||
|
|
c0f6cee914 | ||
|
|
e2c2f8e684 | ||
|
|
6003dda5e5 | ||
|
|
d6894e07b1 | ||
|
|
873795ff54 | ||
|
|
d035645a8c | ||
|
|
dfa286394b | ||
|
|
3c963b040e | ||
|
|
f36180c33d | ||
|
|
1b226d1d7a | ||
|
|
66530e5e7a | ||
|
|
96f704c348 | ||
|
|
06032d33d4 | ||
|
|
4eeea9b960 | ||
|
|
dcf42e2e4a | ||
|
|
ce3e98c8bf | ||
|
|
17b8bac308 | ||
|
|
86a836432a | ||
|
|
bea86db6b5 | ||
|
|
9eff617bea | ||
|
|
822071aecf | ||
|
|
3731e170e4 | ||
|
|
aab4d9e8e2 | ||
|
|
85a89cb80b | ||
|
|
1164dec297 | ||
|
|
ff82155f93 | ||
|
|
35bc25577a | ||
|
|
30ba7689db | ||
|
|
2319ef2d8d | ||
|
|
4526678cb4 | ||
|
|
f4538bc3a6 | ||
|
|
2475dc5151 | ||
|
|
388dadcf6d | ||
|
|
33a1efc624 | ||
|
|
28ada3bf30 | ||
|
|
0b1a2194cb | ||
|
|
b35dd6b026 | ||
|
|
a9830b2d28 | ||
|
|
18913925d9 | ||
|
|
dcdf0cc33e | ||
|
|
3af211275b | ||
|
|
de1ff80486 | ||
|
|
3eb80015c7 | ||
|
|
2205227f47 | ||
|
|
4b77ee5feb | ||
|
|
6d21c3d145 | ||
|
|
23b7bb8fba | ||
|
|
f03816ef1b | ||
|
|
cb696b31ce | ||
|
|
2ae4d2a2fb | ||
|
|
470600c2ef | ||
|
|
cddcf025b5 | ||
|
|
51015965f2 | ||
|
|
37dc0aeeac | ||
|
|
2179ee82a9 | ||
|
|
696475e6bf | ||
|
|
dbc54e2c52 | ||
|
|
5c78acc38c | ||
|
|
dd4c370c57 | ||
|
|
421ea3b0c5 | ||
|
|
f6ad3d92f5 | ||
|
|
5675b8b4f6 | ||
|
|
87d07924da | ||
|
|
e45e3dd652 | ||
|
|
0f1e21cdf8 | ||
|
|
5ad50f837a | ||
|
|
3cb1a71b75 | ||
|
|
2166547123 | ||
|
|
0936839410 | ||
|
|
c0d094b1e3 | ||
|
|
654700694a | ||
|
|
e7b7628f6c | ||
|
|
a304ffd0c9 | ||
|
|
b983312d0a | ||
|
|
53ce2d0446 | ||
|
|
3e19c09d57 | ||
|
|
2b6ddb1608 | ||
|
|
54f59fdc3d | ||
|
|
2486da41d8 | ||
|
|
2ab89ea65c | ||
|
|
dda6330be8 | ||
|
|
78f4f20080 | ||
|
|
00ce8b3fc1 | ||
|
|
78d62b2985 | ||
|
|
909bc0161c | ||
|
|
34dfadd278 | ||
|
|
e8a92150b4 | ||
|
|
a72d63a8c9 | ||
|
|
72f6f9b5d7 | ||
|
|
2224702216 | ||
|
|
ac32cd83c1 | ||
|
|
07ea37022a | ||
|
|
f74bd75dfa | ||
|
|
a7074fe7a8 | ||
|
|
cacbd4c553 | ||
|
|
a475da5256 | ||
|
|
5d63e2346f | ||
|
|
713fdcd409 | ||
|
|
82a7fc6c29 | ||
|
|
52a97a0b19 | ||
|
|
1938b436a1 | ||
|
|
c70cfd28ca | ||
|
|
67db7ab151 | ||
|
|
7a76e4e38b | ||
|
|
03040a71f3 | ||
|
|
4c7e596897 | ||
|
|
60fb5c7f29 | ||
|
|
b9d630c7ac | ||
|
|
0b6adb5c1e | ||
|
|
e57427a246 | ||
|
|
d48294e8c7 | ||
|
|
944a4446ff | ||
|
|
022ef6410d | ||
|
|
3951b6f719 | ||
|
|
96e2deab25 | ||
|
|
5872aeb375 | ||
|
|
74f7e9f955 | ||
|
|
caf87fbab2 | ||
|
|
782f4bffbf | ||
|
|
a020870de3 | ||
|
|
bff1963f9e | ||
|
|
1bcc173e36 | ||
|
|
9b59d0de7a | ||
|
|
1124fddb9e | ||
|
|
55b158f7d5 | ||
|
|
d6addc4ea5 | ||
|
|
743ee4f278 | ||
|
|
e14efcebc0 | ||
|
|
886de1d9bf | ||
|
|
cee494eaf9 | ||
|
|
560b7c5be3 | ||
|
|
9717eb5172 | ||
|
|
0d97f96b0e | ||
|
|
bfbde9042d | ||
|
|
d07b0fcb8d | ||
|
|
452932b55c | ||
|
|
dd6da009d9 | ||
|
|
461fdad5df | ||
|
|
b2f428d5b6 | ||
|
|
6c9cdd82d3 | ||
|
|
37d76c4866 | ||
|
|
6806b0813a | ||
|
|
56a8ea3492 | ||
|
|
195acce366 | ||
|
|
b5ee06be1f | ||
|
|
efbecc9fb2 | ||
|
|
fa3a7f056a | ||
|
|
833cf8267f | ||
|
|
ad6f2de8a1 | ||
|
|
97228e5ac4 | ||
|
|
bf3ada0592 | ||
|
|
db2fa0fbdf | ||
|
|
3db9871a13 | ||
|
|
84b573d1ea | ||
|
|
b043906395 | ||
|
|
f59bf2d8ef | ||
|
|
0b44a90823 | ||
|
|
8233c5d458 | ||
|
|
89059bda04 | ||
|
|
c19dbefe1b | ||
|
|
c07350227e | ||
|
|
c2cf56b137 | ||
|
|
6e967b1e0b | ||
|
|
e9fe329415 | ||
|
|
7131238c86 | ||
|
|
7ae2ab8437 | ||
|
|
4be84d8d4c | ||
|
|
caf0184e2f | ||
|
|
6e5dd83b67 | ||
|
|
90be470172 | ||
|
|
6c5a3b7734 | ||
|
|
f493a42d27 | ||
|
|
95d022c38d | ||
|
|
4ef75eb110 | ||
|
|
7f1674ee50 | ||
|
|
a48d4dc9be | ||
|
|
ab23195d54 | ||
|
|
407405f305 | ||
|
|
abb7c4a13a | ||
|
|
890ef8c952 | ||
|
|
6dcdd7f8a3 | ||
|
|
6e19b7dc30 | ||
|
|
93b7e84ee8 | ||
|
|
9542fd3e7c | ||
|
|
44fbae0530 | ||
|
|
bc0d7cf64e | ||
|
|
e26410a307 | ||
|
|
9da5de9271 | ||
|
|
f3fad4ad07 | ||
|
|
2898fce39d | ||
|
|
522df6f1f8 | ||
|
|
2aae0a1a7d | ||
|
|
4e5e2ae08e | ||
|
|
f86e01fca8 | ||
|
|
709aa92bd8 | ||
|
|
76bf4a71e7 | ||
|
|
4f771fdb55 | ||
|
|
3b4069c996 | ||
|
|
bd1d4034fd | ||
|
|
18636e6ae7 | ||
|
|
4d6a69011e | ||
|
|
b1d84bc89b | ||
|
|
40509366b8 | ||
|
|
4de95d5abf | ||
|
|
e6fd73c500 | ||
|
|
eccbb499fe | ||
|
|
613e5b1968 | ||
|
|
9e10893462 | ||
|
|
dbe179ebde | ||
|
|
0d129f9d10 | ||
|
|
0745f2e4bf | ||
|
|
81ef3c5684 | ||
|
|
daad2a529c | ||
|
|
01717e8f8c | ||
|
|
ff389f99a3 | ||
|
|
89910692d0 | ||
|
|
1bd0c54bd6 | ||
|
|
2a7c0db825 | ||
|
|
c0ca947cbb | ||
|
|
ac8afae2e0 | ||
|
|
e3aa5d183f | ||
|
|
cc9adf15e1 | ||
|
|
192a8edbee | ||
|
|
d40f851e52 | ||
|
|
2a9805f77c | ||
|
|
eaef198878 | ||
|
|
d553327c7e | ||
|
|
366be38453 | ||
|
|
88cb987558 | ||
|
|
1dad7f1625 | ||
|
|
ffbd6b41a7 | ||
|
|
cf01144fa9 | ||
|
|
97f2b0df3e | ||
|
|
4fc3c6b41f | ||
|
|
fcf19b9db4 | ||
|
|
38bcacd988 | ||
|
|
a37e7a782b | ||
|
|
413ab743cd | ||
|
|
92c3b1f570 | ||
|
|
543ae45eec | ||
|
|
69156f22fb | ||
|
|
305fe89d30 | ||
|
|
6be6726b5d | ||
|
|
23ce84721c | ||
|
|
5000772ddc | ||
|
|
f197ee5363 | ||
|
|
695e20a48e | ||
|
|
0ad6a3802b | ||
|
|
bf1e2bd0dd | ||
|
|
20a7f83915 | ||
|
|
fa2e925ed7 | ||
|
|
d262e462bb | ||
|
|
02fa66fbaa | ||
|
|
c081d0b9a9 | ||
|
|
9085175fb3 | ||
|
|
d4b17dbdfa | ||
|
|
bde4b943fe | ||
|
|
6b8a54b230 | ||
|
|
15c09c483e | ||
|
|
4ba9433187 | ||
|
|
b5d89c549c | ||
|
|
a796b66e05 | ||
|
|
64fa595716 | ||
|
|
ec78ab5ffa | ||
|
|
b75677cccd | ||
|
|
fdf15407ea | ||
|
|
827b74fc06 | ||
|
|
06c6234561 | ||
|
|
fdbf6f10e8 | ||
|
|
38d7a357fc | ||
|
|
2b6b7181e1 | ||
|
|
5117bf1184 | ||
|
|
e64649fb0a | ||
|
|
167dd1a927 | ||
|
|
f9722393dc | ||
|
|
bef65e4283 | ||
|
|
dcaf6dcef5 | ||
|
|
0cc3f4be3d | ||
|
|
5f8220c937 | ||
|
|
385d335042 | ||
|
|
571f31c743 | ||
|
|
626e6657d9 | ||
|
|
fb5390a738 | ||
|
|
a4176b0cbb | ||
|
|
d93d4dc38a | ||
|
|
4f6317694e | ||
|
|
4f6f3879c6 | ||
|
|
eb84b61b69 | ||
|
|
0e0dbb25b5 | ||
|
|
dd740b6e6b | ||
|
|
7e359015d6 | ||
|
|
1714b1c092 | ||
|
|
cc7f7103be | ||
|
|
4fc118b20a | ||
|
|
5427d81aa7 | ||
|
|
b151a5f6e8 | ||
|
|
73afad23b3 | ||
|
|
d4b27e2649 | ||
|
|
f1131da000 | ||
|
|
73a9c1568f | ||
|
|
529777fa0b | ||
|
|
79b1764554 | ||
|
|
b80115be88 | ||
|
|
3d0d002bd6 | ||
|
|
f1c7b50814 | ||
|
|
4d35991a1c | ||
|
|
c23e8713a4 | ||
|
|
518a030fe5 | ||
|
|
2255bde6e1 | ||
|
|
2c7714e5d9 | ||
|
|
6c4223ee44 | ||
|
|
55c7c37da4 | ||
|
|
0ad6c8cefe | ||
|
|
4e5e6c0b46 | ||
|
|
51c49eba48 | ||
|
|
5113cb2935 | ||
|
|
42ba9cf03f | ||
|
|
28089434ad | ||
|
|
1726a31c6b | ||
|
|
b5523e32e2 | ||
|
|
3e9da49c2f | ||
|
|
aaae96bba6 | ||
|
|
c452dd0491 | ||
|
|
93ed1705b9 | ||
|
|
28c7244901 | ||
|
|
0f88682587 | ||
|
|
c5b1256960 | ||
|
|
c79731dbee | ||
|
|
4ffa2eaf39 | ||
|
|
b3ccdbc626 | ||
|
|
3200a17c51 | ||
|
|
7be9805c3d | ||
|
|
d214e347ea | ||
|
|
395d359c7f | ||
|
|
046bb7348c | ||
|
|
3ee5272011 | ||
|
|
e8e33b2636 | ||
|
|
47bb721097 | ||
|
|
ed7197e519 | ||
|
|
c3a9007ac3 | ||
|
|
343192c2ae | ||
|
|
d2fc64ff56 | ||
|
|
ee5b01be5c | ||
|
|
d062b478bd | ||
|
|
761d171de1 | ||
|
|
c3d4772e1e | ||
|
|
2245fdc9d5 | ||
|
|
2f7e4b0e2a | ||
|
|
89a54a9982 | ||
|
|
c88d6150e1 | ||
|
|
968d4ce680 | ||
|
|
a35f80c6c1 | ||
|
|
9932fcfdb8 | ||
|
|
83edb851e3 | ||
|
|
9e10127828 | ||
|
|
a0a6d1ee85 | ||
|
|
926634ab10 | ||
|
|
31d0e08515 | ||
|
|
4437222d01 | ||
|
|
0d1050d395 | ||
|
|
031c1353b7 | ||
|
|
dc99fee4b4 | ||
|
|
302ef0adac | ||
|
|
37c14137e2 | ||
|
|
388a323105 | ||
|
|
e9716ee88d | ||
|
|
25734f92be | ||
|
|
32ca38de8c | ||
|
|
832497773b | ||
|
|
c1153eda3a | ||
|
|
7c3e8ae54a | ||
|
|
0b93ac51b5 | ||
|
|
5fd5be6e1b | ||
|
|
a4ea7d3b2e | ||
|
|
2ba6808559 | ||
|
|
156ca8227b | ||
|
|
077ec0289d | ||
|
|
b6b924d4e1 | ||
|
|
16c391f9bd | ||
|
|
70e567a09d | ||
|
|
294f5cf98d | ||
|
|
3e9f302cf6 | ||
|
|
a450fbb18a | ||
|
|
e634881f96 | ||
|
|
ad71747116 | ||
|
|
1f0b71abac | ||
|
|
3a1e15f5c2 | ||
|
|
44596b3723 | ||
|
|
4e30143f51 | ||
|
|
db5a0fe4dc | ||
|
|
1b1306d372 | ||
|
|
ac2ab49e8f | ||
|
|
5c61b5dd17 | ||
|
|
5941f40444 | ||
|
|
bca15e24ce | ||
|
|
81a15d9327 | ||
|
|
b01fe77ba2 | ||
|
|
f99e01018e | ||
|
|
393befe4fa | ||
|
|
4d9d11cbfb | ||
|
|
c8356fb261 | ||
|
|
2938092be6 | ||
|
|
ed099857c0 | ||
|
|
e5b4eb5c19 | ||
|
|
3239c191fb | ||
|
|
6a6bff90e8 | ||
|
|
0a410dbbf2 | ||
|
|
ea6ddd7aa6 | ||
|
|
23cfb1d9f9 | ||
|
|
9295c87845 | ||
|
|
cd3a11c9e2 | ||
|
|
99f31b66c3 | ||
|
|
d9c3ef655e | ||
|
|
a9220dd4d8 | ||
|
|
6e75886a3d | ||
|
|
fbab016ba7 | ||
|
|
d6d2189344 | ||
|
|
c6e18ef0d5 | ||
|
|
ab3fca5b64 | ||
|
|
aedd3f2d53 | ||
|
|
01a32f6318 | ||
|
|
09c5214181 | ||
|
|
c243a99947 | ||
|
|
88ab4724e4 | ||
|
|
e975106995 | ||
|
|
f44891c367 | ||
|
|
e940963dd2 | ||
|
|
eed4b1f2df | ||
|
|
b8179d9548 | ||
|
|
a7b06aabaf | ||
|
|
0677294afa | ||
|
|
aaf18f7b7c | ||
|
|
42baad25fd | ||
|
|
2122a30d41 | ||
|
|
ad6638da29 | ||
|
|
2aad39e41c | ||
|
|
5af22ecd3b | ||
|
|
d7625532be | ||
|
|
73e53d8cf0 | ||
|
|
56191cf988 | ||
|
|
fff9783879 | ||
|
|
e06eb6976e | ||
|
|
e8a89c1060 | ||
|
|
780fef14bf | ||
|
|
a9bcde41d1 | ||
|
|
f54ce18402 | ||
|
|
d3baf847bf | ||
|
|
1f24f8ef75 | ||
|
|
3fbee04549 | ||
|
|
5203f0f852 | ||
|
|
99d3ae396d | ||
|
|
a62fac14a9 | ||
|
|
5fb178426c | ||
|
|
3093d958b3 | ||
|
|
a3f7e0c769 | ||
|
|
f3b9ba2f06 | ||
|
|
e15b36e141 | ||
|
|
efb6bbde69 | ||
|
|
65ddf8a2c9 | ||
|
|
eab688f5c1 | ||
|
|
bf77b1dc40 | ||
|
|
7d7aa9ff05 | ||
|
|
21a21c55b7 | ||
|
|
5f4d716f5e | ||
|
|
64f7009480 | ||
|
|
2a7814b2bb | ||
|
|
40e901f46e | ||
|
|
3b187abbe1 | ||
|
|
3b9dcc11b2 | ||
|
|
3b29421f6f | ||
|
|
9c9b64efea | ||
|
|
51de23f66f | ||
|
|
97c1fedf38 | ||
|
|
6e7388737a | ||
|
|
2c77a23943 | ||
|
|
6858ec13de | ||
|
|
c6194d925c | ||
|
|
853200aa98 | ||
|
|
9f63317900 | ||
|
|
ce84e168d1 | ||
|
|
d506346db3 | ||
|
|
17cfee37b9 | ||
|
|
3cd9bb9f86 | ||
|
|
0ff15c38a3 | ||
|
|
831469f4d9 | ||
|
|
f7b212b449 | ||
|
|
3d3b061c31 | ||
|
|
6f874e6dbc | ||
|
|
f60cc2a2f7 | ||
|
|
f9bc1b8c3b | ||
|
|
73be96e304 | ||
|
|
42ec16c32f | ||
|
|
247e435752 | ||
|
|
fd21f5ee80 | ||
|
|
0644a54883 | ||
|
|
6117b822ab | ||
|
|
6270ed81bf | ||
|
|
249180f9f0 | ||
|
|
93f8c711af | ||
|
|
1f5a861402 | ||
|
|
1a2c67cb4b | ||
|
|
45daf1f42b | ||
|
|
65985b184f | ||
|
|
ec113ac691 | ||
|
|
31a57190e0 | ||
|
|
adad2ef5fe | ||
|
|
5e8f91bd2a | ||
|
|
b49693f30f | ||
|
|
5f826b7ff4 | ||
|
|
c50c111fdf | ||
|
|
b20aa6e5bd | ||
|
|
4927d6cce2 | ||
|
|
693ea83924 | ||
|
|
4ed3befa71 | ||
|
|
82b26e009a | ||
|
|
5814197257 | ||
|
|
4e4f7438f1 | ||
|
|
faf758ffdd | ||
|
|
cd5c533351 | ||
|
|
1ad77837cf | ||
|
|
82c331d03d | ||
|
|
97330a72cd | ||
|
|
c04153910f | ||
|
|
6ae2d28cf5 | ||
|
|
e104817ed1 | ||
|
|
e402b82f00 | ||
|
|
88ad4bb956 | ||
|
|
e9b1476112 | ||
|
|
4ea9332892 | ||
|
|
a19fc430cd | ||
|
|
c914583a7a | ||
|
|
fcfa0b0297 | ||
|
|
9fde765e22 | ||
|
|
437e5e98cc | ||
|
|
2aeea4ef0e | ||
|
|
d0304a251e | ||
|
|
7d2698473d | ||
|
|
51ab247bc5 | ||
|
|
ff83391e97 | ||
|
|
3c97ae4c5c | ||
|
|
917a8f09db | ||
|
|
a523fd3742 | ||
|
|
fe2b7d6060 | ||
|
|
ce5e02bd20 | ||
|
|
212bb21e7c | ||
|
|
ea22c0f891 | ||
|
|
a0e2193383 | ||
|
|
711ae62ed2 | ||
|
|
f5df3b7d7e | ||
|
|
77a0fb4e01 | ||
|
|
cd8305b07a | ||
|
|
cfaa68317a |
27
.idea/artifacts/KotlinBarePlugin.xml
generated
27
.idea/artifacts/KotlinBarePlugin.xml
generated
@@ -1,27 +0,0 @@
|
||||
<component name="ArtifactManager">
|
||||
<artifact name="KotlinBarePlugin">
|
||||
<output-path>$PROJECT_DIR$/out/artifacts/BareKotlin</output-path>
|
||||
<properties id="ant-postprocessing">
|
||||
<options enabled="true">
|
||||
<file>file://$PROJECT_DIR$/idea-runner/runner.xml</file>
|
||||
<target>copy-runtime-for-idea-plugin</target>
|
||||
</options>
|
||||
</properties>
|
||||
<root id="root">
|
||||
<element id="directory" name="kotlinc">
|
||||
<element id="dir-copy" path="$PROJECT_DIR$/dist/kotlinc" />
|
||||
</element>
|
||||
<element id="directory" name="lib">
|
||||
<element id="archive" name="kotlin-bare-plugin.jar">
|
||||
<element id="module-output" name="bare-plugin" />
|
||||
<element id="module-output" name="descriptor.loader.java" />
|
||||
<element id="module-output" name="frontend.java" />
|
||||
<element id="module-output" name="descriptors" />
|
||||
</element>
|
||||
<element id="directory" name="jps">
|
||||
<element id="artifact" artifact-name="KotlinJpsPlugin" />
|
||||
</element>
|
||||
</element>
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
||||
4
.idea/artifacts/KotlinPlugin.xml
generated
4
.idea/artifacts/KotlinPlugin.xml
generated
@@ -38,6 +38,7 @@
|
||||
<element id="module-output" name="ide-common" />
|
||||
<element id="file-copy" path="$PROJECT_DIR$/resources/kotlinManifest.properties" />
|
||||
<element id="module-output" name="idea-android" />
|
||||
<element id="module-output" name="idea-android-output-parser" />
|
||||
<element id="module-output" name="js.serializer" />
|
||||
<element id="module-output" name="serialization" />
|
||||
<element id="module-output" name="idea-completion" />
|
||||
@@ -47,8 +48,11 @@
|
||||
<element id="module-output" name="idea-repl" />
|
||||
<element id="module-output" name="idea-live-templates" />
|
||||
<element id="module-output" name="resolution" />
|
||||
<element id="module-output" name="plugin-api" />
|
||||
<element id="module-output" name="idea-ultimate" />
|
||||
<element id="module-output" name="formatter" />
|
||||
<element id="module-output" name="idea-maven" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/protobuf-2.6.1.jar" path-in-jar="/" />
|
||||
</element>
|
||||
<element id="library" level="project" name="javax.inject" />
|
||||
<element id="directory" name="jps">
|
||||
|
||||
8
.idea/dictionaries/Alexey_Sedunov.xml
generated
Normal file
8
.idea/dictionaries/Alexey_Sedunov.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="Alexey.Sedunov">
|
||||
<words>
|
||||
<w>inplace</w>
|
||||
<w>renamer</w>
|
||||
</words>
|
||||
</dictionary>
|
||||
</component>
|
||||
1
.idea/dictionaries/Nikolay_Krasko.xml
generated
1
.idea/dictionaries/Nikolay_Krasko.xml
generated
@@ -16,6 +16,7 @@
|
||||
<w>preloading</w>
|
||||
<w>preprocess</w>
|
||||
<w>redeclarations</w>
|
||||
<w>smap</w>
|
||||
<w>subclassed</w>
|
||||
<w>subgraph</w>
|
||||
<w>substep</w>
|
||||
|
||||
5
.idea/kotlinc.xml
generated
5
.idea/kotlinc.xml
generated
@@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Kotlin2JsCompilerArguments">
|
||||
<option name="moduleKind" value="plain" />
|
||||
</component>
|
||||
<component name="KotlinCompilerSettings">
|
||||
<option name="additionalArguments" value="-version -Xallow-kotlin-package -Xskip-metadata-version-check" />
|
||||
<option name="additionalArguments" value="-version -Xallow-kotlin-package -Xskip-metadata-version-check -language-version 1.0" />
|
||||
</component>
|
||||
</project>
|
||||
1
.idea/libraries/android_plugin.xml
generated
1
.idea/libraries/android_plugin.xml
generated
@@ -6,6 +6,7 @@
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/android/lib" />
|
||||
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/android/lib/jps" />
|
||||
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/android-common.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
|
||||
11
.idea/libraries/java_decompiler_plugin.xml
generated
Normal file
11
.idea/libraries/java_decompiler_plugin.xml
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
<component name="libraryTable">
|
||||
<library name="java-decompiler-plugin">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/java-decompiler/lib/java-decompiler.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
3
.idea/libraries/jps.xml
generated
3
.idea/libraries/jps.xml
generated
@@ -8,7 +8,6 @@
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/dependencies/protobuf-java-2.5.0-sources.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/antLayout/src" />
|
||||
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/jps-builders/src" />
|
||||
@@ -24,4 +23,4 @@
|
||||
</SOURCES>
|
||||
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/jps" recursive="false" />
|
||||
</library>
|
||||
</component>
|
||||
</component>
|
||||
4
.idea/libraries/protobuf_java.xml
generated
4
.idea/libraries/protobuf_java.xml
generated
@@ -4,11 +4,11 @@
|
||||
<root url="file://$PROJECT_DIR$/annotations" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/protobuf-2.5.0.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/dependencies/protobuf-2.6.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/dependencies/protobuf-java-2.5.0-sources.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/dependencies/protobuf-2.6.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -49,7 +49,7 @@
|
||||
<component name="ProjectResources">
|
||||
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
<component name="SuppressABINotification">
|
||||
|
||||
5
.idea/modules.xml
generated
5
.idea/modules.xml
generated
@@ -10,10 +10,10 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/android-studio/android-studio.iml" filepath="$PROJECT_DIR$/android-studio/android-studio.iml" group="ide" />
|
||||
<module fileurl="file://$PROJECT_DIR$/compiler/android-tests/android-tests.iml" filepath="$PROJECT_DIR$/compiler/android-tests/android-tests.iml" group="compiler" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/annotation-collector/annotation-collector.iml" filepath="$PROJECT_DIR$/plugins/annotation-collector/annotation-collector.iml" group="plugins" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/annotation-processing/annotation-processing.iml" filepath="$PROJECT_DIR$/plugins/annotation-processing/annotation-processing.iml" group="plugins" />
|
||||
<module fileurl="file://$PROJECT_DIR$/ant/ant.iml" filepath="$PROJECT_DIR$/ant/ant.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/compiler/backend/backend.iml" filepath="$PROJECT_DIR$/compiler/backend/backend.iml" group="compiler/java" />
|
||||
<module fileurl="file://$PROJECT_DIR$/compiler/backend-common/backend-common.iml" filepath="$PROJECT_DIR$/compiler/backend-common/backend-common.iml" group="compiler" />
|
||||
<module fileurl="file://$PROJECT_DIR$/jps-plugin/bare-plugin/bare-plugin.iml" filepath="$PROJECT_DIR$/jps-plugin/bare-plugin/bare-plugin.iml" group="ide/jps" />
|
||||
<module fileurl="file://$PROJECT_DIR$/build-common/build-common.iml" filepath="$PROJECT_DIR$/build-common/build-common.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/core/builtins/builtins.iml" filepath="$PROJECT_DIR$/core/builtins/builtins.iml" group="core" />
|
||||
<module fileurl="file://$PROJECT_DIR$/compiler/builtins-serializer/builtins-serializer.iml" filepath="$PROJECT_DIR$/compiler/builtins-serializer/builtins-serializer.iml" group="compiler/cli" />
|
||||
@@ -41,15 +41,18 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/idea/idea.iml" filepath="$PROJECT_DIR$/idea/idea.iml" group="ide" />
|
||||
<module fileurl="file://$PROJECT_DIR$/idea/idea-analysis/idea-analysis.iml" filepath="$PROJECT_DIR$/idea/idea-analysis/idea-analysis.iml" group="ide" />
|
||||
<module fileurl="file://$PROJECT_DIR$/idea/idea-android/idea-android.iml" filepath="$PROJECT_DIR$/idea/idea-android/idea-android.iml" group="ide" />
|
||||
<module fileurl="file://$PROJECT_DIR$/idea/idea-android/idea-android-output-parser/idea-android-output-parser.iml" filepath="$PROJECT_DIR$/idea/idea-android/idea-android-output-parser/idea-android-output-parser.iml" group="ide" />
|
||||
<module fileurl="file://$PROJECT_DIR$/idea/idea-completion/idea-completion.iml" filepath="$PROJECT_DIR$/idea/idea-completion/idea-completion.iml" group="ide" />
|
||||
<module fileurl="file://$PROJECT_DIR$/idea/idea-core/idea-core.iml" filepath="$PROJECT_DIR$/idea/idea-core/idea-core.iml" group="ide" />
|
||||
<module fileurl="file://$PROJECT_DIR$/idea/idea-jps-common/idea-jps-common.iml" filepath="$PROJECT_DIR$/idea/idea-jps-common/idea-jps-common.iml" group="ide" />
|
||||
<module fileurl="file://$PROJECT_DIR$/idea/idea-live-templates/idea-live-templates.iml" filepath="$PROJECT_DIR$/idea/idea-live-templates/idea-live-templates.iml" group="ide" />
|
||||
<module fileurl="file://$PROJECT_DIR$/idea/idea-maven/idea-maven.iml" filepath="$PROJECT_DIR$/idea/idea-maven/idea-maven.iml" group="ide" />
|
||||
<module fileurl="file://$PROJECT_DIR$/idea/idea-repl/idea-repl.iml" filepath="$PROJECT_DIR$/idea/idea-repl/idea-repl.iml" group="ide" />
|
||||
<module fileurl="file://$PROJECT_DIR$/idea-runner/idea-runner.iml" filepath="$PROJECT_DIR$/idea-runner/idea-runner.iml" group="ide" />
|
||||
<module fileurl="file://$PROJECT_DIR$/idea/idea-test-framework/idea-test-framework.iml" filepath="$PROJECT_DIR$/idea/idea-test-framework/idea-test-framework.iml" group="ide" />
|
||||
<module fileurl="file://$PROJECT_DIR$/compiler/preloader/instrumentation/instrumentation.iml" filepath="$PROJECT_DIR$/compiler/preloader/instrumentation/instrumentation.iml" group="compiler/cli" />
|
||||
<module fileurl="file://$PROJECT_DIR$/j2k/j2k.iml" filepath="$PROJECT_DIR$/j2k/j2k.iml" group="j2k" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/java-model-wrappers/java-model-wrappers.iml" filepath="$PROJECT_DIR$/plugins/java-model-wrappers/java-model-wrappers.iml" group="plugins" />
|
||||
<module fileurl="file://$PROJECT_DIR$/jps-plugin/jps-plugin.iml" filepath="$PROJECT_DIR$/jps-plugin/jps-plugin.iml" group="ide/jps" />
|
||||
<module fileurl="file://$PROJECT_DIR$/jps-plugin/jps-tests/jps-tests.iml" filepath="$PROJECT_DIR$/jps-plugin/jps-tests/jps-tests.iml" group="ide/jps" />
|
||||
<module fileurl="file://$PROJECT_DIR$/js/js.dart-ast/js.dart-ast.iml" filepath="$PROJECT_DIR$/js/js.dart-ast/js.dart-ast.iml" group="compiler/js" />
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="package" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="package" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx900m -XX:MaxPermSize=320m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx900m -XX:MaxPermSize=320m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="package" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1300m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1100m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
|
||||
2
.idea/runConfigurations/All_in_jps_tests.xml
generated
2
.idea/runConfigurations/All_in_jps_tests.xml
generated
@@ -8,7 +8,7 @@
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="package" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Djna.nosys=true" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
||||
<module name="android-tests" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" value="1.8" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" value="1.6" />
|
||||
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.android.tests" />
|
||||
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.android.tests.AndroidRunner" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="class" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx850m -XX:+UseCodeCacheFlushing" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx850m -XX:+UseCodeCacheFlushing -Djna.nosys=true" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
|
||||
2
.idea/runConfigurations/Compiler_Tests.xml
generated
2
.idea/runConfigurations/Compiler_Tests.xml
generated
@@ -13,7 +13,7 @@
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="package" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx900m -XX:MaxPermSize=320m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx700m -XX:MaxPermSize=300m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
|
||||
2
.idea/runConfigurations/Eval4j_Tests.xml
generated
2
.idea/runConfigurations/Eval4j_Tests.xml
generated
@@ -8,7 +8,7 @@
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="package" />
|
||||
<option name="VM_PARAMETERS" value="-ea" />
|
||||
<option name="VM_PARAMETERS" value="-ea -Djna.nosys=true" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
|
||||
2
.idea/runConfigurations/J2K_Tests.xml
generated
2
.idea/runConfigurations/J2K_Tests.xml
generated
@@ -13,7 +13,7 @@
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="pattern" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx700m" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx700m -Djna.nosys=true" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
|
||||
2
.idea/runConfigurations/Java_8_Tests.xml
generated
2
.idea/runConfigurations/Java_8_Tests.xml
generated
@@ -13,7 +13,7 @@
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="package" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
|
||||
2
.idea/runConfigurations/Js_backend_tests.xml
generated
2
.idea/runConfigurations/Js_backend_tests.xml
generated
@@ -8,7 +8,7 @@
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="package" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing" />
|
||||
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -Djna.nosys=true" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="package" />
|
||||
<option name="VM_PARAMETERS" value="-ea" />
|
||||
<option name="VM_PARAMETERS" value="-ea -Djna.nosys=true" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="pattern" />
|
||||
<option name="VM_PARAMETERS" value="-ea -Xmx850m" />
|
||||
<option name="VM_PARAMETERS" value="-ea -Xmx850m -Djna.nosys=true" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
|
||||
2
.idea/scopes/IDE.xml
generated
2
.idea/scopes/IDE.xml
generated
@@ -1,3 +1,3 @@
|
||||
<component name="DependencyValidationManager">
|
||||
<scope name="IDE" pattern="file[idea]:src/*/||file[idea]:testData/*/||file[ide-common]:src/*/||file[idea-analysis]:src/*/||file[idea-android]:src/*/||file[idea-completion]:src/*/||file[idea-completion]:testData/*/||file[idea-core]:src/*/||file[idea-jps-common]:/*/||file[idea-live-templates]:/*/||file[idea-live-templates]:testData/*/||file[idea-repl]:/*/" />
|
||||
<scope name="IDE" pattern="file[idea]:src/*/||file[idea]:testData/*/||file[ide-common]:src/*/||file[idea-analysis]:src/*/||file[idea-android]:src/*/||file[idea-completion]:src/*/||file[idea-completion]:testData/*/||file[idea-core]:src/*/||file[idea-jps-common]:/*/||file[idea-live-templates]:/*/||file[idea-live-templates]:testData/*/||file[idea-repl]:/*/||src[idea-android-output-parser]:*..*" />
|
||||
</component>
|
||||
809
ChangeLog.md
809
ChangeLog.md
@@ -1,47 +1,791 @@
|
||||
# CHANGELOG
|
||||
|
||||
<!-- Find: ([^\[/])(KT-\d+) -->
|
||||
<!-- Replace: $1[$2](https://youtrack.jetbrains.com/issue/$2) -->
|
||||
<!-- Find: ([^\`/\[])(KT-\d+) -->
|
||||
<!-- Replace: $1[`$2`](https://youtrack.jetbrains.com/issue/$2) -->
|
||||
|
||||
## 1.1
|
||||
## 1.0.4
|
||||
|
||||
### Compiler
|
||||
|
||||
#### Analysis & diagnostics
|
||||
|
||||
- [`KT-10968`](https://youtrack.jetbrains.com/issue/KT-10968), [`KT-11075`](https://youtrack.jetbrains.com/issue/KT-11075), [`KT-12286`](https://youtrack.jetbrains.com/issue/KT-12286) Type inference of callable references
|
||||
- [`KT-11892`](https://youtrack.jetbrains.com/issue/KT-11892) Report error on qualified super call to a supertype extended by a different supertype
|
||||
- [`KT-12875`](https://youtrack.jetbrains.com/issue/KT-12875) Report error on incorrect call of member extension invoke
|
||||
- [`KT-12847`](https://youtrack.jetbrains.com/issue/KT-12847) Report error on accessing protected property setter from super class' companion
|
||||
- [`KT-12322`](https://youtrack.jetbrains.com/issue/KT-12322) Overload resolution ambiguity with constructor reference when class has a companion object
|
||||
- [`KT-11440`](https://youtrack.jetbrains.com/issue/KT-11440) Overload resolution ambiguity on specialized Map.put implementation from Java
|
||||
- [`KT-11389`](https://youtrack.jetbrains.com/issue/KT-11389) Runtime exception when calling Java primitive overloadings
|
||||
- [`KT-8200`](https://youtrack.jetbrains.com/issue/KT-8200) Exception when using non-generic interface with generic arguments
|
||||
- [`KT-10237`](https://youtrack.jetbrains.com/issue/KT-10237) Exception on an unresolved symbol in a type parameter bound in the 'where' clause
|
||||
- [`KT-11821`](https://youtrack.jetbrains.com/issue/KT-11821) Exception on incorrect number of generic arguments in a type parameter bound in the 'where' clause
|
||||
- [`KT-12482`](https://youtrack.jetbrains.com/issue/KT-12482) Exception: Implementation doesn't have the most specific type, but none of the other overridden methods does either
|
||||
- [`KT-12687`](https://youtrack.jetbrains.com/issue/KT-12687) Exception when 'data' modifier is applied to object
|
||||
- [`KT-9620`](https://youtrack.jetbrains.com/issue/KT-9620) AssertionError in DescriptorResolver#checkBounds
|
||||
- [`KT-3689`](https://youtrack.jetbrains.com/issue/KT-3689) IllegalAccess on a property with private setter of the subclass
|
||||
- [`KT-6391`](https://youtrack.jetbrains.com/issue/KT-6391) Wrong warning for array casting (Array<Any?> to Array<Any>)
|
||||
- [`KT-8596`](https://youtrack.jetbrains.com/issue/KT-8596) Exception when analyzing nested class constructor reference in an argument position
|
||||
- [`KT-12982`](https://youtrack.jetbrains.com/issue/KT-12982) Incorrect type inference when accessing mutable protected property via reflection
|
||||
- [`KT-13206`](https://youtrack.jetbrains.com/issue/KT-13206) Report "Cast never succeeds" if and only if ClassCastException can be predicted
|
||||
- [`KT-12467`](https://youtrack.jetbrains.com/issue/KT-12467) IllegalStateException: Concrete fake override should have exactly one concrete super-declaration: []
|
||||
- [`KT-13340`](https://youtrack.jetbrains.com/issue/KT-13340) Report "return is not allowed here" only on the return keyword, not the whole expression
|
||||
- [`KT-2349`](https://youtrack.jetbrains.com/issue/KT-2349), [`KT-6054`](https://youtrack.jetbrains.com/issue/KT-6054) Report "uninitialized enum entry" if enum entry is referenced before its declaration
|
||||
- [`KT-12809`](https://youtrack.jetbrains.com/issue/KT-12809) Report "uninitialized variable" if property is referenced before its declaration
|
||||
- [`KT-260`](https://youtrack.jetbrains.com/issue/KT-260) Do not report "cast never succeeds" when casting nullable to nullable
|
||||
- [`KT-11769`](https://youtrack.jetbrains.com/issue/KT-11769) Prohibit access from enum instance initialization code to members of enum's companion object
|
||||
- [`KT-13371`](https://youtrack.jetbrains.com/issue/KT-13371) Fix CompilationException: Rewrite at slice LEAKING_THIS key: REFERENCE_EXPRESSION
|
||||
- [`KT-13401`](https://youtrack.jetbrains.com/issue/KT-13401) Fix StackOverflowError when checking variance
|
||||
- [`KT-13330`](https://youtrack.jetbrains.com/issue/KT-13330), [`KT-13349`](https://youtrack.jetbrains.com/issue/KT-13349) Fix AssertionError: Illegal resolved call to variable with invoke
|
||||
- [`KT-13421`](https://youtrack.jetbrains.com/issue/KT-13421) Fix AssertionError: Only integer constants should be checked for overflow
|
||||
- [`KT-13555`](https://youtrack.jetbrains.com/issue/KT-13555) Fix internal error "resolveToInstruction"
|
||||
- [`KT-8989`](https://youtrack.jetbrains.com/issue/KT-8989) Change error messages: Replace "invisible_fake" with "invisible (private in a supertype)"
|
||||
- [`KT-13612`](https://youtrack.jetbrains.com/issue/KT-13612) Val reassignment in try / catch
|
||||
- [`KT-5469`](https://youtrack.jetbrains.com/issue/KT-5469) Incorrect "is never used" warning for value used in catch block
|
||||
- [`KT-13510`](https://youtrack.jetbrains.com/issue/KT-13510) Missing "Nested class not allowed" error for anonymous object inside val initializer
|
||||
- [`KT-13685`](https://youtrack.jetbrains.com/issue/KT-13685) Fix NPE when resolving callable references on incomplete code
|
||||
- Change error messages: Fix quotes around keywords in diagnostic messages
|
||||
- Change error messages: Remove quotes around visibilities
|
||||
|
||||
#### Parser
|
||||
|
||||
- [`KT-7118`](https://youtrack.jetbrains.com/issue/KT-7118) Improve error message after trailing dot in floating point literal
|
||||
- [`KT-4948`](https://youtrack.jetbrains.com/issue/KT-4948) Recover by following keyword
|
||||
- [`KT-7915`](https://youtrack.jetbrains.com/issue/KT-7915) Recover after val with no subsequent name
|
||||
- [`KT-12987`](https://youtrack.jetbrains.com/issue/KT-12987) Recover after val with no name before declaration starting with soft keyword
|
||||
|
||||
#### JVM code generation
|
||||
|
||||
- [`KT-12909`](https://youtrack.jetbrains.com/issue/KT-12909) Do not generate redundant bridge for special built-in override
|
||||
- [`KT-11915`](https://youtrack.jetbrains.com/issue/KT-11915) Exception in entrySet when Map implementation in Kotlin extends another one
|
||||
- [`KT-12755`](https://youtrack.jetbrains.com/issue/KT-12755) Exception on property generation in multi-file classes
|
||||
- [`KT-12983`](https://youtrack.jetbrains.com/issue/KT-12983) VerifyError: Bad type on operand stack in arraylength
|
||||
- [`KT-12908`](https://youtrack.jetbrains.com/issue/KT-12908) Variable initialization in loop causes VerifyError: Bad local variable type
|
||||
- [`KT-13040`](https://youtrack.jetbrains.com/issue/KT-13040) Invalid bytecode generated for extension lambda invocation with safe call
|
||||
- [`KT-13023`](https://youtrack.jetbrains.com/issue/KT-13023) Char operations throw ClassCastException for boxed Chars
|
||||
- [`KT-11634`](https://youtrack.jetbrains.com/issue/KT-11634) Exception for super call in delegation
|
||||
- [`KT-12359`](https://youtrack.jetbrains.com/issue/KT-12359) Redundant stubs are generated on inheriting from java.util.Collection
|
||||
- [`KT-11833`](https://youtrack.jetbrains.com/issue/KT-11833) Error generating constructors of class on anonymous object inheriting from nested class of super class
|
||||
- [`KT-13133`](https://youtrack.jetbrains.com/issue/KT-13133) Incorrect InnerClasses attribute value for anonymous object copied from an inline function
|
||||
- [`KT-13241`](https://youtrack.jetbrains.com/issue/KT-13241) Indices optimization leads to VerifyError with smart cast receiver
|
||||
- [`KT-13374`](https://youtrack.jetbrains.com/issue/KT-13374) Fix compiler exception when inline function contains anonymous object implementing an interface by delegation
|
||||
|
||||
##### Generated code performance
|
||||
|
||||
- [`KT-11964`](https://youtrack.jetbrains.com/issue/KT-11964) No TABLESWITCH in when on enum bytecode if enum constant is imported
|
||||
- [`KT-6916`](https://youtrack.jetbrains.com/issue/KT-6916) Optimize 'for' over 'downTo'
|
||||
- [`KT-12733`](https://youtrack.jetbrains.com/issue/KT-12733) Optimize 'for' over 'rangeTo' as a non-qualified call
|
||||
|
||||
### Standard Library
|
||||
|
||||
- [`KT-13115`](https://youtrack.jetbrains.com/issue/KT-13115), [`KT-13297`](https://youtrack.jetbrains.com/issue/KT-13297) Improve documentation formatting, clarify documentation for `FileTreeWalk`, `Sequence` and `generateSequence`.
|
||||
- [`KT-12894`](https://youtrack.jetbrains.com/issue/KT-12894) Do not fail in `Closeable.use` if the resource is `null`.
|
||||
|
||||
### Reflection
|
||||
|
||||
- [`KT-12915`](https://youtrack.jetbrains.com/issue/KT-12915) Runtime exception on callBy of JvmStatic function with default arguments
|
||||
- [`KT-12967`](https://youtrack.jetbrains.com/issue/KT-12967) Runtime exception on reference to generic property
|
||||
- [`KT-13370`](https://youtrack.jetbrains.com/issue/KT-13370) NullPointerException on companionObjectInstance of a built-in class
|
||||
- [`KT-13462`](https://youtrack.jetbrains.com/issue/KT-13462) Make KClass for primitive type equal to the corresponding KClass for wrapper type
|
||||
|
||||
### IDE
|
||||
|
||||
- [`KT-12655`](https://youtrack.jetbrains.com/issue/KT-12655) New Kotlin file: extra error message for already existing file
|
||||
- [`KT-12760`](https://youtrack.jetbrains.com/issue/KT-12760) Prohibit running non-Unit returning main function
|
||||
- [`KT-12893`](https://youtrack.jetbrains.com/issue/KT-12893) Impossible to open Kotlin compiler settings
|
||||
- [`KT-10433`](https://youtrack.jetbrains.com/issue/KT-10433) Copy-pasting reference to companion object member causes import dialog
|
||||
- [`KT-12803`](https://youtrack.jetbrains.com/issue/KT-12803) Class is marked as unused when it is only used is in method reference
|
||||
- [`KT-13084`](https://youtrack.jetbrains.com/issue/KT-13084) Run test method action executes all tests from same kotlin file
|
||||
- [`KT-12718`](https://youtrack.jetbrains.com/issue/KT-12718) Deadlock due to index reentering
|
||||
- [`KT-13114`](https://youtrack.jetbrains.com/issue/KT-13114) 'Unused declaration' option 'JUnit static methods' is always enabled
|
||||
- [`KT-12997`](https://youtrack.jetbrains.com/issue/KT-12997) Override/Implement Members: Support "Copy JavaDoc" options for library classes
|
||||
- [`KT-12887`](https://youtrack.jetbrains.com/issue/KT-12887) "Extend selection" should select call's invoked expression
|
||||
- [`KT-13383`](https://youtrack.jetbrains.com/issue/KT-13383), [`KT-13379`](https://youtrack.jetbrains.com/issue/KT-13379) Override/Implement Members: Do not make return type non-nullable if base return type is explicitly nullable
|
||||
- [`KT-13218`](https://youtrack.jetbrains.com/issue/KT-13218) Extract Function: Fix AssertionError on callable references
|
||||
- [`KT-6520`](https://youtrack.jetbrains.com/issue/KT-6520) Introduce 'maino' and 'psvmo' templates for generating main in object
|
||||
- [`KT-13455`](https://youtrack.jetbrains.com/issue/KT-13455) Override/Implement: Make return type non-nullable (platform collection case) when overriding Java method
|
||||
- [`KT-10209`](https://youtrack.jetbrains.com/issue/KT-10209) Find Usages: Do not duplicate containing declaration in super member warning dialog
|
||||
- [`KT-12977`](https://youtrack.jetbrains.com/issue/KT-12977) Hybrid dependency causes "outdated binary" warning to appear in non-js project
|
||||
- [`KT-13057`](https://youtrack.jetbrains.com/issue/KT-13057) Go to inheritors on Enum should navigate to all enum classes
|
||||
- Fix exception when choose Gradle configurer after project is synced
|
||||
- Allow configuring Kotlin in Gradle module without Kotlin sources
|
||||
- Show all Kotlin annotations when browsing hierarchy of "java.lang.Annotation"
|
||||
|
||||
#### Completion
|
||||
|
||||
- [`KT-12793`](https://youtrack.jetbrains.com/issue/KT-12793) Suggest abstract protected extension methods
|
||||
|
||||
#### Performance
|
||||
|
||||
- [`KT-12645`](https://youtrack.jetbrains.com/issue/KT-12645) Lazily calculate FQ name for local classes
|
||||
- [`KT-13071`](https://youtrack.jetbrains.com/issue/KT-13071) Fix severe freezes because of long lint checks on large files
|
||||
|
||||
#### Highlighting
|
||||
|
||||
- [`KT-12937`](https://youtrack.jetbrains.com/issue/KT-12937) Java synthetic accessors highlighting does not differ from local variables
|
||||
|
||||
#### KDoc
|
||||
|
||||
- [`KT-12998`](https://youtrack.jetbrains.com/issue/KT-12998) Backslash is not rendered
|
||||
- [`KT-12999`](https://youtrack.jetbrains.com/issue/KT-12999) Backtick inside inline code block is not rendered
|
||||
- [`KT-13000`](https://youtrack.jetbrains.com/issue/KT-13000) Exclamation mark is not rendered
|
||||
- [`KT-10398`](https://youtrack.jetbrains.com/issue/KT-10398) Fully qualified link is not resolved in editor
|
||||
- [`KT-12932`](https://youtrack.jetbrains.com/issue/KT-12932) Link to library element is not clickable
|
||||
- [`KT-10654`](https://youtrack.jetbrains.com/issue/KT-10654) Quick Doc can't follow KDoc link in referenced function description
|
||||
- [`KT-9271`](https://youtrack.jetbrains.com/issue/KT-9271) Show Quick Doc for implicit lambda parameter 'it'
|
||||
|
||||
#### Formatter
|
||||
|
||||
- [`KT-12830`](https://youtrack.jetbrains.com/issue/KT-12830) Remove spaces before *?* in nullable types
|
||||
- [`KT-13314`](https://youtrack.jetbrains.com/issue/KT-13314) Format spaces around !is and !in
|
||||
|
||||
#### Intention actions, inspections and quickfixes
|
||||
|
||||
##### New features
|
||||
|
||||
- [`KT-12152`](https://youtrack.jetbrains.com/issue/KT-12152) "Leaking this" inspection reports dangerous operations inside constructors including:
|
||||
|
||||
* Accessing non-final property in constructor
|
||||
* Calling non-final function in constructor
|
||||
* Using 'this' as function argument in constructor of non-final class
|
||||
|
||||
- [`KT-13187`](https://youtrack.jetbrains.com/issue/KT-13187) "Make constructor parameter a val" should make the val private or public depending on its option
|
||||
- [`KT-5771`](https://youtrack.jetbrains.com/issue/KT-5771) Mark setter parameter type as redundant and provide quickfix to remove it
|
||||
- [`KT-9228`](https://youtrack.jetbrains.com/issue/KT-9228) Add quickfix to remove '@' from annotation used as argument of another annotation
|
||||
- [`KT-12251`](https://youtrack.jetbrains.com/issue/KT-12251) Add quickfix to fix type mismatch for primitive literals
|
||||
- [`KT-12838`](https://youtrack.jetbrains.com/issue/KT-12838) Add quickfix for "Illegal usage of inline parameter" that adds `noinline`
|
||||
- [`KT-13134`](https://youtrack.jetbrains.com/issue/KT-13134) Add quickfix for wrong Long suffix (Use `L` instead of `l`)
|
||||
- [`KT-10903`](https://youtrack.jetbrains.com/issue/KT-10903) Add intention to convert lambda to function reference
|
||||
- [`KT-7492`](https://youtrack.jetbrains.com/issue/KT-7492) Support "Create abstract function/property" inside an abstract class
|
||||
- [`KT-10668`](https://youtrack.jetbrains.com/issue/KT-10668) Support "Create member/extension" corresponding to the extension receiver of enclosing function
|
||||
- [`KT-12553`](https://youtrack.jetbrains.com/issue/KT-12553) Show versions in inspection about different version of Kotlin plugin in Maven and IDE plugin
|
||||
- [`KT-12489`](https://youtrack.jetbrains.com/issue/KT-12489) Implement intention to replace camel-case test function name with a space-separated one
|
||||
- [`KT-12730`](https://youtrack.jetbrains.com/issue/KT-12730) Warn about using different versions of Kotlin Gradle plugin and bundled compiler
|
||||
- [`KT-13173`](https://youtrack.jetbrains.com/issue/KT-13173) Handle more cases in "Add Const Modifier" Intention
|
||||
- [`KT-12628`](https://youtrack.jetbrains.com/issue/KT-12628) Quickfix for `invoke` operator unsafe calls
|
||||
- [`KT-11425`](https://youtrack.jetbrains.com/issue/KT-11425) Inspection and quickfix to replace usages of `equals()` and `compareTo()` with operators
|
||||
- [`KT-13113`](https://youtrack.jetbrains.com/issue/KT-13113) Inspection to detect redundant string templates
|
||||
- [`KT-13011`](https://youtrack.jetbrains.com/issue/KT-13011) Inspection and quickfix for unnecessary lateinit
|
||||
- [`KT-10731`](https://youtrack.jetbrains.com/issue/KT-10731) Inspection and quickfix for unnecessary use of toString() inside string interpolation
|
||||
- [`KT-12043`](https://youtrack.jetbrains.com/issue/KT-12043) Intention to add / remove braces for when entry/entries
|
||||
- [`KT-13483`](https://youtrack.jetbrains.com/issue/KT-13483) Intention to replace `a..b-1` with `a until b` and vice versa
|
||||
- [`KT-6975`](https://youtrack.jetbrains.com/issue/KT-6975) Quickfix for adding 'inline' to a function with reified generic
|
||||
|
||||
##### Bugfixes
|
||||
|
||||
- Show receiver type in the text of "Create extension" quick fix
|
||||
- Show target class name in the text of "Create member" quick fix
|
||||
- [`KT-12869`](https://youtrack.jetbrains.com/issue/KT-12869) Usages of overridden Java method through synthetic accessors are not found
|
||||
- [`KT-12813`](https://youtrack.jetbrains.com/issue/KT-12813) "Find Usages" for property returns function calls
|
||||
- [`KT-7722`](https://youtrack.jetbrains.com/issue/KT-7722) Approximate unresolvable types in "Create from Usage" quickfixes
|
||||
- [`KT-11115`](https://youtrack.jetbrains.com/issue/KT-11115) Implement Members: Fix base member detection when abstract and non-abstract members with matching signatures are inherited from an interface
|
||||
- [`KT-12876`](https://youtrack.jetbrains.com/issue/KT-12876) Bogus suggestion to move property to constructor
|
||||
- [`KT-13055`](https://youtrack.jetbrains.com/issue/KT-13055) Exception in "Specify Type Explicitly" intention
|
||||
- [`KT-12942`](https://youtrack.jetbrains.com/issue/KT-12942) "Replace 'when' with 'if'" intention changes semantics when 'if' statements are used
|
||||
- [`KT-12646`](https://youtrack.jetbrains.com/issue/KT-12646) 'Convert to block body' should use partial body resolve
|
||||
- [`KT-12919`](https://youtrack.jetbrains.com/issue/KT-12919) Use simple class name in "Change function return type" quickfix
|
||||
- [`KT-13151`](https://youtrack.jetbrains.com/issue/KT-13151) Incorrect warning "Make variable immutable"
|
||||
- [`KT-13170`](https://youtrack.jetbrains.com/issue/KT-13170) "Declaration has platform type" inspection: by default should not be reported for platform type arguments
|
||||
- [`KT-13262`](https://youtrack.jetbrains.com/issue/KT-13262) "Wrap with safe let call" quickfix produces wrong result for qualified function
|
||||
- [`KT-13364`](https://youtrack.jetbrains.com/issue/KT-13364) Do not suggest creating annotations/enum classes for unresolved type parameter bounds
|
||||
- [`KT-12627`](https://youtrack.jetbrains.com/issue/KT-12627) Allow warnings suppression for secondary constructor
|
||||
- [`KT-13365`](https://youtrack.jetbrains.com/issue/KT-13365) Disable "Create property" (non-abstract) in interfaces. Make "Create function" (non-abstract) generate function body in interfaces
|
||||
- [`KT-8903`](https://youtrack.jetbrains.com/issue/KT-8903) Remove Unused Receiver: update function/property usages
|
||||
- [`KT-11799`](https://youtrack.jetbrains.com/issue/KT-11799) Create from Usage: Make extension functions/properties 'private' by default
|
||||
- [`KT-11795`](https://youtrack.jetbrains.com/issue/KT-11795) Create from Usage: Place extension properties after the usage and generate stub getter
|
||||
- [`KT-12951`](https://youtrack.jetbrains.com/issue/KT-12951) Prohibit "Convert to expression body" when function body is 'if' without 'else' or 'when' is non-exhaustive
|
||||
- [`KT-13430`](https://youtrack.jetbrains.com/issue/KT-13430) "Add non-null asserted (!!) call" quickfix can't process unary operators
|
||||
- [`KT-13336`](https://youtrack.jetbrains.com/issue/KT-13336) "Convert concatenation to template" intention appends literal to variable omitting braces
|
||||
- [`KT-13328`](https://youtrack.jetbrains.com/issue/KT-13328) Do not suggest "Replace infix with safe call" inside conditions or binary / unary expressions
|
||||
- [`KT-13452`](https://youtrack.jetbrains.com/issue/KT-13452) "Replace if expression with assignment" doesn't work for cascade if-else if-else
|
||||
- [`KT-13184`](https://youtrack.jetbrains.com/issue/KT-13184) "Different Kotlin Version" inspection: false positive caused by verbose plugin version name
|
||||
- [`KT-13480`](https://youtrack.jetbrains.com/issue/KT-13480) "Can be replaced with comparison" inspection: false positive if extension method called 'equals' is used
|
||||
- [`KT-13288`](https://youtrack.jetbrains.com/issue/KT-13288) "Unused property" inspection: false positive when extending abstract class and implementing interface
|
||||
- [`KT-13432`](https://youtrack.jetbrains.com/issue/KT-13432) "Replace with safe call" quickfix does not work with `compareTo()` usage
|
||||
- [`KT-13444`](https://youtrack.jetbrains.com/issue/KT-13444) "Invert if" intention changes semantics for nested if with return
|
||||
- [`KT-13536`](https://youtrack.jetbrains.com/issue/KT-13536) Fix StackOverflowError from "Unused Symbol" inspection after importing enum's values()
|
||||
- [`KT-12820`](https://youtrack.jetbrains.com/issue/KT-12820) Platform Type Inspection: !! quickfix shouldn't be available when any generic parameter has platform type
|
||||
- [`KT-9825`](https://youtrack.jetbrains.com/issue/KT-9825) Incorrect "unused variable" warning when used in finally block
|
||||
- [`KT-13715`](https://youtrack.jetbrains.com/issue/KT-13715) Prohibit applying "Change to star projection" to functional types
|
||||
|
||||
#### Refactorings
|
||||
|
||||
##### New features
|
||||
|
||||
- [`KT-12017`](https://youtrack.jetbrains.com/issue/KT-12017) Inline Property: Support "Do not show this dialog" and "Inline this occurrence" options
|
||||
|
||||
##### Bugfixes
|
||||
|
||||
- [`KT-11176`](https://youtrack.jetbrains.com/issue/KT-11176) Add a space before '{' in functions generated "Generate hashCode/equals/toString"
|
||||
- [`KT-12294`](https://youtrack.jetbrains.com/issue/KT-12294) Introduce Property: Fix extraction of expressions referring to primary constructor parameters
|
||||
- [`KT-12413`](https://youtrack.jetbrains.com/issue/KT-12413) Change Signature: Fix bogus warning about unresolved type parameters/invalid functional type replacement
|
||||
- [`KT-12084`](https://youtrack.jetbrains.com/issue/KT-12084) Introduce Property: Do not skip outer classes if extractable expression is contained in object literal
|
||||
- [`KT-13082`](https://youtrack.jetbrains.com/issue/KT-13082) Rename: Fix exception on property rename preview
|
||||
- [`KT-13207`](https://youtrack.jetbrains.com/issue/KT-13207) Safe delete: Fix exception when removing any function in 2016.2
|
||||
- [`KT-12945`](https://youtrack.jetbrains.com/issue/KT-12945) Rename: Fix function description in super method warning dialog
|
||||
- [`KT-12922`](https://youtrack.jetbrains.com/issue/KT-12922) Introduce Variable: Do not suggest expressions without type
|
||||
- [`KT-12943`](https://youtrack.jetbrains.com/issue/KT-12943) Rename: Show function signatures in "Rename Overloads" dialog
|
||||
- [`KT-13157`](https://youtrack.jetbrains.com/issue/KT-13157) Extract Function: Automatically quote function name if necessary
|
||||
- [`KT-13010`](https://youtrack.jetbrains.com/issue/KT-13010) Extract Function: Fix generation of destructuring declarations
|
||||
- [`KT-13128`](https://youtrack.jetbrains.com/issue/KT-13128) Introduce Variable: Retain entered name after changing "Specify type explicitly" option
|
||||
- [`KT-13054`](https://youtrack.jetbrains.com/issue/KT-13054) Introduce Variable: Skip leading/trailing comments inside selection
|
||||
- [`KT-13385`](https://youtrack.jetbrains.com/issue/KT-13385) Move: Quote package name (if necessary) when moving declarations to new file
|
||||
- [`KT-13395`](https://youtrack.jetbrains.com/issue/KT-13395) Introduce Property: Fix duplicate count in popup window
|
||||
- [`KT-13277`](https://youtrack.jetbrains.com/issue/KT-13277) Change Signature: Fix usage processing to prevent interfering with Python support plugin
|
||||
- [`KT-13254`](https://youtrack.jetbrains.com/issue/KT-13254) Rename: Conflict detection for type parameters
|
||||
- [`KT-13282`](https://youtrack.jetbrains.com/issue/KT-13282), [`KT-13283`](https://youtrack.jetbrains.com/issue/KT-13283) Rename: Fix name quoting for automatic renamers
|
||||
- [`KT-13239`](https://youtrack.jetbrains.com/issue/KT-13239) Rename: Warn about function name conflicts
|
||||
- [`KT-13174`](https://youtrack.jetbrains.com/issue/KT-13174) Move: Warn about accessibility conflicts due to moving to unrelated module
|
||||
- [`KT-13175`](https://youtrack.jetbrains.com/issue/KT-13175) Move: Warn about accessibility conflicts when moving entire file
|
||||
- [`KT-13240`](https://youtrack.jetbrains.com/issue/KT-13240) Rename: Do not report shadowing conflict if redeclaration is detected
|
||||
- [`KT-13253`](https://youtrack.jetbrains.com/issue/KT-13253) Rename: Report conflicts for constructor parameters
|
||||
- [`KT-12971`](https://youtrack.jetbrains.com/issue/KT-12971) Push Down: Do not specifiy visibility on generated overriding members
|
||||
- [`KT-13124`](https://youtrack.jetbrains.com/issue/KT-13124) Pull Up: Skip super members without explicit declarations
|
||||
- [`KT-13032`](https://youtrack.jetbrains.com/issue/KT-13032) Rename: Support accessors with non-conventional names
|
||||
- [`KT-13463`](https://youtrack.jetbrains.com/issue/KT-13463) Rename: Quote parameter name when necessary
|
||||
- [`KT-13476`](https://youtrack.jetbrains.com/issue/KT-13476) Rename: Fix parameter rename when new name matches call selector
|
||||
- [`KT-9381`](https://youtrack.jetbrains.com/issue/KT-9381) Rename: Do not search for component convention usages
|
||||
- [`KT-13488`](https://youtrack.jetbrains.com/issue/KT-13488) Rename: Support rename of packages with non-standard quoted names
|
||||
|
||||
#### Debugger
|
||||
|
||||
##### New features
|
||||
|
||||
- [`KT-7549`](https://youtrack.jetbrains.com/issue/KT-7549) Provide an option to use the Kotlin syntax when evaluating watches and expressions in Java files
|
||||
|
||||
##### Bugfixes
|
||||
|
||||
- [`KT-13059`](https://youtrack.jetbrains.com/issue/KT-13059) Fix error stepping on *Step Over* action in the end of while block
|
||||
- [`KT-13037`](https://youtrack.jetbrains.com/issue/KT-13037) Fix possible deadlock in debugger in 2016.1 and exception in 2016.2
|
||||
- [`KT-12651`](https://youtrack.jetbrains.com/issue/KT-12651) Fix exception in evaluate expression when bad identifier is used for marking object
|
||||
- [`KT-12896`](https://youtrack.jetbrains.com/issue/KT-12896) Fix "Step In" to inline functions for Android
|
||||
- [`KT-13269`](https://youtrack.jetbrains.com/issue/KT-13269) Make quick evaluate work on receiver in qualified expressions
|
||||
- [`KT-12641`](https://youtrack.jetbrains.com/issue/KT-12641) Unknown error on evaluate expression containing inline functions with complicated environment
|
||||
- [`KT-13163`](https://youtrack.jetbrains.com/issue/KT-13163) Fix exception when evaluating expression: Access is allowed from event dispatch thread only.
|
||||
|
||||
### JS
|
||||
|
||||
#### New features
|
||||
|
||||
- [`KT-3008`](https://youtrack.jetbrains.com/issue/KT-3008) Option to generate require.js and AMD compatible modules
|
||||
- [`KT-5987`](https://youtrack.jetbrains.com/issue/KT-5987) Add ability to refer to class
|
||||
- [`KT-4115`](https://youtrack.jetbrains.com/issue/KT-4115) Provide method to get Kotlin type name
|
||||
|
||||
#### Bugfixes
|
||||
|
||||
- [`KT-8003`](https://youtrack.jetbrains.com/issue/KT-8003) Compiler exception on 'throw throw'
|
||||
- [`KT-8318`](https://youtrack.jetbrains.com/issue/KT-8318) Wrong result for 'when' containing only 'else' block
|
||||
- [`KT-12157`](https://youtrack.jetbrains.com/issue/KT-12157) Compiler exception on `when` condition containing `return`, `break` or `continue`
|
||||
- [`KT-12275`](https://youtrack.jetbrains.com/issue/KT-12275) Fix code generation with inline function call in condition of `while`/`do..while`
|
||||
- [`KT-13160`](https://youtrack.jetbrains.com/issue/KT-13160) Fix compiler exception when left-hand side of assignment is array access and right-hand side is inline function
|
||||
- [`KT-12864`](https://youtrack.jetbrains.com/issue/KT-12864) Make enums comparable
|
||||
- [`KT-12865`](https://youtrack.jetbrains.com/issue/KT-12865) Implementing Comparable breaks inheritance
|
||||
- [`KT-12928`](https://youtrack.jetbrains.com/issue/KT-12928) Nested inline causes undefined reference access
|
||||
- [`KT-12929`](https://youtrack.jetbrains.com/issue/KT-12929) Code with callable reference crashed at runtime (in some JS VMs)
|
||||
- [`KT-13043`](https://youtrack.jetbrains.com/issue/KT-13043) Invalid invocation generated for secondary constructor that calls constructor from base class with default parameters
|
||||
- [`KT-13025`](https://youtrack.jetbrains.com/issue/KT-13025) 'function?.invoke' does not work properly with extension functions
|
||||
- [`KT-12807`](https://youtrack.jetbrains.com/issue/KT-12807) Lambda was lost in generated code
|
||||
- [`KT-12808`](https://youtrack.jetbrains.com/issue/KT-12808) Compiler duplicates arguments and the body of lambda when lambda is in RHS of assignment operator
|
||||
- [`KT-12873`](https://youtrack.jetbrains.com/issue/KT-12873) Fix ReferenceError when class delegates to complex expression
|
||||
- [`KT-13658`](https://youtrack.jetbrains.com/issue/KT-13658) Wrong code when capturing object
|
||||
|
||||
|
||||
### Tools
|
||||
|
||||
#### Gradle
|
||||
|
||||
- Gradle versions < 2.0 are not supported
|
||||
- [`KT-13234`](https://youtrack.jetbrains.com/issue/KT-13234) Setting kotlinOptions.destination and kotlinOptions.classpath is deprecated
|
||||
- [`KT-9392`](https://youtrack.jetbrains.com/issue/KT-9392) Kotlin classes are missing after converting Java class to Kotlin
|
||||
- [`KT-12736`](https://youtrack.jetbrains.com/issue/KT-12736) Kotlin classes are deleted when generated Java source is changed
|
||||
- [`KT-12658`](https://youtrack.jetbrains.com/issue/KT-12658) Build fails after android resources are edited
|
||||
- [`KT-12750`](https://youtrack.jetbrains.com/issue/KT-12750) Non clean compilation fails with gradle 2.14
|
||||
- [`KT-12912`](https://youtrack.jetbrains.com/issue/KT-12912) New class from subproject is unresolved with subsequent build with Gradle Daemon
|
||||
- [`KT-12962`](https://youtrack.jetbrains.com/issue/KT-12962) Incremental compilation: Track changes in generated files
|
||||
- [`KT-12923`](https://youtrack.jetbrains.com/issue/KT-12923) Incremental compilation: Compile error when code using internal class is modified
|
||||
- [`KT-13528`](https://youtrack.jetbrains.com/issue/KT-13528) Incremental compilation: support multi-project incremental compilation
|
||||
- [`KT-13732`](https://youtrack.jetbrains.com/issue/KT-13732) Android Build folder littered with `copyFlavourTypeXXX`
|
||||
|
||||
#### KAPT
|
||||
|
||||
##### New features
|
||||
|
||||
- [`KT-13499`](https://youtrack.jetbrains.com/issue/KT-13499) Implement Annotation Processing API (JSR 269) natively in Kotlin
|
||||
|
||||
##### Bugfixes
|
||||
|
||||
- [`KT-12776`](https://youtrack.jetbrains.com/issue/KT-12776) Android build fails with KAPT and generateStubs depending on library module names
|
||||
- [`KT-13179`](https://youtrack.jetbrains.com/issue/KT-13179) Java is recompiled every time with Gradle 2.14 and KAPT
|
||||
- [`KT-12303`](https://youtrack.jetbrains.com/issue/KT-12303), [`KT-12113`](https://youtrack.jetbrains.com/issue/KT-12113) Do not pass non-relevant annotations to processors
|
||||
|
||||
#### REPL
|
||||
|
||||
- [`KT-12389`](https://youtrack.jetbrains.com/issue/KT-12389) REPL just quits when toString() of user class throws an exception
|
||||
|
||||
#### CLI & Ant
|
||||
|
||||
- [`KT-13237`](https://youtrack.jetbrains.com/issue/KT-13237) Include kotlin-reflect.jar to classpath by default, add '-no-reflect' key to suppress this behavior
|
||||
|
||||
#### CLI
|
||||
|
||||
- [`KT-13491`](https://youtrack.jetbrains.com/issue/KT-13491) Support '-no-reflect' in 'kotlin' command
|
||||
|
||||
#### Maven
|
||||
|
||||
- [`KT-13211`](https://youtrack.jetbrains.com/issue/KT-13211) Provide better compilation failure info for TeamCity builds
|
||||
|
||||
#### Compiler daemon
|
||||
|
||||
- Fix exception "java.lang.NoClassDefFoundError: Could not initialize class kotlin.Unit"
|
||||
|
||||
## 1.0.3
|
||||
|
||||
### Compiler
|
||||
|
||||
#### Analysis & diagnostics
|
||||
|
||||
- Combination of `open` and `override` is no longer a warning
|
||||
- [`KT-4829`](https://youtrack.jetbrains.com/issue/KT-4829) Equal conditions in `when` is now a warning
|
||||
- [`KT-6611`](https://youtrack.jetbrains.com/issue/KT-6611) "This cast can never succeed" warning is no longer reported for `Foo<T> as Foo<Any>`
|
||||
- [`KT-7174`](https://youtrack.jetbrains.com/issue/KT-7174) Declaring members with the same signature as non-overridable methods from Java classes (like Object.wait/notify) is now an error (when targeting JVM)
|
||||
- [`KT-12302`](https://youtrack.jetbrains.com/issue/KT-12302) `abstract` modifier for a member of interface is no longer a warning
|
||||
- [`KT-12452`](https://youtrack.jetbrains.com/issue/KT-12452) `open` modifier for a member of interface without implementation is now a warning
|
||||
- [`KT-11111`](https://youtrack.jetbrains.com/issue/KT-11111) Overriding by inline function is now a warning, overriding by a function with reified type parameter is an error
|
||||
- [`KT-12337`](https://youtrack.jetbrains.com/issue/KT-12337) Reference to a property with invisible setter now has KProperty type (as opposed to KMutableProperty)
|
||||
|
||||
###### Issues fixed
|
||||
|
||||
- [`KT-4285`](https://youtrack.jetbrains.com/issue/KT-4285) No warning for a non-tail call when the method inherits default arguments from superclass
|
||||
- [`KT-4764`](https://youtrack.jetbrains.com/issue/KT-4764) Spurious "Variable must be initialized" in try/catch/finally
|
||||
- [`KT-6665`](https://youtrack.jetbrains.com/issue/KT-6665) Unresolved reference leads to marking subsequent code unreachable
|
||||
- [`KT-11750`](https://youtrack.jetbrains.com/issue/KT-11750) Exceptions when creating various entries with the name "name" in enums
|
||||
- [`KT-11998`](https://youtrack.jetbrains.com/issue/KT-11998) Smart cast to not-null is not performed on a boolean property in `if` condition
|
||||
- [`KT-10648`](https://youtrack.jetbrains.com/issue/KT-10648) Exhaustiveness check does not work when sealed class hierarchy contains intermediate sealed classes
|
||||
- [`KT-10717`](https://youtrack.jetbrains.com/issue/KT-10717) Type inference for lambda with local return
|
||||
- [`KT-11266`](https://youtrack.jetbrains.com/issue/KT-11266) Fixed "Empty intersection of types" internal compiler error for some cases
|
||||
- [`KT-11857`](https://youtrack.jetbrains.com/issue/KT-11857) Fix visibility check for dynamic members within protected method (when targeting JS)
|
||||
- [`KT-12589`](https://youtrack.jetbrains.com/issue/KT-12589) Improved "`infix` modifier is inapplicable" diagnostic message
|
||||
- [`KT-11679`](https://youtrack.jetbrains.com/issue/KT-11679) Erroneous call with argument causes Throwable at ResolvedCallImpl.getArgumentMapping()
|
||||
- [`KT-12623`](https://youtrack.jetbrains.com/issue/KT-12623) Fix ISE on malformed code
|
||||
|
||||
#### JVM code generation
|
||||
|
||||
- [`KT-5075`](https://youtrack.jetbrains.com/issue/KT-5075) Optimize array/collection indices usage in `for` loop
|
||||
- [`KT-11116`](https://youtrack.jetbrains.com/issue/KT-11116) Optimize coercion to Unit, POP operations are backward-propagated
|
||||
|
||||
###### Issues fixed
|
||||
- [`KT-11499`](https://youtrack.jetbrains.com/issue/KT-11499) Compiler crashes with "Incompatible stack heights"
|
||||
- [`KT-11943`](https://youtrack.jetbrains.com/issue/KT-11943) CompilationException with extension property of KClass
|
||||
- [`KT-12125`](https://youtrack.jetbrains.com/issue/KT-12125) Wrong increment/decrement on Byte/Char/Short.MAX_VALUE/MIN_VALUE
|
||||
- [`KT-12192`](https://youtrack.jetbrains.com/issue/KT-12192) Exhaustiveness check isn't generated for when expression returning Unit
|
||||
- [`KT-12200`](https://youtrack.jetbrains.com/issue/KT-12200) Erroneously optimized away assignment to a property initialized to zero
|
||||
- [`KT-12582`](https://youtrack.jetbrains.com/issue/KT-12582) "VerifyError: Bad local variable type" caused by explicit loop variable type
|
||||
- [`KT-12708`](https://youtrack.jetbrains.com/issue/KT-12708) Bridge method not generated when data class implements interface with copy() method
|
||||
- [`KT-12106`](https://youtrack.jetbrains.com/issue/KT-12106) import static of reified companion object method throws IllegalAccessError
|
||||
|
||||
#### Performance
|
||||
|
||||
- Reduced number of IO operation when loading kotlin compiled classes
|
||||
|
||||
#### Сompiler options
|
||||
|
||||
- Allow to specify version of Kotlin language for source compatibility with older releases.
|
||||
- CLI: `-language-version` command line option
|
||||
- Maven: `languageVersion` configuration parameter, linked with `kotlin.compiler.languageVersion` property
|
||||
- Gradle: `kotlinOptions.languageVersion` property in task configuration
|
||||
- Allow to specify which java runtime target version to generate bytecode for.
|
||||
- CLI: `-jvm-target` command line option
|
||||
- Maven: `jvmTarget` configuration parameter, linked with `kotlin.compiler.jvmTarget` property
|
||||
- Gradle: `kotlinOptions.jvmTarget` property in task configuration
|
||||
- Allow to specify path to JDK to resolve classes from.
|
||||
- CLI: `-jdk-home` command line option
|
||||
- Maven: `jdkHome` configuration parameter, linked with `kotlin.compiler.jdkHome` property
|
||||
- Gradle: `kotlinOptions.jdkHome` property in task configuration
|
||||
|
||||
### Standard Library
|
||||
|
||||
- Improve documentation (including [`KT-11632`](https://youtrack.jetbrains.com/issue/KT-11632))
|
||||
- List iteration used in collection operations is performed with an indexed loop when the list supports `RandomAccess` and the operation isn't inlined
|
||||
|
||||
### IDE
|
||||
|
||||
New features:
|
||||
#### Completion
|
||||
|
||||
###### New features
|
||||
|
||||
- Smart completion after `by` and `in`
|
||||
- Improved completion in bodies of overridden members (when no type is specified)
|
||||
- Improved presentation of completion items for property accessors
|
||||
- Fixed keyword completion after `try` in assignment expression
|
||||
- [`KT-8527`](https://youtrack.jetbrains.com/issue/KT-8527) Include non-imported declarations on the first completion
|
||||
- [`KT-12068`](https://youtrack.jetbrains.com/issue/KT-12068) Special completion item for "[]" get-operator access
|
||||
- [`KT-12080`](https://youtrack.jetbrains.com/issue/KT-12080) Parameter names are now higher up in completion list
|
||||
|
||||
###### Issues fixed
|
||||
- Fixed enum members being present in completion as static members
|
||||
- Fixed QuickDoc not working for properties generated for java classes
|
||||
- [`KT-9166`](https://youtrack.jetbrains.com/issue/KT-9166) Code completion does not work for synthetic java properties on typing "g"
|
||||
- [`KT-11609`](https://youtrack.jetbrains.com/issue/KT-11609) No named arguments completion should be after dot
|
||||
- [`KT-11633`](https://youtrack.jetbrains.com/issue/KT-11633) Wrong indentation after completing a statement in data class
|
||||
- [`KT-11680`](https://youtrack.jetbrains.com/issue/KT-11680) Code completion of label for existing return with value inserts redundant whitespace
|
||||
- [`KT-11784`](https://youtrack.jetbrains.com/issue/KT-11784) Completion for `if` statement should add parentheses automatically
|
||||
- [`KT-11890`](https://youtrack.jetbrains.com/issue/KT-11890) Completion for callable references does not propose static Java members
|
||||
- [`KT-11912`](https://youtrack.jetbrains.com/issue/KT-11912) String interpolation is not converted to ${} form when accessing this.property
|
||||
- [`KT-11957`](https://youtrack.jetbrains.com/issue/KT-11957) No `catch` and `finally` keywords in completion
|
||||
- [`KT-12103`](https://youtrack.jetbrains.com/issue/KT-12103) Smart completion for nested SAM-adapter produces short unresolved name
|
||||
- [`KT-12138`](https://youtrack.jetbrains.com/issue/KT-12138) Do not show "::error" in smart completion when any function type accepting one argument is expected
|
||||
- [`KT-12150`](https://youtrack.jetbrains.com/issue/KT-12150) Smart completion suggests to compare non-nullable with null
|
||||
- [`KT-12124`](https://youtrack.jetbrains.com/issue/KT-12124) No code completion for a java property in a specific position
|
||||
- [`KT-12299`](https://youtrack.jetbrains.com/issue/KT-12299) Completion: incorrect priority of property foo over method getFoo in Kotlin-only code
|
||||
- [`KT-12328`](https://youtrack.jetbrains.com/issue/KT-12328) Qualified function name inserted when typing before `if`
|
||||
- [`KT-12427`](https://youtrack.jetbrains.com/issue/KT-12427) Completion doesn't work for "@receiver:" annotation target
|
||||
- [`KT-12447`](https://youtrack.jetbrains.com/issue/KT-12447) Don't use CompletionProgressIndicator in Kotlin plugin
|
||||
- [`KT-12669`](https://youtrack.jetbrains.com/issue/KT-12669) Completion should show variant with `()` when there is default lambda
|
||||
- [`KT-12369`](https://youtrack.jetbrains.com/issue/KT-12369) Pressing dot after class name should not cause insertion of constructor call
|
||||
|
||||
#### Spring support
|
||||
|
||||
###### New features
|
||||
|
||||
- [`KT-11692`](https://youtrack.jetbrains.com/issue/KT-11692) Support Spring model diagrams for Kotlin classes
|
||||
- [`KT-12079`](https://youtrack.jetbrains.com/issue/KT-12079) Support "Autowired members defined in invalid Spring bean" inspection on Kotlin declarations
|
||||
- [`KT-12092`](https://youtrack.jetbrains.com/issue/KT-12092) Implement bean references in @Qualifier annotations
|
||||
- [`KT-12135`](https://youtrack.jetbrains.com/issue/KT-12135) Automatically configure components based on `basePackageClasses` attribute of @ComponentScan
|
||||
- [`KT-12136`](https://youtrack.jetbrains.com/issue/KT-12136) Implement package references inside of string literals
|
||||
- [`KT-12139`](https://youtrack.jetbrains.com/issue/KT-12139) Support Spring configurations linked via @Import annotation
|
||||
- [`KT-12278`](https://youtrack.jetbrains.com/issue/KT-12278) Implement Spring @Autowired inspection
|
||||
- [`KT-12465`](https://youtrack.jetbrains.com/issue/KT-12465) Implement Spring @ComponentScan inspection
|
||||
|
||||
###### Issues fixed
|
||||
|
||||
- [`KT-12091`](https://youtrack.jetbrains.com/issue/KT-12091) Fixed unstable behavior of Spring line markers
|
||||
- [`KT-12096`](https://youtrack.jetbrains.com/issue/KT-12096) Fixed rename of custom-named beans specified with Kotlin annotation
|
||||
- [`KT-12117`](https://youtrack.jetbrains.com/issue/KT-12117) Group Kotlin classes from the same file in the Choose Bean dialog
|
||||
- [`KT-12120`](https://youtrack.jetbrains.com/issue/KT-12120) Show autowiring candidates line markers for @Autowired-annotated constructors and constructor parameters
|
||||
- [`KT-12122`](https://youtrack.jetbrains.com/issue/KT-12122) Fixed line marker popup on functions with @Qualifier-annotated parameters
|
||||
- [`KT-12143`](https://youtrack.jetbrains.com/issue/KT-12143) Fixed "Spring Facet Code Configuration (Kotlin)" inspection description
|
||||
- [`KT-12147`](https://youtrack.jetbrains.com/issue/KT-12147) Fixed exception on analyzing object declaration with @Component annotation
|
||||
- [`KT-12148`](https://youtrack.jetbrains.com/issue/KT-12148) Warn about object declarations annotated with Spring `@Configuration`/`@Component`/etc.
|
||||
- [`KT-12363`](https://youtrack.jetbrains.com/issue/KT-12363) Fixed "Autowired members defined in invalid Spring bean (Kotlin)" inspection description
|
||||
- [`KT-12366`](https://youtrack.jetbrains.com/issue/KT-12366) Fixed exception on analyzing class declaration upon annotation typing
|
||||
- [`KT-12384`](https://youtrack.jetbrains.com/issue/KT-12384) Fixed bean references in factory method calls
|
||||
|
||||
#### Intention actions, inspections and quickfixes
|
||||
|
||||
###### New features
|
||||
|
||||
- New icon for "New -> Kotlin Activity" action
|
||||
- "Change visibility on exposure" and "Make visible" fixes now support all possible visibilities
|
||||
- [`KT-8477`](https://youtrack.jetbrains.com/issue/KT-8477) New inspection "Can be primary constructor property" with quick-fix
|
||||
- [`KT-5010`](https://youtrack.jetbrains.com/issue/KT-5010) "Redundant semicolon" inspection with quickfix
|
||||
- [`KT-9757`](https://youtrack.jetbrains.com/issue/KT-9757) Quickfix for "Unused lambda expression" warning
|
||||
- [`KT-10844`](https://youtrack.jetbrains.com/issue/KT-10844) Quick fix to add crossinline modifier
|
||||
- [`KT-11090`](https://youtrack.jetbrains.com/issue/KT-11090) "Add variance modifiers to type parameters" inspection
|
||||
- [`KT-11255`](https://youtrack.jetbrains.com/issue/KT-11255) Move Element Left/Right actions
|
||||
- [`KT-11450`](https://youtrack.jetbrains.com/issue/KT-11450) "Modality is redundant" inspection
|
||||
- [`KT-11523`](https://youtrack.jetbrains.com/issue/KT-11523) "Add @JvmOverloads annotation" intention
|
||||
- [`KT-11768`](https://youtrack.jetbrains.com/issue/KT-11768) "Introduce local variable" intention
|
||||
- [`KT-11806`](https://youtrack.jetbrains.com/issue/KT-11806) Quick-fix to increase visibility for invisible member
|
||||
- [`KT-11807`](https://youtrack.jetbrains.com/issue/KT-11807) Use function body template when generating overriding functions with default body
|
||||
- [`KT-11864`](https://youtrack.jetbrains.com/issue/KT-11864) Suggest "Create function/secondary constructor" quick fix on argument type mismatch
|
||||
- [`KT-11876`](https://youtrack.jetbrains.com/issue/KT-11876) Quickfix for "Extension function type is not allowed as supertype" error
|
||||
- [`KT-11920`](https://youtrack.jetbrains.com/issue/KT-11920) "Increase visibility" and "Decrease visibility" quickfixes for exposed visibility errors
|
||||
- [`KT-12089`](https://youtrack.jetbrains.com/issue/KT-12089) Quickfix "Make primary constructor parameter a property"
|
||||
- [`KT-12121`](https://youtrack.jetbrains.com/issue/KT-12121) "Add `toString()` call" quickfix
|
||||
- [`KT-11104`](https://youtrack.jetbrains.com/issue/KT-11104) New quickfixes for nullability problems: "Surround with null check" and "Wrap with safe let call"
|
||||
- [`KT-12310`](https://youtrack.jetbrains.com/issue/KT-12310) New inspection "Member has platform type" with quickfix
|
||||
|
||||
###### Issues fixed
|
||||
|
||||
- Fixed "Convert property initializer getter" intention being available inside lambda initializer
|
||||
- Improved message for "Can be declared as `val`" inspection
|
||||
- [`KT-3797`](https://youtrack.jetbrains.com/issue/KT-3797) Quickfix to make a function abstract should not be offered for object members
|
||||
- [`KT-11866`](https://youtrack.jetbrains.com/issue/KT-11866) Suggest "Create secondary constructor" when constructors exist but are not applicable
|
||||
- [`KT-11482`](https://youtrack.jetbrains.com/issue/KT-11482) Fixed exception in "Move to companion object" intention
|
||||
- [`KT-11483`](https://youtrack.jetbrains.com/issue/KT-11483) Pass implicit receiver as argument when moving member function to companion object
|
||||
- [`KT-11512`](https://youtrack.jetbrains.com/issue/KT-11512) Allow choosing any source root in "Move file to directory" intention
|
||||
- [`KT-10950`](https://youtrack.jetbrains.com/issue/KT-10950) Keep original file package name when moving top-level declarations to separate file (provided it's not ambiguous)
|
||||
- [`KT-10174`](https://youtrack.jetbrains.com/issue/KT-10174) Optimize imports after applying "Move declaration to separate file" intention
|
||||
- [`KT-11764`](https://youtrack.jetbrains.com/issue/KT-11764) Intention "Replace with a `forEach` function call should replace `continue` with `return@forEach`
|
||||
- [`KT-11724`](https://youtrack.jetbrains.com/issue/KT-11724) False suggestion to replace with compound assignment
|
||||
- [`KT-11805`](https://youtrack.jetbrains.com/issue/KT-11805) Invert if-condition intention breaks code in case of end of line comment
|
||||
- [`KT-11811`](https://youtrack.jetbrains.com/issue/KT-11811) "Make protected" intention for a val declared in parameters of constructor
|
||||
- [`KT-11710`](https://youtrack.jetbrains.com/issue/KT-11710) "Replace `if` with elvis operator": incorrect code generated for `if` expression
|
||||
- [`KT-11849`](https://youtrack.jetbrains.com/issue/KT-11849) Replace explicit parameter with `it` changes the meaning of code because of the shadowing
|
||||
- [`KT-11870`](https://youtrack.jetbrains.com/issue/KT-11870) "Replace with Elvis" refactoring doesn't change the variable type from T? to T
|
||||
- [`KT-12069`](https://youtrack.jetbrains.com/issue/KT-12069) Specify language for all Kotlin code inspections
|
||||
- [`KT-11366`](https://youtrack.jetbrains.com/issue/KT-11366) "object `Companion` is never used" warning in intellij
|
||||
- [`KT-11275`](https://youtrack.jetbrains.com/issue/KT-11275) Inconsistent behaviour of "move lambda argument out of parentheses" intention action when using lambda calls with function arguments without parentheses
|
||||
- [`KT-11594`](https://youtrack.jetbrains.com/issue/KT-11594) "Add non-null asserted (!!) call" applied to unsafe cast to nullable type causes AE at KtPsiFactory.createExpression()
|
||||
- [`KT-11982`](https://youtrack.jetbrains.com/issue/KT-11982) False "Redundant final modifier" reported
|
||||
- [`KT-12040`](https://youtrack.jetbrains.com/issue/KT-12040) "Replace when with if" produce invalid code for first entry which has comment
|
||||
- [`KT-12204`](https://youtrack.jetbrains.com/issue/KT-12204) "Use classpath of module" option in existing Kotlin run configuration may be changed when a new run configuration is created
|
||||
- [`KT-10635`](https://youtrack.jetbrains.com/issue/KT-10635) Don't mark private writeObject and readObject methods of Serializable classes as unused
|
||||
- [`KT-11466`](https://youtrack.jetbrains.com/issue/KT-11466) "Make abstract" quick fix applies to outer class of object with accidentally abstract function
|
||||
- [`KT-11120`](https://youtrack.jetbrains.com/issue/KT-11120) Constructor parameter/field reported as unused symbol even if it have `used` annotation
|
||||
- [`KT-11974`](https://youtrack.jetbrains.com/issue/KT-11974) Invert if-condition intention loses comments
|
||||
- [`KT-10812`](https://youtrack.jetbrains.com/issue/KT-10812) Globally unused constructors are not marked as such
|
||||
- [`KT-11320`](https://youtrack.jetbrains.com/issue/KT-11320) Don't mark @BeforeClass (JUnit4) annotated functions as unused
|
||||
- [`KT-12267`](https://youtrack.jetbrains.com/issue/KT-12267) "Change type" quick fix converts to Int for Long literal
|
||||
- [`KT-11949`](https://youtrack.jetbrains.com/issue/KT-11949) Various problems fixed with "Constructor parameter is never used as a property" inspection
|
||||
- [`KT-11716`](https://youtrack.jetbrains.com/issue/KT-11716) "Simply `for` using destructuring declaration" intention: incorrect behavior for data classes
|
||||
- [`KT-12145`](https://youtrack.jetbrains.com/issue/KT-12145) "Simplify `for` using destructuring declaration" should work even when no variables declared inside loop
|
||||
- [`KT-11933`](https://youtrack.jetbrains.com/issue/KT-11933) Entities used only by alias are marked as unused
|
||||
- [`KT-12193`](https://youtrack.jetbrains.com/issue/KT-12193) Convert to block body isn't equivalent for when expressions returning Unit
|
||||
- [`KT-10779`](https://youtrack.jetbrains.com/issue/KT-10779) Simplify `for` using destructing declaration: intention / inspection quick fix is available only when all variables are used
|
||||
- [`KT-11281`](https://youtrack.jetbrains.com/issue/KT-11281) Fix exception on applying "Convert to class" intention to Java interface with Kotlin inheritor(s)
|
||||
- [`KT-12285`](https://youtrack.jetbrains.com/issue/KT-12285) Fix exception on test class generation
|
||||
- [`KT-12502`](https://youtrack.jetbrains.com/issue/KT-12502) Convert to expression body should be forbidden for non-exhaustive when returning Unit
|
||||
- [`KT-12260`](https://youtrack.jetbrains.com/issue/KT-12260) ISE while replacing an operator with safe call
|
||||
- [`KT-12649`](https://youtrack.jetbrains.com/issue/KT-12649) "Convert if to when" intention incorrectly deletes code
|
||||
- [`KT-12671`](https://youtrack.jetbrains.com/issue/KT-12671) "Shot type" action: "Type is unknown" error on an invoked expression
|
||||
- [`KT-12284`](https://youtrack.jetbrains.com/issue/KT-12284) Too wide applicability range for "Add braces to else" intention
|
||||
- [`KT-11975`](https://youtrack.jetbrains.com/issue/KT-11975) "Invert if-condition" intention does not simplify `is` expression
|
||||
- [`KT-12437`](https://youtrack.jetbrains.com/issue/KT-12437) "Replace explicit parameter" intention is suggested for parameter of inner lambda in presence of `it` from outer lambda
|
||||
- [`KT-12290`](https://youtrack.jetbrains.com/issue/KT-12290) Navigate to the generated declaration when using "Implement abstract member" intention
|
||||
- [`KT-12376`](https://youtrack.jetbrains.com/issue/KT-12376) Don't show "Package directive doesn't match file location" in injected code
|
||||
- [`KT-12777`](https://youtrack.jetbrains.com/issue/KT-12777) Fix exception in "Create class" quickfix applied to unresolved references in type arguments
|
||||
|
||||
#### Language injection
|
||||
|
||||
- [KT-11768](https://youtrack.jetbrains.com/issue/KT-11768) Implement "Introduce local variable" intention
|
||||
- [KT-11692](https://youtrack.jetbrains.com/issue/KT-11692) Support Spring model diagrams for Kotlin classes
|
||||
- [KT-11574](https://youtrack.jetbrains.com/issue/KT-11574) Support predefined Java positions for language injection
|
||||
- [KT-2428](https://youtrack.jetbrains.com/issue/KT-11574) Support basic use-cases of language injection for expressions marked with @Language annotation
|
||||
- Add comment or @Language annotation after "Inject language or reference" intention automatically
|
||||
- Apply injection for the literals in property initializer through property usages
|
||||
- [KT-11807](https://youtrack.jetbrains.com/issue/KT-11807) Use function body template when generating overriding functions with default body
|
||||
- Enable injection from Java or Kotlin function declaration by annotating parameter with @Language annotation
|
||||
- [`KT-2428`](https://youtrack.jetbrains.com/issue/KT-2428) Support basic use-cases of language injection for expressions marked with @Language annotation
|
||||
- [`KT-11574`](https://youtrack.jetbrains.com/issue/KT-11574) Support predefined Java positions for language injection
|
||||
- [`KT-11472`](https://youtrack.jetbrains.com/issue/KT-11472) Add comment or @Language annotation after "Inject language or reference" intention automatically
|
||||
|
||||
Issues fixed:
|
||||
#### Refactorings
|
||||
|
||||
- [KT-11145](https://youtrack.jetbrains.com/issue/KT-11145) Use progress indicator when searching usages in Introduce Parameter
|
||||
- [KT-11155](https://youtrack.jetbrains.com/issue/KT-11155) Allow running multiple Kotlin classes as well as running mixtures of Kotlin and Java classes
|
||||
- [KT-11495](https://youtrack.jetbrains.com/issue/KT-11495) Show recursion line markers for extension function calls with different receiver
|
||||
- [KT-11659](https://youtrack.jetbrains.com/issue/KT-11659) Generate abstract overrides for Any members inside of Kotlin interfaces
|
||||
- [KT-11866](https://youtrack.jetbrains.com/issue/KT-11866) Suggest "Create secondary constructor" when constructors exist but are not applicable
|
||||
- [KT-11908](https://youtrack.jetbrains.com/issue/KT-11866) Allow properties with custom setters to be used in generated equals/hashCode/toString
|
||||
- [KT-11845](https://youtrack.jetbrains.com/issue/KT-11845) Fixed exception on attempt to find derived classes
|
||||
- [KT-11736](https://youtrack.jetbrains.com/issue/KT-11736) Fixed searching of Java usages for @JvmStatic properties and @JvmStatic @JvmOverloads functions
|
||||
- [KT-8817](https://youtrack.jetbrains.com/issue/KT-8817) Fixed rename of Java getters/setters through synthetic property references in Kotlin
|
||||
- [KT-11617](https://youtrack.jetbrains.com/issue/KT-11617) Fixed title of Introduce Parameter declaration chooser
|
||||
- [KT-11817](https://youtrack.jetbrains.com/issue/KT-11817) Fixed rename of Kotlin enum constants through Java references
|
||||
- [KT-11816](https://youtrack.jetbrains.com/issue/KT-11816) Fixed usages search for Safe Delete on simple enum entries
|
||||
- [KT-11282](https://youtrack.jetbrains.com/issue/KT-11282) Delete interface reference from super-type list when applying Safe Delete to Java interface
|
||||
- [KT-11967](https://youtrack.jetbrains.com/issue/KT-11967) Fix Find Usages/Rename for parameter references in XML files
|
||||
###### New features
|
||||
- [`KT-6372`](https://youtrack.jetbrains.com/issue/KT-6372) Add name suggestions to Rename dialog
|
||||
- [`KT-7851`](https://youtrack.jetbrains.com/issue/KT-7851) Respect naming conventions in automatic variable rename
|
||||
- [`KT-8044`](https://youtrack.jetbrains.com/issue/KT-8044), [`KT-9432`](https://youtrack.jetbrains.com/issue/KT-9432) Support @JvmName annotation in rename refactoring
|
||||
- [`KT-8512`](https://youtrack.jetbrains.com/issue/KT-8512) Support "Rename tests" options in Rename dialog
|
||||
- [`KT-9168`](https://youtrack.jetbrains.com/issue/KT-9168) Support rename of synthetic properties
|
||||
- [`KT-10578`](https://youtrack.jetbrains.com/issue/KT-10578) Support automatic test renaming for facade files
|
||||
- [`KT-12657`](https://youtrack.jetbrains.com/issue/KT-12657) Rename implicit usages of annotation method `value`
|
||||
- [`KT-12759`](https://youtrack.jetbrains.com/issue/KT-12759) Suggest renaming both property accessors with matching @JvmName when renaming one of them from Java
|
||||
|
||||
###### Issues fixed
|
||||
- [`KT-4791`](https://youtrack.jetbrains.com/issue/KT-4791) Rename overridden property and all its accessors on attempt to rename overriding accessor in Java code
|
||||
- [`KT-6363`](https://youtrack.jetbrains.com/issue/KT-6363) Do not rename ambiguous references in import directives
|
||||
- [`KT-6663`](https://youtrack.jetbrains.com/issue/KT-6663) Fixed rename of ambiguous import reference to class/function when some referenced declarations are not changed
|
||||
- [`KT-8510`](https://youtrack.jetbrains.com/issue/KT-8510) Preserve "Search in comments and strings" and "Search for text occurrences" settings in Rename dialog
|
||||
- [`KT-8541`](https://youtrack.jetbrains.com/issue/KT-8541), [`KT-8786`](https://youtrack.jetbrains.com/issue/KT-8786) Do now show 'Rename overloads' options if target function has no overloads
|
||||
- [`KT-8544`](https://youtrack.jetbrains.com/issue/KT-8544) Show more detailed description in Rename dialog
|
||||
- [`KT-8562`](https://youtrack.jetbrains.com/issue/KT-8562) Show conflicts dialog on attempt of redeclaration
|
||||
- [`KT-8611`](https://youtrack.jetbrains.com/issue/KT-8732) Qualify class references to resolve rename conflicts when possible
|
||||
- [`KT-8732`](https://youtrack.jetbrains.com/issue/KT-8732) Implement Rename conflict analysis and fixes for properties/parameters
|
||||
- [`KT-8860`](https://youtrack.jetbrains.com/issue/KT-8860) Allow renaming class by constructor delegation call referencing primary constructor
|
||||
- [`KT-8892`](https://youtrack.jetbrains.com/issue/KT-8892) Suggest renaming base declarations on overriding members in object literals
|
||||
- [`KT-9156`](https://youtrack.jetbrains.com/issue/KT-9156) Quote non-identifier names in Kotlin references
|
||||
- [`KT-9157`](https://youtrack.jetbrains.com/issue/KT-9157) Fixed in-place rename of Kotlin expression referring Java declaration
|
||||
- [`KT-9241`](https://youtrack.jetbrains.com/issue/KT-9241) Do not replace Java references to synthetic component functions when renaming constructor parameter
|
||||
- [`KT-9435`](https://youtrack.jetbrains.com/issue/KT-9435) Process property accessor usages (Java) in comments and string literals
|
||||
- [`KT-9444`](https://youtrack.jetbrains.com/issue/KT-9444) Rename dialog: Allow typing any identifier without backquotes
|
||||
- [`KT-9446`](https://youtrack.jetbrains.com/issue/KT-9446) Copy default parameter values to overriding function which is renamed while its base function is not
|
||||
- [`KT-9649`](https://youtrack.jetbrains.com/issue/KT-9649) Constraint search scope of parameter declared in a private member
|
||||
- [`KT-10033`](https://youtrack.jetbrains.com/issue/KT-10033) Qualify references to members of enum companions in case of conflict with enum entries
|
||||
- [`KT-10713`](https://youtrack.jetbrains.com/issue/KT-10713) Skip read-only declarations when renaming parameters
|
||||
- [`KT-10687`](https://youtrack.jetbrains.com/issue/KT-10687) Qualify property references to avoid shadowing by parameters
|
||||
- [`KT-11903`](https://youtrack.jetbrains.com/issue/KT-11903) Update references to facade class when renaming file via matching top-level class
|
||||
- [`KT-12411`](https://youtrack.jetbrains.com/issue/KT-12411) Fix package name quotation in Move refactoring
|
||||
- [`KT-12543`](https://youtrack.jetbrains.com/issue/KT-12543) Qualify property references with `this` to avoid renaming conflicts
|
||||
- [`KT-12732`](https://youtrack.jetbrains.com/issue/KT-12732) Copy default parameter values to overriding function which is renamed by Java reference while its base function is unchanged
|
||||
- [`KT-12747`](https://youtrack.jetbrains.com/issue/KT-12747) Fix exception on file copy
|
||||
|
||||
#### Java to Kotlin converter
|
||||
|
||||
###### New features
|
||||
|
||||
- [`KT-4727`](https://youtrack.jetbrains.com/issue/KT-4727) Convert Java code copied from browser or other sources
|
||||
|
||||
###### Issues fixed
|
||||
|
||||
- [`KT-11952`](https://youtrack.jetbrains.com/issue/KT-11952) Assertion failed in PropertyDetectionCache.get on conversion of access to Java constant of anonymous type
|
||||
- [`KT-12046`](https://youtrack.jetbrains.com/issue/KT-12046) Recursive property setter
|
||||
- [`KT-12039`](https://youtrack.jetbrains.com/issue/KT-12039) Static imports converted missing ".Companion"
|
||||
- [`KT-12054`](https://youtrack.jetbrains.com/issue/KT-12054) Wrong conversion of `instanceof` checks with raw types
|
||||
- [`KT-12045`](https://youtrack.jetbrains.com/issue/KT-12045) Convert `Object()` to `Any()`
|
||||
|
||||
#### Android Lint
|
||||
|
||||
###### Issues fixed
|
||||
|
||||
- [`KT-12015`](https://youtrack.jetbrains.com/issue/KT-12015) False positive for Bundle.getInt()
|
||||
- [`KT-12023`](https://youtrack.jetbrains.com/issue/KT-12023) "minSdk" lint check doesn't work for `as`/`is`
|
||||
- [`KT-12674`](https://youtrack.jetbrains.com/issue/KT-12674) "Calling new methods on older versions" errors for inlined constants
|
||||
- [`KT-12681`](https://youtrack.jetbrains.com/issue/KT-12681) Running lint from main menu: diagnostics reported for java source files only
|
||||
- [`KT-12173`](https://youtrack.jetbrains.com/issue/KT-12173) False positive for "Toast created but not shown" inside SAM adapter
|
||||
- [`KT-12895`](https://youtrack.jetbrains.com/issue/KT-12895) NoSuchMethodError thrown when saving a Kotlin file
|
||||
|
||||
#### KDoc
|
||||
|
||||
###### New features
|
||||
- Support for @receiver tag
|
||||
|
||||
###### Issues fixed
|
||||
- Rendering of `_` and `*` standalone characters
|
||||
- Rendering of code blocks
|
||||
- [`KT-9933`](https://youtrack.jetbrains.com/issue/KT-9933) Indentation in code fragments is not preserved
|
||||
- [`KT-10998`](https://youtrack.jetbrains.com/issue/KT-10998) Spaces around links are missing in return block
|
||||
- [`KT-11791`](https://youtrack.jetbrains.com/issue/KT-11791) Markdown links rendering
|
||||
- [`KT-12001`](https://youtrack.jetbrains.com/issue/KT-12001) Allow use of `@param` to document type parameter
|
||||
|
||||
#### Maven support
|
||||
|
||||
###### New features
|
||||
- Inspections that check that kotlin IDEA plugin, kotlin Maven plugin and kotlin stdlib are of the same version
|
||||
- [`KT-11643`](https://youtrack.jetbrains.com/issue/KT-11643) Inspections and intentions to fix erroneously configured Maven pom file
|
||||
- [`KT-11701`](https://youtrack.jetbrains.com/issue/KT-11701) "Add Maven Dependency quick fix" in Kotlin source files
|
||||
- [`KT-11743`](https://youtrack.jetbrains.com/issue/KT-11743) Intention to replace kotlin-test with kotlin-test-junit
|
||||
|
||||
###### Issues fixed
|
||||
- [`KT-9492`](https://youtrack.jetbrains.com/issue/KT-9492) Configuring multiple Maven Modules
|
||||
- [`KT-11642`](https://youtrack.jetbrains.com/issue/KT-11642) Kotlin Maven configurator tags order
|
||||
- [`KT-11436`](https://youtrack.jetbrains.com/issue/KT-11436) "Choose Configurator" control opens dialogs with inconsistent modality (linux)
|
||||
- [`KT-11731`](https://youtrack.jetbrains.com/issue/KT-11731) Default maven integration doesn't include documentation
|
||||
- [`KT-12568`](https://youtrack.jetbrains.com/issue/KT-12568) Execution configuration: file path completion works only in some sub-elements of <sourceDirs>
|
||||
- [`KT-12558`](https://youtrack.jetbrains.com/issue/KT-12558) Configure Kotlin in Project: "Undo" should revert changes in all poms
|
||||
- [`KT-12512`](https://youtrack.jetbrains.com/issue/KT-12512) "Different IDE and Maven plugin version" inspection is being invoked for non-tracked pom.xml files
|
||||
|
||||
#### Debugger
|
||||
|
||||
###### New features
|
||||
- [`KT-11438`](https://youtrack.jetbrains.com/issue/KT-11438) Support navigation from stacktrace to inline function call site
|
||||
|
||||
###### Issues fixed
|
||||
- Do not step into inline lambda argument during step over inside inline function body
|
||||
- Fix step over for inline argument with non-local return
|
||||
- [`KT-12067`](https://youtrack.jetbrains.com/issue/KT-12067) Deadlock in Kotlin debugger is fixed
|
||||
- [`KT-12232`](https://youtrack.jetbrains.com/issue/KT-12232) No code completion in Evaluate Expression and Throwable at CodeCompletionHandlerBase.invokeCompletion()
|
||||
- [`KT-12137`](https://youtrack.jetbrains.com/issue/KT-12137) Evaluate expression: code completion/intention actions allows to use symbols from modules that are not referenced
|
||||
- [`KT-12206`](https://youtrack.jetbrains.com/issue/KT-12206) NoSuchFieldError in Evaluate Expression on a property of a derived class
|
||||
- [`KT-12678`](https://youtrack.jetbrains.com/issue/KT-12678) NoSuchFieldError in Evaluate Expression on accessing delegated property defined in other module
|
||||
- [`KT-12773`](https://youtrack.jetbrains.com/issue/KT-12773) Fix debugging for Kotlin JS projects
|
||||
|
||||
#### Formatter
|
||||
|
||||
###### Issues fixed
|
||||
|
||||
- [`KT-12035`](https://youtrack.jetbrains.com/issue/KT-12035) Spaces around `as`
|
||||
- [`KT-12018`](https://youtrack.jetbrains.com/issue/KT-12018) Spaces between function name and arguments in infix calls
|
||||
- [`KT-11961`](https://youtrack.jetbrains.com/issue/KT-11961) Spaces before angle bracket in method definition
|
||||
- [`KT-12175`](https://youtrack.jetbrains.com/issue/KT-12175) Don't enforce empty line between secondary constructors without body
|
||||
- [`KT-12548`](https://youtrack.jetbrains.com/issue/KT-12548) Spaces around `is` keyword
|
||||
- [`KT-12446`](https://youtrack.jetbrains.com/issue/KT-12446) Spaces before class type parameters
|
||||
- [`KT-12634`](https://youtrack.jetbrains.com/issue/KT-12634) Spaces between method name and parenthesis in method call
|
||||
- [`KT-10680`](https://youtrack.jetbrains.com/issue/KT-10680) Spaces around `in` keyword
|
||||
- [`KT-12791`](https://youtrack.jetbrains.com/issue/KT-12791) Spaces between curly brace and expression inside string template
|
||||
- [`KT-12781`](https://youtrack.jetbrains.com/issue/KT-12781) Spaces between annotation and expression
|
||||
- [`KT-12689`](https://youtrack.jetbrains.com/issue/KT-12689) Spaces around semicolons
|
||||
- [`KT-12714`](https://youtrack.jetbrains.com/issue/KT-12714) Spaces around parentheses in enum elements
|
||||
|
||||
#### Other
|
||||
|
||||
###### New features
|
||||
|
||||
- Added "Decompile" button to Kotlin bytecode toolwindow
|
||||
- Added Kotlin "Tips of the day"
|
||||
- Added "Kotlin 1.1 EAP" to "Configure Kotlin Plugin updates"
|
||||
- [`KT-2919`](https://youtrack.jetbrains.com/issue/KT-2919) Constructor calls are no longer highlighted as classes
|
||||
- [`KT-6540`](https://youtrack.jetbrains.com/issue/KT-6540) Infix function calls are now highlighted as regular function calls
|
||||
- [`KT-9410`](https://youtrack.jetbrains.com/issue/KT-9410) Annotations in Kotlin are now highlighted with the same color as in Java by default
|
||||
- [`KT-11465`](https://youtrack.jetbrains.com/issue/KT-11465) Type parameters in Kotlin are now highlighted with the same color as in Java by default
|
||||
- [`KT-11657`](https://youtrack.jetbrains.com/issue/KT-11657) Allow viewing decompiled Java source code for Kotlin-compiled classes
|
||||
- [`KT-11704`](https://youtrack.jetbrains.com/issue/KT-11704) Support file path references inside of Kotlin string literals
|
||||
- [`KT-12076`](https://youtrack.jetbrains.com/issue/KT-12076) Kotlin Plugin update check: always display installed version number
|
||||
- [`KT-11814`](https://youtrack.jetbrains.com/issue/KT-11814) New icon for kotlin annotation classes
|
||||
- [`KT-12735`](https://youtrack.jetbrains.com/issue/KT-12735) Convert JavaDoc to KDoc when overriding Java class member in Kotlin
|
||||
|
||||
###### Issues fixed
|
||||
|
||||
- [`KT-5960`](https://youtrack.jetbrains.com/issue/KT-5960) Can't find usages for Java methods used from Kotlin by call convention
|
||||
- [`KT-8362`](https://youtrack.jetbrains.com/issue/KT-8362) "New Kotlin file": Keywords should be escaped in package name
|
||||
- [`KT-8682`](https://youtrack.jetbrains.com/issue/KT-8682) Respect "Copy JavaDoc" option in the "Override/Implement Members..." dialog
|
||||
- [`KT-8817`](https://youtrack.jetbrains.com/issue/KT-8817) Fixed rename of Java getters/setters through synthetic property references in Kotlin
|
||||
- [`KT-9399`](https://youtrack.jetbrains.com/issue/KT-9399) Find Usages omits Kotlin annotation parameter usage in Java source
|
||||
- [`KT-9797`](https://youtrack.jetbrains.com/issue/KT-9797) "Kotlin Bytecode" toolwindow breaks after closing
|
||||
- [`KT-11145`](https://youtrack.jetbrains.com/issue/KT-11145) Use progress indicator when searching usages in Introduce Parameter
|
||||
- [`KT-11155`](https://youtrack.jetbrains.com/issue/KT-11155) Allow running multiple Kotlin classes as well as running mixtures of Kotlin and Java classes
|
||||
- [`KT-11495`](https://youtrack.jetbrains.com/issue/KT-11495) Show recursion line markers for extension function calls with different receiver
|
||||
- [`KT-11659`](https://youtrack.jetbrains.com/issue/KT-11659) Generate abstract overrides for Any members inside of Kotlin interfaces
|
||||
- [`KT-12070`](https://youtrack.jetbrains.com/issue/KT-12070) Add empty line in error message of Maven and Gradle configuration
|
||||
- [`KT-11908`](https://youtrack.jetbrains.com/issue/KT-11908) Allow properties with custom setters to be used in generated equals/hashCode/toString
|
||||
- [`KT-11617`](https://youtrack.jetbrains.com/issue/KT-11617) Fixed title of Introduce Parameter declaration chooser
|
||||
- [`KT-11817`](https://youtrack.jetbrains.com/issue/KT-11817) Fixed rename of Kotlin enum constants through Java references
|
||||
- [`KT-11816`](https://youtrack.jetbrains.com/issue/KT-11816) Fixed usages search for Safe Delete on simple enum entries
|
||||
- [`KT-11282`](https://youtrack.jetbrains.com/issue/KT-11282) Delete interface reference from super-type list when applying Safe Delete to Java interface
|
||||
- [`KT-11967`](https://youtrack.jetbrains.com/issue/KT-11967) Fix Find Usages/Rename for parameter references in XML files
|
||||
- [`KT-10770`](https://youtrack.jetbrains.com/issue/KT-10770) "Optimize imports" will not keep import if a type is only referenced by kdoc
|
||||
- [`KT-11955`](https://youtrack.jetbrains.com/issue/KT-11955) Copy/Paste inserts fully qualified name when copying function with overloads
|
||||
- [`KT-12436`](https://youtrack.jetbrains.com/issue/KT-12436) "Replace explicit parameter with it": java.lang.Exception at BaseRefactoringProcessor.run()
|
||||
- [`KT-12440`](https://youtrack.jetbrains.com/issue/KT-12440) Removing unused parameter results in Exception "Refactorings should not be started inside write action"
|
||||
- [`KT-12006`](https://youtrack.jetbrains.com/issue/KT-12006) getLanguageLevel is slow for Kotlin light classes
|
||||
- [`KT-12026`](https://youtrack.jetbrains.com/issue/KT-12026) "Constant expression required" in Java for const Kotlin values
|
||||
- [`KT-12259`](https://youtrack.jetbrains.com/issue/KT-12259) ClassCastException in light classes while trying to create generic property
|
||||
- [`KT-12289`](https://youtrack.jetbrains.com/issue/KT-12289) Remove unnecessary `?` from `serr` live template
|
||||
- [`KT-12110`](https://youtrack.jetbrains.com/issue/KT-12110) Map help button of the Compiler - Kotlin page
|
||||
- [`KT-12075`](https://youtrack.jetbrains.com/issue/KT-12075) Kotlin Plugin update check: make dumbaware
|
||||
- [`KT-10255`](https://youtrack.jetbrains.com/issue/KT-10255) call BuildManager.clearState(project) in apply() method of Kotlin Compiler Settings configurable
|
||||
- [`KT-11841`](https://youtrack.jetbrains.com/issue/KT-11841) New Project / Module wizard, Gradle: pure Kotlin module is created without `repositories` call in build.gradle
|
||||
- [`KT-11095`](https://youtrack.jetbrains.com/issue/KT-11095) Java cannot infer generic return type of Kotlin function (with java 8 language level)
|
||||
- [`KT-12090`](https://youtrack.jetbrains.com/issue/KT-12090) Intellij/Kotlin plugin does not handle generic return type of static method defined in Kotlin, called from Java
|
||||
- [`KT-12206`](https://youtrack.jetbrains.com/issue/KT-12206) Fix NoSuchFieldError on accessing base property without backing field in evaluate expression
|
||||
- [`KT-12516`](https://youtrack.jetbrains.com/issue/KT-12516) File Structure: Kotlin annotation classes have Java annotation icons
|
||||
- [`KT-11328`](https://youtrack.jetbrains.com/issue/KT-11328) "New Kotlin class": generates packages when fully qualified name is specified
|
||||
- [`KT-11778`](https://youtrack.jetbrains.com/issue/KT-11778) Exception in Lombok plugin: Rewrite at slice FUNCTION
|
||||
- [`KT-11708`](https://youtrack.jetbrains.com/issue/KT-11708) "Go to declaration" doesn't work on a call to function with SAM conversion on a derived type
|
||||
- [`KT-12381`](https://youtrack.jetbrains.com/issue/KT-12381) Prefer not-nullable return type when overriding Java method without nullability annotation
|
||||
- [`KT-12647`](https://youtrack.jetbrains.com/issue/KT-12647) Performance improvement for test-related line markers
|
||||
- [`KT-12526`](https://youtrack.jetbrains.com/issue/KT-12526) Kotlin intentions increase PSI modification counts from isAvailable, even in daemon threads
|
||||
|
||||
### Reflection
|
||||
|
||||
###### Issues fixed
|
||||
- [`KT-11531`](https://youtrack.jetbrains.com/issue/KT-11531) Optimize "KCallable.name"
|
||||
- [`KT-10771`](https://youtrack.jetbrains.com/issue/KT-10771) Reflection on Function objects does not support lambdas with generic return type
|
||||
- [`KT-11824`](https://youtrack.jetbrains.com/issue/KT-11824) Reflection inconsistency between member property and accessor
|
||||
|
||||
### JS
|
||||
|
||||
- Improve performance of maps and sets
|
||||
|
||||
###### Issues fixed
|
||||
- [`KT-6942`](https://youtrack.jetbrains.com/issue/KT-6942) Generate structural equality check (i.e. `Any.equals`) instead of referential check (===) value equality patterns in `when`
|
||||
- [`KT-7228`](https://youtrack.jetbrains.com/issue/KT-7228) Wrong AbstractList signature
|
||||
- [`KT-8299`](https://youtrack.jetbrains.com/issue/KT-8299) Wrong access to private member in autogenerated code in data class
|
||||
- [`KT-11346`](https://youtrack.jetbrains.com/issue/KT-11346) Reified functions like `filterIsInstance` are now available in JS Standard Library
|
||||
- [`KT-12305`](https://youtrack.jetbrains.com/issue/KT-12305) Incorrect translation of `vararg` in `@native` functions
|
||||
- [`KT-12254`](https://youtrack.jetbrains.com/issue/KT-12254) JsEmptyExpression in initializer when compiling code like `val x = throw Exception()`
|
||||
- [`KT-11960`](https://youtrack.jetbrains.com/issue/KT-11960) Wrong code generated when a method of a local class calls constructor of the class
|
||||
- [`KT-10931`](https://youtrack.jetbrains.com/issue/KT-10931) Incorrect inlining of library method with optional parameters
|
||||
- [`KT-12417`](https://youtrack.jetbrains.com/issue/KT-12417) Wrong check cast generated for KMutableProperty
|
||||
|
||||
### Tools
|
||||
|
||||
###### New features
|
||||
|
||||
- [`KT-11839`](https://youtrack.jetbrains.com/issue/KT-11839) Maven goal to execute kotlin script
|
||||
|
||||
###### Issues fixed
|
||||
|
||||
- KAPT: fix error when using enum constructors with parameters
|
||||
- Various problems with gradle 2.2 fixed: [`KT-12478`](https://youtrack.jetbrains.com/issue/KT-12478), [`KT-12406`](https://youtrack.jetbrains.com/issue/KT-12406), [`KT-12478`](https://youtrack.jetbrains.com/issue/KT-12478)
|
||||
- [`KT-12595`](https://youtrack.jetbrains.com/issue/KT-12595) JPS: Fixed com.intellij.util.io.MappingFailedException: Cannot map buffer
|
||||
- [`KT-11166`](https://youtrack.jetbrains.com/issue/KT-11166) Gradle: Unable to access internal classes from test code within the same module
|
||||
- [`KT-12352`](https://youtrack.jetbrains.com/issue/KT-12352) KAPT: Fix "Classpath entry points to a non-existent location" warnings
|
||||
- [`KT-12074`](https://youtrack.jetbrains.com/issue/KT-12074) Building Kotlin maven projects using a parent pom will silently fail
|
||||
- [`KT-11770`](https://youtrack.jetbrains.com/issue/KT-11770) Warning "RuntimeException: Could not find installation home path" when using Gradle Incremental Compilation
|
||||
- [`KT-10969`](https://youtrack.jetbrains.com/issue/KT-10969) Android extensions: NullPointerException when finding view in Fragment
|
||||
- [`KT-11885`](https://youtrack.jetbrains.com/issue/KT-11885) Gradle/Android: Unresolved reference "kotlinx" when classpath dependency is defined in root build.gradle
|
||||
- [`KT-12786`](https://youtrack.jetbrains.com/issue/KT-12786) Deprecation warning with Gradle 2.14
|
||||
|
||||
## 1.0.2-1
|
||||
|
||||
- [KT-12159](https://youtrack.jetbrains.com/issue/KT-12159), [KT-12406](https://youtrack.jetbrains.com/issue/KT-12406), [KT-12431](https://youtrack.jetbrains.com/issue/KT-12431), [KT-12478](https://youtrack.jetbrains.com/issue/KT-12478) Support Android Studio 2.2
|
||||
- [KT-11770](https://youtrack.jetbrains.com/issue/KT-11770) Fix warning "RuntimeException: Could not find installation home path" when using incremental compilation in Gradle
|
||||
- [KT-12436](https://youtrack.jetbrains.com/issue/KT-12436), [KT-12440](https://youtrack.jetbrains.com/issue/KT-12440) Fix multiple exceptions during refactorings in IDEA 2016.2 EAP
|
||||
- [KT-12015](https://youtrack.jetbrains.com/issue/KT-12015), [KT-12047](https://youtrack.jetbrains.com/issue/KT-12047), [KT-12387](https://youtrack.jetbrains.com/issue/KT-12387) Fix multiple issues in Kotlin Lint checks
|
||||
|
||||
## 1.0.2
|
||||
|
||||
@@ -82,6 +826,7 @@ Issues fixed:
|
||||
- [KT-5429](https://youtrack.jetbrains.com/issue/KT-5429) Write nullability annotations on extension receiver parameters
|
||||
- [KT-11347](https://youtrack.jetbrains.com/issue/KT-11347) Preserve source file and line number of call site when inlining certain standard library functions
|
||||
- [KT-11677](https://youtrack.jetbrains.com/issue/KT-11677) Write correct generic signatures for local classes in inlined lambdas
|
||||
- [KT-12127](https://youtrack.jetbrains.com/issue/KT-12127) Do not write unnecessary generic signature for property delegate backing field
|
||||
- Fix multiple issues leading to exceptions or bad bytecode being generated: [KT-11034](https://youtrack.jetbrains.com/issue/KT-11034), [KT-11519](https://youtrack.jetbrains.com/issue/KT-11519), [KT-11117](https://youtrack.jetbrains.com/issue/KT-11117), [KT-11479](https://youtrack.jetbrains.com/issue/KT-11479)
|
||||
|
||||
#### Java interoperability
|
||||
@@ -135,9 +880,15 @@ Issues fixed:
|
||||
- [KT-11030](https://youtrack.jetbrains.com/issue/KT-11030) Support local classes
|
||||
- [KT-7819](https://youtrack.jetbrains.com/issue/KT-7819) Support non-local returns in local lambdas
|
||||
- [KT-6912](https://youtrack.jetbrains.com/issue/KT-6912) Safe calls (`x?.let { it }`) are now inlined
|
||||
- [KT-2670](https://youtrack.jetbrains.com/issue/KT-2670) Support unsafe casts (`as`)
|
||||
- [KT-7016](https://youtrack.jetbrains.com/issue/KT-7016), [KT-8012](https://youtrack.jetbrains.com/issue/KT-8012) Fix `is`-checks for reified type parameters
|
||||
- [KT-7038](https://youtrack.jetbrains.com/issue/KT-7038) Avoid unwanted side effects on `is`-checks for nullable types
|
||||
- [KT-10614](https://youtrack.jetbrains.com/issue/KT-10614) Copy array on vararg call with spread operator
|
||||
- [KT-10785](https://youtrack.jetbrains.com/issue/KT-10785) Correctly translate property names and receiver instances in assignment operations
|
||||
- [KT-11611](https://youtrack.jetbrains.com/issue/KT-11611) Fix translation of default value of secondary constructor's functional parameter
|
||||
- [KT-11100](https://youtrack.jetbrains.com/issue/KT-11100) Fix generation of `invoke` on objects and companion objects
|
||||
- [KT-11823](https://youtrack.jetbrains.com/issue/KT-11823) Fix capturing of outer class' `this` in inner's lambdas
|
||||
- [KT-11996](https://youtrack.jetbrains.com/issue/KT-11996) Fix translation of a call to a private member of an outer class from an inner class which is a subtype of the outer class
|
||||
- [KT-10667](https://youtrack.jetbrains.com/issue/KT-10667) Support inheritance from nested built-in types such as Map.Entry
|
||||
- [KT-7480](https://youtrack.jetbrains.com/issue/KT-7480) Remove declarations of LinkedList, SortedSet, TreeSet, Enumeration
|
||||
- [KT-3064](https://youtrack.jetbrains.com/issue/KT-3064) Implement `CharSequence.repeat`
|
||||
@@ -193,11 +944,12 @@ Issues fixed:
|
||||
- [KT-11295](https://youtrack.jetbrains.com/issue/KT-11295) "Convert string to template" intention: fix exception on certain code
|
||||
- [KT-10750](https://youtrack.jetbrains.com/issue/KT-10750), [KT-11424](https://youtrack.jetbrains.com/issue/KT-11424) "Convert if to when" intention now detects effectively else branches in subsequent code and performs more accurate comment handling
|
||||
- Configure Kotlin: show only changed files in the notification "Kotlin not configured", restore all changed files in undo action
|
||||
- [KT-11556](https://youtrack.jetbrains.com/issue/KT-11556) Do not show "Kotlin not configured" for Kotlin JS projects
|
||||
- [KT-11593](https://youtrack.jetbrains.com/issue/KT-11593) Fix "Configure Kotlin" action for Gradle projects in IDEA 2016
|
||||
- [KT-11077](https://youtrack.jetbrains.com/issue/KT-11077) Use new built-in definition file format (`.kotlin_builtins` files)
|
||||
- [KT-5728](https://youtrack.jetbrains.com/issue/KT-5728) Remove closing curly brace in a string template when opening one is deleted
|
||||
- [KT-10883](https://youtrack.jetbrains.com/issue/KT-10883) "Explicit get or set call" quick fix: do not move caret too far away
|
||||
- [KT-5717](https://youtrack.jetbrains.com/issue/KT-5717) "Replace 'when' with 'if'": do not lose comments
|
||||
- [KT-5717](https://youtrack.jetbrains.com/issue/KT-5717) "Replace `when` with `if`": do not lose comments
|
||||
- [KT-10797](https://youtrack.jetbrains.com/issue/KT-10797) "Replace with operator" intention is not available anymore for non-`operator` functions
|
||||
- [KT-11529](https://youtrack.jetbrains.com/issue/KT-11529) Highlighting range for unresolved annotation name does not include `@` now
|
||||
- [KT-11178](https://youtrack.jetbrains.com/issue/KT-11178) Don't show "Change type arguments" fix when there's nothing to change
|
||||
@@ -208,7 +960,8 @@ Issues fixed:
|
||||
- [KT-11720](https://youtrack.jetbrains.com/issue/KT-11720) Fixed renaming of Kotlin beans through SpEL references
|
||||
- [KT-11719](https://youtrack.jetbrains.com/issue/KT-11719) Fixed renaming of Kotlin parameters references in XML files
|
||||
- [KT-11736](https://youtrack.jetbrains.com/issue/KT-11736) Fixed searching of Java usages for @JvmStatic properties and @JvmStatic @JvmOverloads functions
|
||||
- Fix several issues leading to exceptions: [KT-11579](https://youtrack.jetbrains.com/issue/KT-11579), [KT-11580](https://youtrack.jetbrains.com/issue/KT-11580), [KT-11777](https://youtrack.jetbrains.com/issue/KT-11777), [KT-11868](https://youtrack.jetbrains.com/issue/KT-11868), [KT-11845](https://youtrack.jetbrains.com/issue/KT-11845)
|
||||
- [KT-11862](https://youtrack.jetbrains.com/issue/KT-11862) Fixed bogus warnings about unresolved types in the Change Signature dialog
|
||||
- Fix several issues leading to exceptions: [KT-11579](https://youtrack.jetbrains.com/issue/KT-11579), [KT-11580](https://youtrack.jetbrains.com/issue/KT-11580), [KT-11777](https://youtrack.jetbrains.com/issue/KT-11777), [KT-11868](https://youtrack.jetbrains.com/issue/KT-11868), [KT-11845](https://youtrack.jetbrains.com/issue/KT-11845), [KT-11486](https://youtrack.jetbrains.com/issue/KT-11486)
|
||||
- Fixed NoSuchFieldException in Kotlin module settings on IDEA Ultimate
|
||||
|
||||
#### Debugger
|
||||
@@ -271,6 +1024,8 @@ Issues fixed:
|
||||
- [KT-8487](https://youtrack.jetbrains.com/issue/KT-8487) Experimental support for incremental compilation with project property `kotlin.incremental`
|
||||
- [KT-11350](https://youtrack.jetbrains.com/issue/KT-11350) Fixed a bug causing Java rebuild when both Java and Kotlin are up-to-date
|
||||
- [KT-10507](https://youtrack.jetbrains.com/issue/KT-10507) Fix IllegalArgumentException "Missing extension point" on parallel builds
|
||||
- [KT-10932](https://youtrack.jetbrains.com/issue/KT-10932) Prevent compile tasks from running when nothing changes
|
||||
- [KT-11993](https://youtrack.jetbrains.com/issue/KT-11993) Fix NoSuchMethodError on access to internal members in production from tests (IDEA 2016+)
|
||||
|
||||
## 1.0.1-2
|
||||
|
||||
|
||||
@@ -17,10 +17,6 @@
|
||||
<property name="compiler.version.java.versioned" value="${compiler.version.java}.versioned"/>
|
||||
|
||||
<property name="plugin.zip" value="${artifact.output.path}/kotlin-plugin-${build.number}.zip"/>
|
||||
<property name="bare.plugin.zip" value="${artifact.output.path}/kotlin-bare-plugin-${build.number}.zip"/>
|
||||
|
||||
<property name="kotlin.bare.plugin.xml" value="jps-plugin/bare-plugin/src/META-INF/plugin.xml"/>
|
||||
<property name="kotlin.bare.plugin.xml.bk" value="${version_substitute_dir}/kotlin.bare.plugin.xml.bk"/>
|
||||
|
||||
<macrodef name="echoprop">
|
||||
<attribute name="prop"/>
|
||||
@@ -90,17 +86,11 @@
|
||||
target.file.versioned="${compiler.version.java.versioned}"
|
||||
test.string="public static final String VERSION = "@snapshot@";"/>
|
||||
|
||||
<substituteVersionInFile
|
||||
target.file="${kotlin.bare.plugin.xml}"
|
||||
target.file.bk="${kotlin.bare.plugin.xml.bk}"
|
||||
test.string="<version>@snapshot@</version>"/>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="revertTemplateFiles">
|
||||
<copy file="${plugin.xml.bk}" tofile="${plugin.xml}" overwrite="true"/>
|
||||
<copy file="${compiler.version.java.bk}" tofile="${compiler.version.java}" overwrite="true"/>
|
||||
<copy file="${kotlin.bare.plugin.xml.bk}" tofile="${kotlin.bare.plugin.xml}" overwrite="true"/>
|
||||
|
||||
<delete dir="${version_substitute_dir}" quiet="true"/>
|
||||
</target>
|
||||
@@ -125,7 +115,6 @@
|
||||
</macrodef>
|
||||
|
||||
<zipPlugin filename="${plugin.zip}" dir="Kotlin"/>
|
||||
<zipPlugin filename="${bare.plugin.zip}" dir="BareKotlin"/>
|
||||
</target>
|
||||
|
||||
<macrodef name="print-statistic">
|
||||
@@ -154,10 +143,8 @@
|
||||
|
||||
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-jslib.jar"/>
|
||||
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="kotlin.js"/>
|
||||
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="builtins.js"/>
|
||||
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="builtins.meta.js"/>
|
||||
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="stdlib.js"/>
|
||||
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="stdlib.meta.js"/>
|
||||
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="${compiled.stdlib.meta.js}"/>
|
||||
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="${compiled.stdlib.js}"/>
|
||||
</target>
|
||||
|
||||
<target name="post_build" depends="zipArtifacts, revertTemplateFiles, printStatistics, remove_internal_artifacts, dont_remove_internal_artifacts"/>
|
||||
|
||||
@@ -82,13 +82,6 @@
|
||||
plugin.subdir="Kotlin"
|
||||
substituted.version="${relay.substitute.version}"/>
|
||||
|
||||
<substitudeVersionInPlugin
|
||||
plugin.jar.name="kotlin-bare-plugin"
|
||||
plugin.path="${relay.plugins.dir}/kotlin-bare-plugin-${relay.origin.version}.zip"
|
||||
origin.version="${relay.origin.version}"
|
||||
plugin.subdir="BareKotlin"
|
||||
substituted.version="${relay.substitute.version}"/>
|
||||
|
||||
<substitudeVersionInPlugin
|
||||
plugin.jar.name="kotlin-android-extensions"
|
||||
plugin.path="${relay.plugins.dir}/kotlin-android-extensions-plugin-${relay.origin.version}.zip"
|
||||
|
||||
@@ -27,6 +27,7 @@ class Kotlin2JsTask : KotlinCompilerBaseTask() {
|
||||
var outputPostfix: File? = null
|
||||
var sourceMap: Boolean = false
|
||||
var metaInfo: Boolean = false
|
||||
var moduleKind: String = "plain"
|
||||
|
||||
/**
|
||||
* {@link K2JsArgumentConstants.CALL} (default) if need generate a main function call (main function will be auto detected)
|
||||
@@ -73,5 +74,7 @@ class Kotlin2JsTask : KotlinCompilerBaseTask() {
|
||||
if (noStdlib) args.add("-no-stdlib")
|
||||
if (sourceMap) args.add("-source-map")
|
||||
if (metaInfo) args.add("-meta-info")
|
||||
|
||||
args += listOf("-module-kind", moduleKind)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ class Kotlin2JvmTask : KotlinCompilerBaseTask() {
|
||||
var includeRuntime: Boolean = true
|
||||
var moduleName: String? = null
|
||||
|
||||
var noReflect: Boolean = false
|
||||
|
||||
private var compileClasspath: Path? = null
|
||||
|
||||
fun setClasspath(classpath: Path) {
|
||||
@@ -68,6 +70,7 @@ class Kotlin2JvmTask : KotlinCompilerBaseTask() {
|
||||
}
|
||||
|
||||
if (noStdlib) args.add("-no-stdlib")
|
||||
if (noReflect) args.add("-no-reflect")
|
||||
if (includeRuntime) args.add("-include-runtime")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.io.File
|
||||
import java.lang.ref.SoftReference
|
||||
import java.net.JarURLConnection
|
||||
|
||||
object KotlinAntTaskUtil {
|
||||
internal object KotlinAntTaskUtil {
|
||||
private var classLoaderRef = SoftReference<ClassLoader?>(null)
|
||||
|
||||
private val libPath: File by lazy {
|
||||
@@ -37,19 +37,16 @@ object KotlinAntTaskUtil {
|
||||
antTaskJarPath.parentFile
|
||||
}
|
||||
|
||||
val compilerJar: File by lazy {
|
||||
File(libPath, "kotlin-compiler.jar").assertExists()
|
||||
}
|
||||
val compilerJar: File by jar("kotlin-compiler.jar")
|
||||
val runtimeJar: File by jar("kotlin-runtime.jar")
|
||||
val reflectJar: File by jar("kotlin-reflect.jar")
|
||||
|
||||
val runtimeJar: File by lazy {
|
||||
File(libPath, "kotlin-runtime.jar").assertExists()
|
||||
}
|
||||
|
||||
private fun File.assertExists(): File {
|
||||
if (!this.exists()) {
|
||||
throw IllegalStateException("${name} is not found in the directory of Kotlin Ant task")
|
||||
private fun jar(name: String) = lazy {
|
||||
File(libPath, name).apply {
|
||||
if (!exists()) {
|
||||
throw IllegalStateException("File is not found in the directory of Kotlin Ant task: $name")
|
||||
}
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
@@ -65,8 +62,7 @@ object KotlinAntTaskUtil {
|
||||
|
||||
return classLoader
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
val Task.defaultModuleName: String?
|
||||
get() = owningTarget?.name ?: project?.name
|
||||
internal val Task.defaultModuleName: String?
|
||||
get() = owningTarget?.name ?: project?.name
|
||||
|
||||
@@ -31,6 +31,7 @@ class KotlinCompilerAdapter : Javac13() {
|
||||
|
||||
var additionalArguments: MutableList<Commandline.Argument> = ArrayList(0)
|
||||
|
||||
@Suppress("unused") // Used via reflection by Ant
|
||||
fun createCompilerArg(): Commandline.Argument {
|
||||
val argument = Commandline.Argument()
|
||||
additionalArguments.add(argument)
|
||||
@@ -94,15 +95,22 @@ class KotlinCompilerAdapter : Javac13() {
|
||||
}
|
||||
|
||||
private fun addRuntimeToJavacClasspath(kotlinc: Kotlin2JvmTask) {
|
||||
for (arg in kotlinc.args) {
|
||||
// If "-no-stdlib" was specified explicitly, probably the user also wanted the javac classpath to not have it
|
||||
if ("-no-stdlib" == arg) return
|
||||
}
|
||||
// If "-no-stdlib" (or "-no-reflect") was specified explicitly, probably the user also wanted the javac classpath to not have it
|
||||
val addStdlib = "-no-stdlib" !in kotlinc.args
|
||||
val addReflect = "-no-reflect" !in kotlinc.args
|
||||
|
||||
if (!addStdlib && !addReflect) return
|
||||
|
||||
if (compileClasspath == null) {
|
||||
compileClasspath = Path(getProject())
|
||||
}
|
||||
compileClasspath.add(Path(getProject(), KotlinAntTaskUtil.runtimeJar.absolutePath))
|
||||
if (addStdlib) {
|
||||
compileClasspath.add(Path(getProject(), KotlinAntTaskUtil.runtimeJar.absolutePath))
|
||||
}
|
||||
// "-no-stdlib" implies "-no-reflect", see K2JVMCompiler.Companion.getClasspath
|
||||
if (addReflect && addStdlib) {
|
||||
compileClasspath.add(Path(getProject(), KotlinAntTaskUtil.reflectJar.absolutePath))
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkAntVersion() {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.incremental
|
||||
|
||||
import com.google.protobuf.MessageLite
|
||||
import com.intellij.openapi.util.io.FileUtil.toSystemIndependentName
|
||||
import com.intellij.util.SmartList
|
||||
import com.intellij.util.io.BooleanDataDescriptor
|
||||
@@ -33,6 +32,7 @@ import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCache
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.components.JvmPackagePartProto
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.protobuf.MessageLite
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
|
||||
import org.jetbrains.kotlin.serialization.Flags
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||
@@ -122,6 +122,11 @@ open class IncrementalCacheImpl<Target>(
|
||||
}
|
||||
}
|
||||
|
||||
// used in gradle
|
||||
@Suppress("unused")
|
||||
fun classesBySources(sources: Iterable<File>): Iterable<JvmClassName> =
|
||||
sources.flatMap { sourceToClassesMap[it] }
|
||||
|
||||
fun getSubtypesOf(className: FqName): Sequence<FqName> =
|
||||
subtypesMap[className].asSequence()
|
||||
|
||||
@@ -641,12 +646,12 @@ open class IncrementalCacheImpl<Target>(
|
||||
}
|
||||
|
||||
private inner class InlineFunctionsMap(storageFile: File) : BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
|
||||
private fun getInlineFunctionsMap(bytes: ByteArray): Map<String, Long> {
|
||||
val result = HashMap<String, Long>()
|
||||
|
||||
val inlineFunctions = inlineFunctionsJvmNames(bytes)
|
||||
private fun getInlineFunctionsMap(header: KotlinClassHeader, bytes: ByteArray): Map<String, Long> {
|
||||
val inlineFunctions = inlineFunctionsJvmNames(header)
|
||||
if (inlineFunctions.isEmpty()) return emptyMap()
|
||||
|
||||
val result = HashMap<String, Long>()
|
||||
|
||||
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.ASM5) {
|
||||
override fun visitMethod(access: Int, name: String, desc: String, signature: String?, exceptions: Array<out String>?): MethodVisitor? {
|
||||
val dummyClassWriter = ClassWriter(Opcodes.ASM5)
|
||||
@@ -669,7 +674,7 @@ open class IncrementalCacheImpl<Target>(
|
||||
}
|
||||
|
||||
fun process(kotlinClass: LocalFileKotlinClass, isPackage: Boolean): CompilationResult {
|
||||
return put(kotlinClass.className, getInlineFunctionsMap(kotlinClass.fileContents), isPackage)
|
||||
return put(kotlinClass.className, getInlineFunctionsMap(kotlinClass.classHeader, kotlinClass.fileContents), isPackage)
|
||||
}
|
||||
|
||||
private fun put(className: JvmClassName, newMap: Map<String, Long>, isPackage: Boolean): CompilationResult {
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.incremental
|
||||
|
||||
import org.jetbrains.kotlin.incremental.components.LookupTracker
|
||||
import org.jetbrains.kotlin.incremental.components.SourceRetentionAnnotationHandler
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCache
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCompilationComponents
|
||||
import org.jetbrains.kotlin.modules.TargetId
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.incremental
|
||||
|
||||
import org.jetbrains.kotlin.incremental.components.SourceRetentionAnnotationHandler
|
||||
|
||||
class SourceRetentionAnnotationHandlerImpl : SourceRetentionAnnotationHandler {
|
||||
private val mutableSourceRetentionAnnotations = mutableSetOf<String>()
|
||||
|
||||
val sourceRetentionAnnotations: Set<String>
|
||||
get() = mutableSourceRetentionAnnotations
|
||||
|
||||
override fun register(internalName: String) {
|
||||
mutableSourceRetentionAnnotations += internalName
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,7 @@ import org.jetbrains.kotlin.compilerRunner.OutputItemsCollectorImpl
|
||||
import org.jetbrains.kotlin.config.IncrementalCompilation
|
||||
import org.jetbrains.kotlin.config.Services
|
||||
import org.jetbrains.kotlin.incremental.components.LookupTracker
|
||||
import org.jetbrains.kotlin.incremental.components.SourceRetentionAnnotationHandler
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCache
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCompilationComponents
|
||||
import org.jetbrains.kotlin.modules.KotlinModuleXmlBuilder
|
||||
@@ -69,13 +70,18 @@ fun makeModuleFile(name: String, isTest: Boolean, outputDir: File, sourcesToComp
|
||||
fun makeCompileServices(
|
||||
incrementalCaches: Map<TargetId, IncrementalCache>,
|
||||
lookupTracker: LookupTracker,
|
||||
compilationCanceledStatus: CompilationCanceledStatus?
|
||||
compilationCanceledStatus: CompilationCanceledStatus?,
|
||||
sourceRetentionAnnotationHandler: SourceRetentionAnnotationHandler? = null
|
||||
): Services =
|
||||
with(Services.Builder()) {
|
||||
register(IncrementalCompilationComponents::class.java, IncrementalCompilationComponentsImpl(incrementalCaches, lookupTracker))
|
||||
register(IncrementalCompilationComponents::class.java,
|
||||
IncrementalCompilationComponentsImpl(incrementalCaches, lookupTracker))
|
||||
compilationCanceledStatus?.let {
|
||||
register(CompilationCanceledStatus::class.java, it)
|
||||
}
|
||||
sourceRetentionAnnotationHandler?.let {
|
||||
register(SourceRetentionAnnotationHandler::class.java, it)
|
||||
}
|
||||
build()
|
||||
}
|
||||
|
||||
@@ -175,8 +181,8 @@ fun<Target> OutputItemsCollectorImpl.generatedFiles(
|
||||
}
|
||||
|
||||
data class DirtyData(
|
||||
val dirtyLookupSymbols: Iterable<LookupSymbol>,
|
||||
val dirtyClassesFqNames: Iterable<FqName>
|
||||
val dirtyLookupSymbols: Collection<LookupSymbol> = emptyList(),
|
||||
val dirtyClassesFqNames: Collection<FqName> = emptyList()
|
||||
)
|
||||
|
||||
fun <Target> CompilationResult.getDirtyData(
|
||||
@@ -261,7 +267,7 @@ private fun File.isJavaFile() = extension.equals(JavaFileType.INSTANCE.defaultEx
|
||||
private fun findSrcDirRoot(file: File, roots: Iterable<File>): File? =
|
||||
roots.firstOrNull { FileUtil.isAncestor(it, file, false) }
|
||||
|
||||
private fun <Target> withSubtypes(
|
||||
fun <Target> withSubtypes(
|
||||
typeFqName: FqName,
|
||||
caches: Iterable<IncrementalCacheImpl<Target>>
|
||||
): Set<FqName> {
|
||||
|
||||
@@ -16,17 +16,16 @@
|
||||
|
||||
package org.jetbrains.kotlin.incremental
|
||||
|
||||
import com.google.protobuf.MessageLite
|
||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||
import org.jetbrains.kotlin.incremental.ProtoCompareGenerated.ProtoBufClassKind
|
||||
import org.jetbrains.kotlin.incremental.ProtoCompareGenerated.ProtoBufPackageKind
|
||||
import org.jetbrains.kotlin.incremental.storage.ProtoMapValue
|
||||
import org.jetbrains.kotlin.protobuf.MessageLite
|
||||
import org.jetbrains.kotlin.serialization.Flags
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||
import org.jetbrains.kotlin.serialization.deserialization.Deserialization
|
||||
import org.jetbrains.kotlin.serialization.deserialization.NameResolver
|
||||
import org.jetbrains.kotlin.serialization.jvm.JvmProtoBufUtil
|
||||
import org.jetbrains.kotlin.utils.HashSetUtil
|
||||
import java.util.*
|
||||
|
||||
data class Difference(
|
||||
@@ -133,7 +132,7 @@ private abstract class DifferenceCalculator() {
|
||||
): Collection<String> {
|
||||
val oldNames = oldList.map { compareObject.oldNameResolver.getString(it) }.toSet()
|
||||
val newNames = newList.map { compareObject.newNameResolver.getString(it) }.toSet()
|
||||
return HashSetUtil.symmetricDifference(oldNames, newNames)
|
||||
return oldNames.union(newNames) - oldNames.intersect(newNames)
|
||||
}
|
||||
|
||||
private fun MessageLite.getHashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
|
||||
|
||||
@@ -16,13 +16,10 @@
|
||||
|
||||
package org.jetbrains.kotlin.incremental.testingUtils
|
||||
|
||||
import com.google.common.collect.Sets
|
||||
import com.google.common.hash.Hashing
|
||||
import com.google.common.io.Files
|
||||
import com.google.protobuf.ExtensionRegistry
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import org.jetbrains.kotlin.incremental.LocalFileKotlinClass
|
||||
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
|
||||
import org.jetbrains.kotlin.protobuf.ExtensionRegistry
|
||||
import org.jetbrains.kotlin.serialization.DebugProtoBuf
|
||||
import org.jetbrains.kotlin.serialization.jvm.BitEncoding
|
||||
import org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf
|
||||
@@ -36,6 +33,7 @@ import java.io.File
|
||||
import java.io.PrintWriter
|
||||
import java.io.StringWriter
|
||||
import java.util.*
|
||||
import java.util.zip.CRC32
|
||||
import kotlin.comparisons.compareBy
|
||||
|
||||
// Set this to true if you want to dump all bytecode (test will fail in this case)
|
||||
@@ -45,7 +43,7 @@ fun assertEqualDirectories(expected: File, actual: File, forgiveExtraFiles: Bool
|
||||
val pathsInExpected = getAllRelativePaths(expected)
|
||||
val pathsInActual = getAllRelativePaths(actual)
|
||||
|
||||
val commonPaths = Sets.intersection(pathsInExpected, pathsInActual)
|
||||
val commonPaths = pathsInExpected.intersect(pathsInActual)
|
||||
val changedPaths = commonPaths
|
||||
.filter { DUMP_ALL || !Arrays.equals(File(expected, it).readBytes(), File(actual, it).readBytes()) }
|
||||
.sorted()
|
||||
@@ -71,7 +69,11 @@ fun assertEqualDirectories(expected: File, actual: File, forgiveExtraFiles: Bool
|
||||
Assert.assertEquals(expectedString, actualString)
|
||||
}
|
||||
|
||||
private fun File.hash() = Files.hash(this, Hashing.crc32())
|
||||
private fun File.checksumString(): String {
|
||||
val crc32 = CRC32()
|
||||
crc32.update(this.readBytes())
|
||||
return java.lang.Long.toHexString(crc32.value)
|
||||
}
|
||||
|
||||
private fun getDirectoryString(dir: File, interestingPaths: List<String>): String {
|
||||
val buf = StringBuilder()
|
||||
@@ -93,7 +95,7 @@ private fun getDirectoryString(dir: File, interestingPaths: List<String>): Strin
|
||||
}
|
||||
}
|
||||
else {
|
||||
p.println(child.name, " ", child.hash())
|
||||
p.println(child.name, " ", child.checksumString())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ package org.jetbrains.kotlin.serialization;
|
||||
public final class DebugExtOptionsProtoBuf {
|
||||
private DebugExtOptionsProtoBuf() {}
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistry registry) {
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistry registry) {
|
||||
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.skipInComparison);
|
||||
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.nameIdInTable);
|
||||
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.fqNameIdInTable);
|
||||
@@ -17,9 +17,9 @@ public final class DebugExtOptionsProtoBuf {
|
||||
* <code>extend .google.protobuf.FieldOptions { ... }</code>
|
||||
*/
|
||||
public static final
|
||||
com.google.protobuf.GeneratedMessage.GeneratedExtension<
|
||||
com.google.protobuf.DescriptorProtos.FieldOptions,
|
||||
java.lang.Boolean> skipInComparison = com.google.protobuf.GeneratedMessage
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
|
||||
org.jetbrains.kotlin.protobuf.DescriptorProtos.FieldOptions,
|
||||
java.lang.Boolean> skipInComparison = org.jetbrains.kotlin.protobuf.GeneratedMessage
|
||||
.newFileScopedGeneratedExtension(
|
||||
java.lang.Boolean.class,
|
||||
null);
|
||||
@@ -28,9 +28,9 @@ public final class DebugExtOptionsProtoBuf {
|
||||
* <code>extend .google.protobuf.FieldOptions { ... }</code>
|
||||
*/
|
||||
public static final
|
||||
com.google.protobuf.GeneratedMessage.GeneratedExtension<
|
||||
com.google.protobuf.DescriptorProtos.FieldOptions,
|
||||
java.lang.Boolean> nameIdInTable = com.google.protobuf.GeneratedMessage
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
|
||||
org.jetbrains.kotlin.protobuf.DescriptorProtos.FieldOptions,
|
||||
java.lang.Boolean> nameIdInTable = org.jetbrains.kotlin.protobuf.GeneratedMessage
|
||||
.newFileScopedGeneratedExtension(
|
||||
java.lang.Boolean.class,
|
||||
null);
|
||||
@@ -39,9 +39,9 @@ public final class DebugExtOptionsProtoBuf {
|
||||
* <code>extend .google.protobuf.FieldOptions { ... }</code>
|
||||
*/
|
||||
public static final
|
||||
com.google.protobuf.GeneratedMessage.GeneratedExtension<
|
||||
com.google.protobuf.DescriptorProtos.FieldOptions,
|
||||
java.lang.Boolean> fqNameIdInTable = com.google.protobuf.GeneratedMessage
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
|
||||
org.jetbrains.kotlin.protobuf.DescriptorProtos.FieldOptions,
|
||||
java.lang.Boolean> fqNameIdInTable = org.jetbrains.kotlin.protobuf.GeneratedMessage
|
||||
.newFileScopedGeneratedExtension(
|
||||
java.lang.Boolean.class,
|
||||
null);
|
||||
@@ -50,18 +50,18 @@ public final class DebugExtOptionsProtoBuf {
|
||||
* <code>extend .google.protobuf.FieldOptions { ... }</code>
|
||||
*/
|
||||
public static final
|
||||
com.google.protobuf.GeneratedMessage.GeneratedExtension<
|
||||
com.google.protobuf.DescriptorProtos.FieldOptions,
|
||||
java.lang.Boolean> stringIdInTable = com.google.protobuf.GeneratedMessage
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
|
||||
org.jetbrains.kotlin.protobuf.DescriptorProtos.FieldOptions,
|
||||
java.lang.Boolean> stringIdInTable = org.jetbrains.kotlin.protobuf.GeneratedMessage
|
||||
.newFileScopedGeneratedExtension(
|
||||
java.lang.Boolean.class,
|
||||
null);
|
||||
|
||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||
public static org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
|
||||
getDescriptor() {
|
||||
return descriptor;
|
||||
}
|
||||
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||
private static org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
|
||||
descriptor;
|
||||
static {
|
||||
java.lang.String[] descriptorData = {
|
||||
@@ -74,26 +74,27 @@ public final class DebugExtOptionsProtoBuf {
|
||||
":<\n\023fq_name_id_in_table\022\035.google.protobu" +
|
||||
"f.FieldOptions\030\322\206\003 \001(\010:;\n\022string_id_in_t" +
|
||||
"able\022\035.google.protobuf.FieldOptions\030\323\206\003 " +
|
||||
"\001(\010B\034B\027DebugExtOptionsProtoBuf\210\001\000"
|
||||
"\001(\010B\031B\027DebugExtOptionsProtoBuf"
|
||||
};
|
||||
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
|
||||
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
|
||||
public com.google.protobuf.ExtensionRegistry assignDescriptors(
|
||||
com.google.protobuf.Descriptors.FileDescriptor root) {
|
||||
descriptor = root;
|
||||
skipInComparison.internalInit(descriptor.getExtensions().get(0));
|
||||
nameIdInTable.internalInit(descriptor.getExtensions().get(1));
|
||||
fqNameIdInTable.internalInit(descriptor.getExtensions().get(2));
|
||||
stringIdInTable.internalInit(descriptor.getExtensions().get(3));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
com.google.protobuf.Descriptors.FileDescriptor
|
||||
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
|
||||
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
|
||||
public org.jetbrains.kotlin.protobuf.ExtensionRegistry assignDescriptors(
|
||||
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor root) {
|
||||
descriptor = root;
|
||||
return null;
|
||||
}
|
||||
};
|
||||
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||
com.google.protobuf.DescriptorProtos.getDescriptor(),
|
||||
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor[] {
|
||||
org.jetbrains.kotlin.protobuf.DescriptorProtos.getDescriptor(),
|
||||
}, assigner);
|
||||
skipInComparison.internalInit(descriptor.getExtensions().get(0));
|
||||
nameIdInTable.internalInit(descriptor.getExtensions().get(1));
|
||||
fqNameIdInTable.internalInit(descriptor.getExtensions().get(2));
|
||||
stringIdInTable.internalInit(descriptor.getExtensions().get(3));
|
||||
org.jetbrains.kotlin.protobuf.DescriptorProtos.getDescriptor();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(outer_class_scope)
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -6,12 +6,12 @@ package org.jetbrains.kotlin.serialization.jvm;
|
||||
public final class DebugJvmPackageTable {
|
||||
private DebugJvmPackageTable() {}
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistry registry) {
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistry registry) {
|
||||
}
|
||||
public interface PackageTableOrBuilder
|
||||
extends com.google.protobuf.MessageOrBuilder {
|
||||
public interface PackageTableOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.jvm.PackageTable)
|
||||
org.jetbrains.kotlin.protobuf.MessageOrBuilder {
|
||||
|
||||
// repeated .org.jetbrains.kotlin.serialization.jvm.PackageParts package_parts = 1;
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.serialization.jvm.PackageParts package_parts = 1;</code>
|
||||
*/
|
||||
@@ -40,14 +40,15 @@ public final class DebugJvmPackageTable {
|
||||
* Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.PackageTable}
|
||||
*/
|
||||
public static final class PackageTable extends
|
||||
com.google.protobuf.GeneratedMessage
|
||||
implements PackageTableOrBuilder {
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage implements
|
||||
// @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.jvm.PackageTable)
|
||||
PackageTableOrBuilder {
|
||||
// Use PackageTable.newBuilder() to construct.
|
||||
private PackageTable(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
|
||||
private PackageTable(org.jetbrains.kotlin.protobuf.GeneratedMessage.Builder<?> builder) {
|
||||
super(builder);
|
||||
this.unknownFields = builder.getUnknownFields();
|
||||
}
|
||||
private PackageTable(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
|
||||
private PackageTable(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.UnknownFieldSet.getDefaultInstance(); }
|
||||
|
||||
private static final PackageTable defaultInstance;
|
||||
public static PackageTable getDefaultInstance() {
|
||||
@@ -58,20 +59,20 @@ public final class DebugJvmPackageTable {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
private final com.google.protobuf.UnknownFieldSet unknownFields;
|
||||
private final org.jetbrains.kotlin.protobuf.UnknownFieldSet unknownFields;
|
||||
@java.lang.Override
|
||||
public final com.google.protobuf.UnknownFieldSet
|
||||
public final org.jetbrains.kotlin.protobuf.UnknownFieldSet
|
||||
getUnknownFields() {
|
||||
return this.unknownFields;
|
||||
}
|
||||
private PackageTable(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
initFields();
|
||||
int mutable_bitField0_ = 0;
|
||||
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||
org.jetbrains.kotlin.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||
org.jetbrains.kotlin.protobuf.UnknownFieldSet.newBuilder();
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
@@ -97,10 +98,10 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||
throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException(
|
||||
e.getMessage()).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
@@ -110,34 +111,33 @@ public final class DebugJvmPackageTable {
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
public static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor;
|
||||
}
|
||||
|
||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
protected org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable.class, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable.Builder.class);
|
||||
}
|
||||
|
||||
public static com.google.protobuf.Parser<PackageTable> PARSER =
|
||||
new com.google.protobuf.AbstractParser<PackageTable>() {
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<PackageTable> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<PackageTable>() {
|
||||
public PackageTable parsePartialFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new PackageTable(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Parser<PackageTable> getParserForType() {
|
||||
public org.jetbrains.kotlin.protobuf.Parser<PackageTable> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
// repeated .org.jetbrains.kotlin.serialization.jvm.PackageParts package_parts = 1;
|
||||
public static final int PACKAGE_PARTS_FIELD_NUMBER = 1;
|
||||
private java.util.List<org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts> packageParts_;
|
||||
/**
|
||||
@@ -179,7 +179,8 @@ public final class DebugJvmPackageTable {
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized != -1) return isInitialized == 1;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
for (int i = 0; i < getPackagePartsCount(); i++) {
|
||||
if (!getPackageParts(i).isInitialized()) {
|
||||
@@ -191,7 +192,7 @@ public final class DebugJvmPackageTable {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
getSerializedSize();
|
||||
for (int i = 0; i < packageParts_.size(); i++) {
|
||||
@@ -207,7 +208,7 @@ public final class DebugJvmPackageTable {
|
||||
|
||||
size = 0;
|
||||
for (int i = 0; i < packageParts_.size(); i++) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(1, packageParts_.get(i));
|
||||
}
|
||||
size += getUnknownFields().getSerializedSize();
|
||||
@@ -223,24 +224,24 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
org.jetbrains.kotlin.protobuf.ByteString data)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(
|
||||
com.google.protobuf.ByteString data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
org.jetbrains.kotlin.protobuf.ByteString data,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(
|
||||
byte[] data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(java.io.InputStream input)
|
||||
@@ -249,7 +250,7 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
@@ -259,18 +260,18 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(
|
||||
com.google.protobuf.CodedInputStream input)
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
@@ -284,7 +285,7 @@ public final class DebugJvmPackageTable {
|
||||
|
||||
@java.lang.Override
|
||||
protected Builder newBuilderForType(
|
||||
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
Builder builder = new Builder(parent);
|
||||
return builder;
|
||||
}
|
||||
@@ -292,14 +293,15 @@ public final class DebugJvmPackageTable {
|
||||
* Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.PackageTable}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessage.Builder<Builder>
|
||||
implements org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTableOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.Builder<Builder> implements
|
||||
// @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.jvm.PackageTable)
|
||||
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTableOrBuilder {
|
||||
public static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor;
|
||||
}
|
||||
|
||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
protected org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
@@ -312,12 +314,12 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
super(parent);
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
private void maybeForceBuilderInitialization() {
|
||||
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
|
||||
if (org.jetbrains.kotlin.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
|
||||
getPackagePartsFieldBuilder();
|
||||
}
|
||||
}
|
||||
@@ -340,7 +342,7 @@ public final class DebugJvmPackageTable {
|
||||
return create().mergeFrom(buildPartial());
|
||||
}
|
||||
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
public org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor;
|
||||
}
|
||||
@@ -373,7 +375,7 @@ public final class DebugJvmPackageTable {
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
public Builder mergeFrom(org.jetbrains.kotlin.protobuf.Message other) {
|
||||
if (other instanceof org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable) {
|
||||
return mergeFrom((org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable)other);
|
||||
} else {
|
||||
@@ -403,7 +405,7 @@ public final class DebugJvmPackageTable {
|
||||
packageParts_ = other.packageParts_;
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
packagePartsBuilder_ =
|
||||
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
|
||||
getPackagePartsFieldBuilder() : null;
|
||||
} else {
|
||||
packagePartsBuilder_.addAllMessages(other.packageParts_);
|
||||
@@ -425,13 +427,13 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
|
||||
public Builder mergeFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable) e.getUnfinishedMessage();
|
||||
throw e;
|
||||
} finally {
|
||||
@@ -443,7 +445,6 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
// repeated .org.jetbrains.kotlin.serialization.jvm.PackageParts package_parts = 1;
|
||||
private java.util.List<org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts> packageParts_ =
|
||||
java.util.Collections.emptyList();
|
||||
private void ensurePackagePartsIsMutable() {
|
||||
@@ -453,7 +454,7 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
}
|
||||
|
||||
private com.google.protobuf.RepeatedFieldBuilder<
|
||||
private org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder<
|
||||
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts.Builder, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackagePartsOrBuilder> packagePartsBuilder_;
|
||||
|
||||
/**
|
||||
@@ -585,7 +586,8 @@ public final class DebugJvmPackageTable {
|
||||
java.lang.Iterable<? extends org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts> values) {
|
||||
if (packagePartsBuilder_ == null) {
|
||||
ensurePackagePartsIsMutable();
|
||||
super.addAll(values, packageParts_);
|
||||
org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll(
|
||||
values, packageParts_);
|
||||
onChanged();
|
||||
} else {
|
||||
packagePartsBuilder_.addAllMessages(values);
|
||||
@@ -668,11 +670,11 @@ public final class DebugJvmPackageTable {
|
||||
getPackagePartsBuilderList() {
|
||||
return getPackagePartsFieldBuilder().getBuilderList();
|
||||
}
|
||||
private com.google.protobuf.RepeatedFieldBuilder<
|
||||
private org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder<
|
||||
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts.Builder, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackagePartsOrBuilder>
|
||||
getPackagePartsFieldBuilder() {
|
||||
if (packagePartsBuilder_ == null) {
|
||||
packagePartsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
|
||||
packagePartsBuilder_ = new org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder<
|
||||
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts.Builder, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackagePartsOrBuilder>(
|
||||
packageParts_,
|
||||
((bitField0_ & 0x00000001) == 0x00000001),
|
||||
@@ -694,10 +696,10 @@ public final class DebugJvmPackageTable {
|
||||
// @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.jvm.PackageTable)
|
||||
}
|
||||
|
||||
public interface PackagePartsOrBuilder
|
||||
extends com.google.protobuf.MessageOrBuilder {
|
||||
public interface PackagePartsOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.jvm.PackageParts)
|
||||
org.jetbrains.kotlin.protobuf.MessageOrBuilder {
|
||||
|
||||
// required string package_fq_name = 1;
|
||||
/**
|
||||
* <code>required string package_fq_name = 1;</code>
|
||||
*/
|
||||
@@ -709,15 +711,14 @@ public final class DebugJvmPackageTable {
|
||||
/**
|
||||
* <code>required string package_fq_name = 1;</code>
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
org.jetbrains.kotlin.protobuf.ByteString
|
||||
getPackageFqNameBytes();
|
||||
|
||||
// repeated string class_name = 2;
|
||||
/**
|
||||
* <code>repeated string class_name = 2;</code>
|
||||
*/
|
||||
java.util.List<java.lang.String>
|
||||
getClassNameList();
|
||||
org.jetbrains.kotlin.protobuf.ProtocolStringList
|
||||
getClassNameList();
|
||||
/**
|
||||
* <code>repeated string class_name = 2;</code>
|
||||
*/
|
||||
@@ -729,21 +730,22 @@ public final class DebugJvmPackageTable {
|
||||
/**
|
||||
* <code>repeated string class_name = 2;</code>
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
org.jetbrains.kotlin.protobuf.ByteString
|
||||
getClassNameBytes(int index);
|
||||
}
|
||||
/**
|
||||
* Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.PackageParts}
|
||||
*/
|
||||
public static final class PackageParts extends
|
||||
com.google.protobuf.GeneratedMessage
|
||||
implements PackagePartsOrBuilder {
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage implements
|
||||
// @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.jvm.PackageParts)
|
||||
PackagePartsOrBuilder {
|
||||
// Use PackageParts.newBuilder() to construct.
|
||||
private PackageParts(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
|
||||
private PackageParts(org.jetbrains.kotlin.protobuf.GeneratedMessage.Builder<?> builder) {
|
||||
super(builder);
|
||||
this.unknownFields = builder.getUnknownFields();
|
||||
}
|
||||
private PackageParts(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
|
||||
private PackageParts(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.UnknownFieldSet.getDefaultInstance(); }
|
||||
|
||||
private static final PackageParts defaultInstance;
|
||||
public static PackageParts getDefaultInstance() {
|
||||
@@ -754,20 +756,20 @@ public final class DebugJvmPackageTable {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
private final com.google.protobuf.UnknownFieldSet unknownFields;
|
||||
private final org.jetbrains.kotlin.protobuf.UnknownFieldSet unknownFields;
|
||||
@java.lang.Override
|
||||
public final com.google.protobuf.UnknownFieldSet
|
||||
public final org.jetbrains.kotlin.protobuf.UnknownFieldSet
|
||||
getUnknownFields() {
|
||||
return this.unknownFields;
|
||||
}
|
||||
private PackageParts(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
initFields();
|
||||
int mutable_bitField0_ = 0;
|
||||
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||
org.jetbrains.kotlin.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||
org.jetbrains.kotlin.protobuf.UnknownFieldSet.newBuilder();
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
@@ -784,62 +786,63 @@ public final class DebugJvmPackageTable {
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
org.jetbrains.kotlin.protobuf.ByteString bs = input.readBytes();
|
||||
bitField0_ |= 0x00000001;
|
||||
packageFqName_ = input.readBytes();
|
||||
packageFqName_ = bs;
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
org.jetbrains.kotlin.protobuf.ByteString bs = input.readBytes();
|
||||
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
className_ = new com.google.protobuf.LazyStringArrayList();
|
||||
className_ = new org.jetbrains.kotlin.protobuf.LazyStringArrayList();
|
||||
mutable_bitField0_ |= 0x00000002;
|
||||
}
|
||||
className_.add(input.readBytes());
|
||||
className_.add(bs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||
throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException(
|
||||
e.getMessage()).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
className_ = new com.google.protobuf.UnmodifiableLazyStringList(className_);
|
||||
className_ = className_.getUnmodifiableView();
|
||||
}
|
||||
this.unknownFields = unknownFields.build();
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
public static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor;
|
||||
}
|
||||
|
||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
protected org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts.class, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts.Builder.class);
|
||||
}
|
||||
|
||||
public static com.google.protobuf.Parser<PackageParts> PARSER =
|
||||
new com.google.protobuf.AbstractParser<PackageParts>() {
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<PackageParts> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<PackageParts>() {
|
||||
public PackageParts parsePartialFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new PackageParts(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Parser<PackageParts> getParserForType() {
|
||||
public org.jetbrains.kotlin.protobuf.Parser<PackageParts> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
// required string package_fq_name = 1;
|
||||
public static final int PACKAGE_FQ_NAME_FIELD_NUMBER = 1;
|
||||
private java.lang.Object packageFqName_;
|
||||
/**
|
||||
@@ -856,8 +859,8 @@ public final class DebugJvmPackageTable {
|
||||
if (ref instanceof java.lang.String) {
|
||||
return (java.lang.String) ref;
|
||||
} else {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
org.jetbrains.kotlin.protobuf.ByteString bs =
|
||||
(org.jetbrains.kotlin.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
if (bs.isValidUtf8()) {
|
||||
packageFqName_ = s;
|
||||
@@ -868,27 +871,26 @@ public final class DebugJvmPackageTable {
|
||||
/**
|
||||
* <code>required string package_fq_name = 1;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
public org.jetbrains.kotlin.protobuf.ByteString
|
||||
getPackageFqNameBytes() {
|
||||
java.lang.Object ref = packageFqName_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
org.jetbrains.kotlin.protobuf.ByteString b =
|
||||
org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
packageFqName_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
return (org.jetbrains.kotlin.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
|
||||
// repeated string class_name = 2;
|
||||
public static final int CLASS_NAME_FIELD_NUMBER = 2;
|
||||
private com.google.protobuf.LazyStringList className_;
|
||||
private org.jetbrains.kotlin.protobuf.LazyStringList className_;
|
||||
/**
|
||||
* <code>repeated string class_name = 2;</code>
|
||||
*/
|
||||
public java.util.List<java.lang.String>
|
||||
public org.jetbrains.kotlin.protobuf.ProtocolStringList
|
||||
getClassNameList() {
|
||||
return className_;
|
||||
}
|
||||
@@ -907,19 +909,20 @@ public final class DebugJvmPackageTable {
|
||||
/**
|
||||
* <code>repeated string class_name = 2;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
public org.jetbrains.kotlin.protobuf.ByteString
|
||||
getClassNameBytes(int index) {
|
||||
return className_.getByteString(index);
|
||||
}
|
||||
|
||||
private void initFields() {
|
||||
packageFqName_ = "";
|
||||
className_ = com.google.protobuf.LazyStringArrayList.EMPTY;
|
||||
className_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized != -1) return isInitialized == 1;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
if (!hasPackageFqName()) {
|
||||
memoizedIsInitialized = 0;
|
||||
@@ -929,7 +932,7 @@ public final class DebugJvmPackageTable {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
getSerializedSize();
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
@@ -948,13 +951,13 @@ public final class DebugJvmPackageTable {
|
||||
|
||||
size = 0;
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeBytesSize(1, getPackageFqNameBytes());
|
||||
}
|
||||
{
|
||||
int dataSize = 0;
|
||||
for (int i = 0; i < className_.size(); i++) {
|
||||
dataSize += com.google.protobuf.CodedOutputStream
|
||||
dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeBytesSizeNoTag(className_.getByteString(i));
|
||||
}
|
||||
size += dataSize;
|
||||
@@ -973,24 +976,24 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
org.jetbrains.kotlin.protobuf.ByteString data)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(
|
||||
com.google.protobuf.ByteString data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
org.jetbrains.kotlin.protobuf.ByteString data,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(
|
||||
byte[] data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(java.io.InputStream input)
|
||||
@@ -999,7 +1002,7 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
@@ -1009,18 +1012,18 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(
|
||||
com.google.protobuf.CodedInputStream input)
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
@@ -1034,7 +1037,7 @@ public final class DebugJvmPackageTable {
|
||||
|
||||
@java.lang.Override
|
||||
protected Builder newBuilderForType(
|
||||
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
Builder builder = new Builder(parent);
|
||||
return builder;
|
||||
}
|
||||
@@ -1042,14 +1045,15 @@ public final class DebugJvmPackageTable {
|
||||
* Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.PackageParts}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessage.Builder<Builder>
|
||||
implements org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackagePartsOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.Builder<Builder> implements
|
||||
// @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.jvm.PackageParts)
|
||||
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackagePartsOrBuilder {
|
||||
public static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor;
|
||||
}
|
||||
|
||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
protected org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
@@ -1062,12 +1066,12 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
super(parent);
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
private void maybeForceBuilderInitialization() {
|
||||
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
|
||||
if (org.jetbrains.kotlin.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
|
||||
}
|
||||
}
|
||||
private static Builder create() {
|
||||
@@ -1078,7 +1082,7 @@ public final class DebugJvmPackageTable {
|
||||
super.clear();
|
||||
packageFqName_ = "";
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
className_ = com.google.protobuf.LazyStringArrayList.EMPTY;
|
||||
className_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
return this;
|
||||
}
|
||||
@@ -1087,7 +1091,7 @@ public final class DebugJvmPackageTable {
|
||||
return create().mergeFrom(buildPartial());
|
||||
}
|
||||
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
public org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor;
|
||||
}
|
||||
@@ -1113,8 +1117,7 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
result.packageFqName_ = packageFqName_;
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
className_ = new com.google.protobuf.UnmodifiableLazyStringList(
|
||||
className_);
|
||||
className_ = className_.getUnmodifiableView();
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
}
|
||||
result.className_ = className_;
|
||||
@@ -1123,7 +1126,7 @@ public final class DebugJvmPackageTable {
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
public Builder mergeFrom(org.jetbrains.kotlin.protobuf.Message other) {
|
||||
if (other instanceof org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts) {
|
||||
return mergeFrom((org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts)other);
|
||||
} else {
|
||||
@@ -1162,13 +1165,13 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
|
||||
public Builder mergeFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts) e.getUnfinishedMessage();
|
||||
throw e;
|
||||
} finally {
|
||||
@@ -1180,7 +1183,6 @@ public final class DebugJvmPackageTable {
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
// required string package_fq_name = 1;
|
||||
private java.lang.Object packageFqName_ = "";
|
||||
/**
|
||||
* <code>required string package_fq_name = 1;</code>
|
||||
@@ -1194,9 +1196,12 @@ public final class DebugJvmPackageTable {
|
||||
public java.lang.String getPackageFqName() {
|
||||
java.lang.Object ref = packageFqName_;
|
||||
if (!(ref instanceof java.lang.String)) {
|
||||
java.lang.String s = ((com.google.protobuf.ByteString) ref)
|
||||
.toStringUtf8();
|
||||
packageFqName_ = s;
|
||||
org.jetbrains.kotlin.protobuf.ByteString bs =
|
||||
(org.jetbrains.kotlin.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
if (bs.isValidUtf8()) {
|
||||
packageFqName_ = s;
|
||||
}
|
||||
return s;
|
||||
} else {
|
||||
return (java.lang.String) ref;
|
||||
@@ -1205,17 +1210,17 @@ public final class DebugJvmPackageTable {
|
||||
/**
|
||||
* <code>required string package_fq_name = 1;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
public org.jetbrains.kotlin.protobuf.ByteString
|
||||
getPackageFqNameBytes() {
|
||||
java.lang.Object ref = packageFqName_;
|
||||
if (ref instanceof String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
org.jetbrains.kotlin.protobuf.ByteString b =
|
||||
org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
packageFqName_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
return (org.jetbrains.kotlin.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
@@ -1244,7 +1249,7 @@ public final class DebugJvmPackageTable {
|
||||
* <code>required string package_fq_name = 1;</code>
|
||||
*/
|
||||
public Builder setPackageFqNameBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
org.jetbrains.kotlin.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
@@ -1254,20 +1259,19 @@ public final class DebugJvmPackageTable {
|
||||
return this;
|
||||
}
|
||||
|
||||
// repeated string class_name = 2;
|
||||
private com.google.protobuf.LazyStringList className_ = com.google.protobuf.LazyStringArrayList.EMPTY;
|
||||
private org.jetbrains.kotlin.protobuf.LazyStringList className_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
|
||||
private void ensureClassNameIsMutable() {
|
||||
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
className_ = new com.google.protobuf.LazyStringArrayList(className_);
|
||||
className_ = new org.jetbrains.kotlin.protobuf.LazyStringArrayList(className_);
|
||||
bitField0_ |= 0x00000002;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated string class_name = 2;</code>
|
||||
*/
|
||||
public java.util.List<java.lang.String>
|
||||
public org.jetbrains.kotlin.protobuf.ProtocolStringList
|
||||
getClassNameList() {
|
||||
return java.util.Collections.unmodifiableList(className_);
|
||||
return className_.getUnmodifiableView();
|
||||
}
|
||||
/**
|
||||
* <code>repeated string class_name = 2;</code>
|
||||
@@ -1284,7 +1288,7 @@ public final class DebugJvmPackageTable {
|
||||
/**
|
||||
* <code>repeated string class_name = 2;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
public org.jetbrains.kotlin.protobuf.ByteString
|
||||
getClassNameBytes(int index) {
|
||||
return className_.getByteString(index);
|
||||
}
|
||||
@@ -1320,7 +1324,8 @@ public final class DebugJvmPackageTable {
|
||||
public Builder addAllClassName(
|
||||
java.lang.Iterable<java.lang.String> values) {
|
||||
ensureClassNameIsMutable();
|
||||
super.addAll(values, className_);
|
||||
org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll(
|
||||
values, className_);
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@@ -1328,7 +1333,7 @@ public final class DebugJvmPackageTable {
|
||||
* <code>repeated string class_name = 2;</code>
|
||||
*/
|
||||
public Builder clearClassName() {
|
||||
className_ = com.google.protobuf.LazyStringArrayList.EMPTY;
|
||||
className_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
onChanged();
|
||||
return this;
|
||||
@@ -1337,7 +1342,7 @@ public final class DebugJvmPackageTable {
|
||||
* <code>repeated string class_name = 2;</code>
|
||||
*/
|
||||
public Builder addClassNameBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
org.jetbrains.kotlin.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
@@ -1358,22 +1363,22 @@ public final class DebugJvmPackageTable {
|
||||
// @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.jvm.PackageParts)
|
||||
}
|
||||
|
||||
private static com.google.protobuf.Descriptors.Descriptor
|
||||
private static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor;
|
||||
private static
|
||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_fieldAccessorTable;
|
||||
private static com.google.protobuf.Descriptors.Descriptor
|
||||
private static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor;
|
||||
private static
|
||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_fieldAccessorTable;
|
||||
|
||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||
public static org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
|
||||
getDescriptor() {
|
||||
return descriptor;
|
||||
}
|
||||
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||
private static org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
|
||||
descriptor;
|
||||
static {
|
||||
java.lang.String[] descriptorData = {
|
||||
@@ -1386,31 +1391,31 @@ public final class DebugJvmPackageTable {
|
||||
"\nclass_name\030\002 \003(\tB\026B\024DebugJvmPackageTabl" +
|
||||
"e"
|
||||
};
|
||||
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
|
||||
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
|
||||
public com.google.protobuf.ExtensionRegistry assignDescriptors(
|
||||
com.google.protobuf.Descriptors.FileDescriptor root) {
|
||||
descriptor = root;
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor =
|
||||
getDescriptor().getMessageTypes().get(0);
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor,
|
||||
new java.lang.String[] { "PackageParts", });
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor =
|
||||
getDescriptor().getMessageTypes().get(1);
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor,
|
||||
new java.lang.String[] { "PackageFqName", "ClassName", });
|
||||
return null;
|
||||
}
|
||||
};
|
||||
com.google.protobuf.Descriptors.FileDescriptor
|
||||
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
|
||||
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
|
||||
public org.jetbrains.kotlin.protobuf.ExtensionRegistry assignDescriptors(
|
||||
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor root) {
|
||||
descriptor = root;
|
||||
return null;
|
||||
}
|
||||
};
|
||||
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor[] {
|
||||
}, assigner);
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor =
|
||||
getDescriptor().getMessageTypes().get(0);
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_fieldAccessorTable = new
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor,
|
||||
new java.lang.String[] { "PackageParts", });
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor =
|
||||
getDescriptor().getMessageTypes().get(1);
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_fieldAccessorTable = new
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor,
|
||||
new java.lang.String[] { "PackageFqName", "ClassName", });
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(outer_class_scope)
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
170
build.xml
170
build.xml
@@ -24,8 +24,8 @@
|
||||
<property name="build.number" value="snapshot"/>
|
||||
<property name="bootstrap.build.no.tests" value="false"/>
|
||||
<property name="idea.sdk" value="${basedir}/ideaSDK"/>
|
||||
<property name="protobuf.jar" value="${idea.sdk}/lib/protobuf-2.5.0.jar"/>
|
||||
<property name="protobuf-lite.jar" value="${basedir}/dependencies/protobuf-2.5.0-lite.jar"/>
|
||||
<property name="protobuf.jar" value="${basedir}/dependencies/protobuf-2.6.1.jar"/>
|
||||
<property name="protobuf-lite.jar" value="${basedir}/dependencies/protobuf-2.6.1-lite.jar"/>
|
||||
<property name="javax.inject.jar" value="${basedir}/lib/javax.inject.jar"/>
|
||||
|
||||
<property name="java.target" value="1.6"/>
|
||||
@@ -43,6 +43,10 @@
|
||||
|
||||
<include file="jslib_files.xml" />
|
||||
|
||||
<property name="compiled.stdlib.js" value="stdlib.js"/>
|
||||
<property name="compiled.stdlib.meta.js" value="kotlin.meta.js"/>
|
||||
<property name="stdlib.js.dir" value="${basedir}/js/js.translator/testData"/>
|
||||
|
||||
<!--
|
||||
The compiler produced on the first step of the build (Bootstrap No Tests) is only guaranteed to work against the OLD runtime
|
||||
located in dependencies/bootstrap-compiler/.../kotlin-runtime.jar, because the newly built compiler is just a Kotlin application,
|
||||
@@ -319,46 +323,28 @@
|
||||
<arg value="-meta-info"/>
|
||||
<arg value="-kjsm"/>
|
||||
<arg line="-main noCall"/>
|
||||
<arg line="-module-kind commonjs"/>
|
||||
</java>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<target name="js-stdlib">
|
||||
<property name="compiled.builtins.js" value="builtins.js"/>
|
||||
<property name="compiled.builtins.meta.js" value="builtins.meta.js"/>
|
||||
<property name="compiled.stdlib.js" value="stdlib.js"/>
|
||||
<property name="compiled.stdlib.meta.js" value="stdlib.meta.js"/>
|
||||
<property name="stdlib.js.dir" value="${basedir}/js/js.translator/testData"/>
|
||||
|
||||
<kotlin-pp src="libraries/stdlib/src" output="${intermediate-sources}/stdlib/js" profile="JS" />
|
||||
|
||||
<new-kotlin2js output="${js.stdlib.output.dir}/${compiled.builtins.js}">
|
||||
<src>
|
||||
<fileset refid="kotlin.builtin.files"/>
|
||||
</src>
|
||||
</new-kotlin2js>
|
||||
|
||||
<new-kotlin2js output="${js.stdlib.output.dir}/${compiled.stdlib.js}">
|
||||
<src>
|
||||
<resources refid="js.lib.files"/>
|
||||
</src>
|
||||
</new-kotlin2js>
|
||||
|
||||
<taskdef name="closure-compiler"
|
||||
classname="com.google.javascript.jscomp.ant.CompileTask"
|
||||
classpath="${dependencies.dir}/closure-compiler.jar"/>
|
||||
|
||||
<target name="js-stdlib-merge">
|
||||
<!-- value should be one of: whitespace, simple, advanced -->
|
||||
<property name="compilationLevel" value="whitespace"/>
|
||||
<!-- value should be one of: default, quiet, verbose -->
|
||||
<property name="warningLevel" value="default"/>
|
||||
|
||||
<taskdef name="closure-compiler"
|
||||
classname="com.google.javascript.jscomp.ant.CompileTask"
|
||||
classpath="${dependencies.dir}/closure-compiler.jar"/>
|
||||
|
||||
<closure-compiler
|
||||
compilationLevel="${compilationLevel}"
|
||||
prettyprint="true"
|
||||
languagein="ECMASCRIPT5_STRICT"
|
||||
warning="${warningLevel}"
|
||||
output="${js.stdlib.output.dir}/kotlin.js">
|
||||
output="${js.stdlib.output.dir}/kotlin.js"
|
||||
outputWrapperFile="${stdlib.js.dir}/closure-wrapper.txt">
|
||||
|
||||
<sources dir="${stdlib.js.dir}">
|
||||
<file name="kotlin_lib_ecma5.js"/>
|
||||
@@ -367,29 +353,60 @@
|
||||
<file name="long.js"/>
|
||||
</sources>
|
||||
|
||||
<sources dir="${js.stdlib.output.dir}">
|
||||
<file name="${compiled.builtins.js}"/>
|
||||
</sources>
|
||||
|
||||
<sources dir="${js.stdlib.output.dir}">
|
||||
<file name="${compiled.stdlib.js}"/>
|
||||
</sources>
|
||||
|
||||
<sources dir="${stdlib.js.dir}">
|
||||
<file name="export_Kotlin_if_possible.js"/>
|
||||
<file name="merge.js"/>
|
||||
</sources>
|
||||
|
||||
<externs dir="${stdlib.js.dir}">
|
||||
<file name="externs.js"/>
|
||||
</externs>
|
||||
</closure-compiler>
|
||||
</target>
|
||||
|
||||
<target name="js-stdlib">
|
||||
<property environment="env"/>
|
||||
<kotlin-pp src="libraries/stdlib/src" output="${intermediate-sources}/stdlib/js" profile="JS" />
|
||||
|
||||
<new-kotlin2js output="${js.stdlib.output.dir}/tmp/kotlin.js">
|
||||
<src>
|
||||
<union>
|
||||
<fileset refid="kotlin.builtin.files"/>
|
||||
<resources refid="js.lib.files"/>
|
||||
</union>
|
||||
</src>
|
||||
</new-kotlin2js>
|
||||
<move file="${js.stdlib.output.dir}/tmp/kotlin.js" tofile="${js.stdlib.output.dir}/${compiled.stdlib.js}" />
|
||||
<move file="${js.stdlib.output.dir}/tmp/kotlin" todir="${js.stdlib.output.dir}" />
|
||||
<move file="${js.stdlib.output.dir}/tmp/${compiled.stdlib.meta.js}" tofile="${js.stdlib.output.dir}/${compiled.stdlib.meta.js}" />
|
||||
|
||||
<condition property="jdk17" value="${env.JDK_17}" else="${env.JAVA_HOME}">
|
||||
<isset property="env.JDK_17" />
|
||||
</condition>
|
||||
<java classname="org.apache.tools.ant.launch.Launcher"
|
||||
fork="true"
|
||||
failonerror="true"
|
||||
timeout="4000000"
|
||||
taskname="startAnt"
|
||||
jvm="${jdk17}/bin/java">
|
||||
<env key="JAVA_HOME" value="${jdk17}"/>
|
||||
<classpath>
|
||||
<pathelement location="${ant.home}/lib/ant-launcher.jar"/>
|
||||
</classpath>
|
||||
<arg line="-f" />
|
||||
<arg line="build.xml" />
|
||||
<arg line="js-stdlib-merge" />
|
||||
</java>
|
||||
|
||||
<jar jarfile="${kotlin-home}/lib/kotlin-jslib.jar" duplicate="fail">
|
||||
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
||||
<zipfileset dir="${js.stdlib.output.dir}" prefix="">
|
||||
<include name="kotlin.js"/>
|
||||
<include name="${compiled.stdlib.meta.js}"/>
|
||||
<include name="stdlib/**"/>
|
||||
<include name="kotlin/**"/>
|
||||
</zipfileset>
|
||||
|
||||
<manifest>
|
||||
@@ -489,6 +506,13 @@
|
||||
<attribute name="compress" default="true"/>
|
||||
|
||||
<sequential>
|
||||
<local name="idea.core.uberjar.exists"/>
|
||||
<available file="${dependencies.dir}/idea/idea-core-all.jar" property="idea.core.uberjar.exists"/>
|
||||
<!-- TODO: move this jar creation to update_dependencies.xml eventually -->
|
||||
<jar jarfile="${dependencies.dir}/idea/idea-core-all.jar" unless:true="${idea.core.uberjar.exists}">
|
||||
<zipgroupfileset dir="${idea.sdk}/core" includes="*.jar" excludes="util.jar"/>
|
||||
</jar>
|
||||
|
||||
<jar jarfile="@{jarfile}" compress="@{compress}" duplicate="preserve">
|
||||
<fileset dir="${output}/classes/compiler"/>
|
||||
<fileset dir="${output}/builtins">
|
||||
@@ -507,7 +531,7 @@
|
||||
</fileset>
|
||||
|
||||
<zipgroupfileset dir="${basedir}/lib" includes="*.jar"/>
|
||||
<zipgroupfileset dir="${basedir}/ideaSDK/core" includes="*.jar" excludes="util.jar"/>
|
||||
<zipfileset src="${dependencies.dir}/idea/idea-core-all.jar" excludes="META-INF/INDEX.LIST"/>
|
||||
<zipfileset src="${idea.sdk}/lib/jna-platform.jar"/>
|
||||
<zipfileset src="${idea.sdk}/lib/oromatcher.jar"/>
|
||||
<zipfileset src="${idea.sdk}/jps/jps-model.jar"/>
|
||||
@@ -655,38 +679,40 @@
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<target name="kotlin-build-common-test" depends="kotlin-build-common,kotlin-test">
|
||||
<target name="kotlin-build-common-test">
|
||||
<cleandir dir="${output}/classes/kotlin-build-common-test"/>
|
||||
|
||||
<javac2 destdir="${output}/classes/kotlin-build-common-test" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false"
|
||||
source="${java.target}" target="${java.target}">
|
||||
<withKotlin modulename="kotlin-build-common"/>
|
||||
<skip pattern="kotlin/jvm/internal/.*"/>
|
||||
<skip pattern="kotlin/Metadata"/>
|
||||
<src path="build-common/test"/>
|
||||
<classpath>
|
||||
<pathelement path="${bootstrap.runtime}"/>
|
||||
<pathelement path="${bootstrap.reflect}"/>
|
||||
<pathelement path="${bootstrap.kotlin.test}"/>
|
||||
<pathelement path="${protobuf.jar}"/>
|
||||
<pathelement path="${idea.sdk}/lib/junit-4.12.jar"/>
|
||||
<pathelement path="${idea.sdk}/lib/guava-17.0.jar"/>
|
||||
<pathelement path="${kotlin-home}/lib/kotlin-build-common.jar"/>
|
||||
<pathelement path="${kotlin-home}/lib/kotlin-compiler.jar"/>
|
||||
<pathelement path="${protobuf.jar}"/>
|
||||
</classpath>
|
||||
</javac2>
|
||||
|
||||
<jar destfile="${kotlin-home}/lib/kotlin-build-common-test.jar">
|
||||
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="dependencies/jarjar.jar"/>
|
||||
|
||||
<jarjar jarfile="${kotlin-home}/lib/kotlin-build-common-test.jar">
|
||||
<fileset dir="${output}/classes/kotlin-build-common-test"/>
|
||||
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
||||
<zipfileset src="${protobuf.jar}"/>
|
||||
<rule pattern="com.intellij.**" result="org.jetbrains.kotlin.com.intellij.@1"/>
|
||||
|
||||
<manifest>
|
||||
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
||||
|
||||
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
||||
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.build.common}"/>
|
||||
<attribute name="Implementation-Version" value="${build.number}"/>
|
||||
</manifest>
|
||||
</jar>
|
||||
</jarjar>
|
||||
</target>
|
||||
|
||||
<target name="daemon-client">
|
||||
@@ -697,8 +723,6 @@
|
||||
<pathelement path="compiler/daemon/daemon-client/src"/>
|
||||
</src>
|
||||
<classpath>
|
||||
<pathelement path="${bootstrap.runtime}"/>
|
||||
<pathelement path="${bootstrap.reflect}"/>
|
||||
<pathelement path="${kotlin-home}/lib/kotlin-compiler.jar"/>
|
||||
<pathelement path="${dependencies.dir}/native-platform-uberjar.jar"/>
|
||||
</classpath>
|
||||
@@ -732,8 +756,6 @@
|
||||
<classpath>
|
||||
<pathelement path="${idea.sdk}/core/intellij-core.jar"/>
|
||||
<pathelement path="${kotlin-home}/lib/kotlin-compiler.jar"/>
|
||||
<pathelement path="${bootstrap.runtime}"/>
|
||||
<pathelement path="${bootstrap.reflect}"/>
|
||||
</classpath>
|
||||
</javac2>
|
||||
|
||||
@@ -743,6 +765,55 @@
|
||||
<fileset dir="${basedir}/plugins/android-extensions/android-extensions-compiler/src" includes="META-INF/services/**"/>
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<target name="annotation-processing-under-jdk8">
|
||||
<property environment="env"/>
|
||||
|
||||
<condition property="jdk18" value="${env.JDK_18}" else="${env.JAVA_HOME}">
|
||||
<isset property="env.JDK_18" />
|
||||
</condition>
|
||||
<java classname="org.apache.tools.ant.launch.Launcher"
|
||||
fork="true"
|
||||
failonerror="true"
|
||||
timeout="4000000"
|
||||
taskname="startAnt"
|
||||
jvm="${jdk18}/bin/java">
|
||||
<env key="JAVA_HOME" value="${jdk18}"/>
|
||||
<classpath>
|
||||
<pathelement location="${ant.home}/lib/ant-launcher.jar"/>
|
||||
</classpath>
|
||||
<arg line="-f" />
|
||||
<arg line="build.xml" />
|
||||
<arg line="annotation-processing" />
|
||||
</java>
|
||||
</target>
|
||||
|
||||
<target name="annotation-processing">
|
||||
<cleandir dir="${output}/classes/annotation-processing"/>
|
||||
<javac2 destdir="${output}/classes/annotation-processing" debug="true" debuglevel="lines,vars,source"
|
||||
includeAntRuntime="false" source="${java.target}" target="${java.target}">
|
||||
<withKotlin modulename="annotation-processing">
|
||||
<compilerarg value="-version"/>
|
||||
</withKotlin>
|
||||
<skip pattern="kotlin/Metadata"/>
|
||||
<src>
|
||||
<pathelement path="plugins/annotation-processing/src"/>
|
||||
<pathelement path="plugins/java-model-wrappers/src"/>
|
||||
</src>
|
||||
<classpath>
|
||||
<pathelement path="${idea.sdk}/core/intellij-core.jar"/>
|
||||
<pathelement path="${kotlin-home}/lib/kotlin-compiler.jar"/>
|
||||
<pathelement path="${bootstrap.runtime}"/>
|
||||
<pathelement path="${bootstrap.reflect}"/>
|
||||
</classpath>
|
||||
</javac2>
|
||||
|
||||
<jar destfile="${kotlin-home}/lib/kotlin-annotation-processing.jar">
|
||||
<fileset dir="${output}/classes/annotation-processing"/>
|
||||
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
||||
<fileset dir="${basedir}/plugins/annotation-processing/src" includes="META-INF/services/**"/>
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<target name="ant-tools">
|
||||
<cleandir dir="${output}/classes/ant"/>
|
||||
@@ -759,8 +830,6 @@
|
||||
</src>
|
||||
<compilerarg value="-Xlint:all"/>
|
||||
<classpath>
|
||||
<file file="${bootstrap.runtime}"/>
|
||||
<file file="${bootstrap.reflect}"/>
|
||||
<pathelement location="${dependencies.dir}/ant-1.8/lib/ant.jar"/>
|
||||
<pathelement location="${kotlin-home}/lib/kotlin-preloader.jar"/>
|
||||
</classpath>
|
||||
@@ -998,7 +1067,6 @@
|
||||
<jarjar jarfile="${output}/kotlin-reflect-jarjar.jar" filesonly="true" filesetmanifest="merge">
|
||||
<zipfileset src="${output}/kotlin-reflect-before-jarjar.jar"/>
|
||||
<rule pattern="org.jetbrains.kotlin.**" result="kotlin.reflect.jvm.internal.impl.@1"/>
|
||||
<rule pattern="com.google.protobuf.**" result="kotlin.reflect.jvm.internal.impl.com.google.protobuf.@1"/>
|
||||
<rule pattern="javax.inject.**" result="kotlin.reflect.jvm.internal.impl.javax.inject.@1"/>
|
||||
</jarjar>
|
||||
|
||||
@@ -1074,11 +1142,11 @@
|
||||
depends="builtins,stdlib,kotlin-test,core,reflection,pack-runtime,pack-runtime-sources,mock-runtime-for-test"/>
|
||||
|
||||
<target name="dist"
|
||||
depends="clean,init,prepare-dist,preloader,runner,serialize-builtins,compiler,compiler-sources,kotlin-build-common,ant-tools,runtime,kotlin-js-stdlib,android-extensions-compiler,daemon-client,kotlin-build-common-test"
|
||||
depends="clean,init,prepare-dist,preloader,runner,serialize-builtins,compiler,compiler-sources,kotlin-build-common,ant-tools,runtime,kotlin-js-stdlib,android-extensions-compiler,annotation-processing-under-jdk8,daemon-client,kotlin-build-common-test"
|
||||
description="Builds redistributables from sources"/>
|
||||
|
||||
<target name="dist-quick"
|
||||
depends="clean,init,prepare-dist,preloader,serialize-builtins,compiler-quick,ant-tools,runtime,kotlin-js-stdlib,android-extensions-compiler"
|
||||
depends="clean,init,prepare-dist,preloader,serialize-builtins,compiler-quick,ant-tools,runtime,kotlin-js-stdlib,android-extensions-compiler,annotation-processing-under-jdk8"
|
||||
description="Builds everything, but classes are reused from project out dir, doesn't run proguard and javadoc"/>
|
||||
|
||||
<target name="dist-quick-compiler-only"
|
||||
|
||||
@@ -1,43 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="android" name="Android">
|
||||
<configuration>
|
||||
<option name="GEN_FOLDER_RELATIVE_PATH_APT" value="/gen" />
|
||||
<option name="GEN_FOLDER_RELATIVE_PATH_AIDL" value="/gen" />
|
||||
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/AndroidManifest.xml" />
|
||||
<option name="RES_FOLDER_RELATIVE_PATH" value="/res" />
|
||||
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/assets" />
|
||||
<option name="LIBS_FOLDER_RELATIVE_PATH" value="/libs" />
|
||||
<option name="USE_CUSTOM_APK_RESOURCE_FOLDER" value="false" />
|
||||
<option name="CUSTOM_APK_RESOURCE_FOLDER" value="" />
|
||||
<option name="USE_CUSTOM_COMPILER_MANIFEST" value="false" />
|
||||
<option name="CUSTOM_COMPILER_MANIFEST" value="" />
|
||||
<option name="APK_PATH" value="" />
|
||||
<option name="LIBRARY_PROJECT" value="false" />
|
||||
<option name="RUN_PROCESS_RESOURCES_MAVEN_TASK" value="true" />
|
||||
<option name="GENERATE_UNSIGNED_APK" value="false" />
|
||||
<option name="CUSTOM_DEBUG_KEYSTORE_PATH" value="" />
|
||||
<option name="PACK_TEST_CODE" value="false" />
|
||||
<option name="RUN_PROGUARD" value="false" />
|
||||
<option name="PROGUARD_CFG_PATH" value="/proguard-project.txt" />
|
||||
<resOverlayFolders>
|
||||
<path>/res-overlay</path>
|
||||
</resOverlayFolders>
|
||||
<includeSystemProguardFile>true</includeSystemProguardFile>
|
||||
<includeAssetsFromLibraries>false</includeAssetsFromLibraries>
|
||||
<additionalNativeLibs />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android 2.3.3 Platform" jdkType="Android SDK" />
|
||||
<module version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="false">
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
</module>
|
||||
74
compiler/android-tests/android-module/build.gradle
Normal file
74
compiler/android-tests/android-module/build.gradle
Normal file
@@ -0,0 +1,74 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.1.0'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 19
|
||||
buildToolsVersion "23.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "org.jetbrains.kotlin.android.tests"
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 19
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testApplicationId "org.jetbrains.kotlin.android.tests.gradle"
|
||||
testInstrumentationRunner "android.test.InstrumentationTestRunner"
|
||||
}
|
||||
buildTypes {
|
||||
debug {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile 'AndroidManifest.xml'
|
||||
java {
|
||||
srcDirs = ['src']
|
||||
}
|
||||
res.srcDirs = ['res']
|
||||
}
|
||||
androidTest {
|
||||
java {
|
||||
srcDirs = ['src']
|
||||
}
|
||||
}
|
||||
}
|
||||
packagingOptions { exclude 'META-INF/build.txt' }
|
||||
|
||||
//TODO run under java 6, cause there is error on implicit 'stream' import in 'asWithMutable' test
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
incremental = false
|
||||
}
|
||||
|
||||
dexOptions {
|
||||
dexInProcess false
|
||||
javaMaxHeapSize "600m"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
androidTestCompile 'junit:junit:4.12'
|
||||
}
|
||||
@@ -8,5 +8,5 @@
|
||||
# For customization when using a Version Control System, please read the
|
||||
# header note.
|
||||
#sdk.dir=compiler/android-tests/android-module/android-sdk/android-sdk-windows
|
||||
#sdk.dir.relative=android-sdk/android-sdk-windows
|
||||
sdk.dir=../../../android.tests.dependencies/android-sdk
|
||||
|
||||
|
||||
@@ -22,11 +22,8 @@ import java.lang.reflect.Method;
|
||||
|
||||
public class AbstractCodegenTestCaseOnAndroid extends TestCase {
|
||||
|
||||
protected void invokeBoxMethod(String filePath, String expectedResult) throws Exception {
|
||||
protected void invokeBoxMethod(Class clazz, String filePath, String expectedResult) throws Exception {
|
||||
try {
|
||||
String simpelName = filePath.substring(filePath.lastIndexOf("/") + 1);
|
||||
String packageName = filePath.replaceAll("\\\\|-|\\.|/", "_");
|
||||
Class clazz = Class.forName(packageName + "." + getPackageClassName(simpelName));
|
||||
Method method = clazz.getMethod("box");
|
||||
assertEquals(expectedResult, method.invoke(null));
|
||||
}
|
||||
@@ -34,8 +31,4 @@ public class AbstractCodegenTestCaseOnAndroid extends TestCase {
|
||||
throw new RuntimeException("File: " + filePath, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getPackageClassName(String fileName) {
|
||||
return Character.toUpperCase(fileName.charAt(0)) + fileName.substring(1).replaceAll("\\.kt", "Kt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,5 +16,6 @@
|
||||
<orderEntry type="library" name="idea-full" level="project" />
|
||||
<orderEntry type="module" module-name="util" />
|
||||
<orderEntry type="module" module-name="descriptor.loader.java" scope="TEST" />
|
||||
<orderEntry type="module" module-name="frontend.java" scope="TEST" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -19,25 +19,27 @@ package org.jetbrains.kotlin.android.tests;
|
||||
import com.intellij.util.PlatformUtils;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.android.tests.ant.AntRunner;
|
||||
import org.jetbrains.kotlin.android.tests.download.SDKDownloader;
|
||||
import org.jetbrains.kotlin.android.tests.emulator.Emulator;
|
||||
import org.jetbrains.kotlin.android.tests.gradle.GradleRunner;
|
||||
import org.jetbrains.kotlin.android.tests.run.PermissionManager;
|
||||
import org.junit.Assert;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CodegenTestsOnAndroidRunner {
|
||||
private static final Pattern ERROR_IN_TEST_OUTPUT_PATTERN =
|
||||
Pattern.compile("([\\s]+at .*| Caused .*| java.lang.RuntimeException: File: .*|[\\s]+\\.\\.\\. .* more| Error in .*)");
|
||||
private static final Pattern NUMBER_OF_TESTS_IF_FAILED = Pattern.compile("Tests run: ([0-9]*), Failures: ([0-9]*), Errors: ([0-9]*)");
|
||||
private static final Pattern NUMBER_OF_TESTS_OK = Pattern.compile(" OK \\(([0-9]*) tests\\)");
|
||||
|
||||
private final PathManager pathManager;
|
||||
|
||||
@@ -53,123 +55,22 @@ public class CodegenTestsOnAndroidRunner {
|
||||
TestSuite suite = new TestSuite("MySuite");
|
||||
|
||||
String resultOutput = runTests();
|
||||
if (resultOutput == null) return suite;
|
||||
|
||||
//Fix problem with exception parsing cause 'at' pattern
|
||||
resultOutput = resultOutput.replaceAll("\\[checkenv\\] Installed at", "[checkenv] Installed_at");
|
||||
|
||||
// Test name -> stackTrace
|
||||
Map<String, String> resultMap = parseOutputForFailedTests(resultOutput);
|
||||
final Statistics statistics;
|
||||
|
||||
// If map is empty => there are no failed tests
|
||||
if (resultMap.isEmpty()) {
|
||||
statistics = parseOutputForTestsNumberIfTestsPassed(resultOutput);
|
||||
String reportFolder = pathManager.getTmpFolder() + "/build/outputs/androidTest-results/connected";
|
||||
try {
|
||||
List<TestCase> testCases = parseSingleReportInFolder(reportFolder);
|
||||
for (TestCase aCase : testCases) {
|
||||
suite.addTest(aCase);
|
||||
}
|
||||
Assert.assertNotEquals("There is no test results in report", 0, testCases.size());
|
||||
}
|
||||
else {
|
||||
statistics = parseOutputForTestsNumberIfThereIsFailedTests(resultOutput);
|
||||
|
||||
for (final Map.Entry<String, String> entry : resultMap.entrySet()) {
|
||||
|
||||
suite.addTest(new TestCase("run") {
|
||||
@Override
|
||||
public String getName() {
|
||||
return entry.getKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void runTest() throws Throwable {
|
||||
Assert.fail(entry.getValue() + "See more information in log above.");
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new RuntimeException("Can't parse test results in " + reportFolder +"\n" + resultOutput);
|
||||
}
|
||||
|
||||
Assert.assertNotNull("Cannot parse number of failed tests from final line", statistics);
|
||||
Assert.assertEquals("Number of stackTraces != failed tests on the final line", resultMap.size(),
|
||||
statistics.failed + statistics.errors);
|
||||
|
||||
suite.addTest(new TestCase("run") {
|
||||
@Override
|
||||
public String getName() {
|
||||
return "testAll: Total: " + statistics.total + ", Failures: " + statistics.failed + ", Errors: " + statistics.errors;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void runTest() throws Throwable {
|
||||
Assert.assertTrue(true);
|
||||
}
|
||||
});
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Output example:
|
||||
[exec] Error in testKt344:
|
||||
[exec] java.lang.RuntimeException: File: compiler\testData\codegen\box\regressions\kt344.kt
|
||||
[exec] at org.jetbrains.kotlin.android.tests.AbstractCodegenTestCaseOnAndroid.invokeBoxMethod(AbstractCodegenTestCaseOnAndroid.java:38)
|
||||
[exec] at org.jetbrains.kotlin.android.tests.CodegenTestCaseOnAndroid.testKt344(CodegenTestCaseOnAndroid.java:595)
|
||||
[exec] at java.lang.reflect.Method.invokeNative(Native Method)
|
||||
[exec] at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
|
||||
[exec] Caused by: java.lang.reflect.InvocationTargetException
|
||||
[exec] at java.lang.reflect.Method.invokeNative(Native Method)
|
||||
[exec] at org.jetbrains.kotlin.android.tests.AbstractCodegenTestCaseOnAndroid.invokeBoxMethod(AbstractCodegenTestCaseOnAndroid.java:35)
|
||||
[exec] ... 13 more
|
||||
[exec] Caused by: java.lang.VerifyError: compiler_testData_codegen_box_regressions_kt344_kt.Compiler_testData_codegen_box_regressions_kt344_ktPackage$t6$foo$1
|
||||
[exec] at compiler_testData_codegen_box_regressions_kt344_kt.Compiler_testData_codegen_box_regressions_kt344_ktPackage.t6(dummy.kt:94)
|
||||
[exec] at compiler_testData_codegen_box_regressions_kt344_kt.Compiler_testData_codegen_box_regressions_kt344_ktPackage.box(dummy.kt:185)
|
||||
[exec] ... 16 more
|
||||
[exec] ...............
|
||||
[exec] Error in testKt529:
|
||||
*/
|
||||
private static Map<String, String> parseOutputForFailedTests(@NotNull String output) {
|
||||
Map<String, String> result = new HashMap<String, String>();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
String failedTestNamePrefix = " Error in ";
|
||||
String lastFailedTestName = "";
|
||||
Matcher matcher = ERROR_IN_TEST_OUTPUT_PATTERN.matcher(output);
|
||||
while (matcher.find()) {
|
||||
String groupValue = matcher.group();
|
||||
if (groupValue.startsWith(failedTestNamePrefix)) {
|
||||
if (builder.length() > 0) {
|
||||
result.put(lastFailedTestName, builder.toString());
|
||||
builder.delete(0, builder.length());
|
||||
}
|
||||
lastFailedTestName = groupValue.substring(failedTestNamePrefix.length());
|
||||
}
|
||||
builder.append(groupValue);
|
||||
builder.append("\n");
|
||||
}
|
||||
if (builder.length() > 0) {
|
||||
result.put(lastFailedTestName, builder.toString());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//[exec] Tests run: 225, Failures: 0, Errors: 2
|
||||
@Nullable
|
||||
private static Statistics parseOutputForTestsNumberIfThereIsFailedTests(String output) {
|
||||
Matcher matcher = NUMBER_OF_TESTS_IF_FAILED.matcher(output);
|
||||
if (matcher.find()) {
|
||||
return new Statistics(Integer.parseInt(matcher.group(1)), Integer.parseInt(matcher.group(2)),
|
||||
Integer.parseInt(matcher.group(3)));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
//[exec] OK (223 tests)
|
||||
@Nullable
|
||||
private static Statistics parseOutputForTestsNumberIfTestsPassed(String output) {
|
||||
Matcher matcher = NUMBER_OF_TESTS_OK.matcher(output);
|
||||
if (matcher.find()) {
|
||||
return new Statistics(Integer.parseInt(matcher.group(1)), 0, 0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
public String runTests() {
|
||||
File rootForAndroidDependencies = new File(pathManager.getDependenciesRoot());
|
||||
@@ -178,27 +79,27 @@ public class CodegenTestsOnAndroidRunner {
|
||||
}
|
||||
|
||||
SDKDownloader downloader = new SDKDownloader(pathManager);
|
||||
Emulator emulator = new Emulator(pathManager, Emulator.ARM);
|
||||
AntRunner antRunner = new AntRunner(pathManager);
|
||||
downloader.downloadAll();
|
||||
downloader.unzipAll();
|
||||
PermissionManager.setPermissions(pathManager);
|
||||
|
||||
AntRunner antRunner = new AntRunner(pathManager);
|
||||
antRunner.packLibraries();
|
||||
Emulator emulator = new Emulator(pathManager, Emulator.ARM);
|
||||
GradleRunner gradleRunner = new GradleRunner(pathManager);
|
||||
gradleRunner.clean();
|
||||
gradleRunner.build();
|
||||
|
||||
emulator.createEmulator();
|
||||
|
||||
String platformPrefixProperty = System.setProperty(PlatformUtils.PLATFORM_PREFIX_KEY, "Idea");
|
||||
|
||||
try {
|
||||
PermissionManager.setPermissions(pathManager);
|
||||
|
||||
antRunner.packLibraries();
|
||||
|
||||
emulator.createEmulator();
|
||||
emulator.startEmulator();
|
||||
|
||||
try {
|
||||
emulator.waitEmulatorStart();
|
||||
antRunner.cleanOutput();
|
||||
antRunner.compileSources();
|
||||
antRunner.installApplicationOnEmulator();
|
||||
return antRunner.runTestsOnEmulator();
|
||||
//runTestsViaAdb(emulator, gradleRunner);
|
||||
return gradleRunner.connectedDebugAndroidTest();
|
||||
}
|
||||
catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
@@ -223,15 +124,55 @@ public class CodegenTestsOnAndroidRunner {
|
||||
}
|
||||
}
|
||||
|
||||
private static class Statistics {
|
||||
public final int total;
|
||||
public final int errors;
|
||||
public final int failed;
|
||||
private String runTestsViaAdb(Emulator emulator, GradleRunner gradleRunner) {
|
||||
gradleRunner.installDebugAndroidTest();
|
||||
String result = emulator.runTestsViaAdb();
|
||||
System.out.println(result);
|
||||
gradleRunner.uninstallDebugAndroidTest();
|
||||
return result;
|
||||
}
|
||||
|
||||
private Statistics(int total, int failed, int errors) {
|
||||
this.total = total;
|
||||
this.failed = failed;
|
||||
this.errors = errors;
|
||||
private static List<TestCase> parseSingleReportInFolder(String reportFolder) throws
|
||||
IOException,
|
||||
SAXException,
|
||||
ParserConfigurationException {
|
||||
File folder = new File(reportFolder);
|
||||
File[] files = folder.listFiles();
|
||||
assert files != null;
|
||||
assert files.length == 1;
|
||||
File reportFile = files[0];
|
||||
|
||||
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
|
||||
Document doc = dBuilder.parse(reportFile);
|
||||
Element root = doc.getDocumentElement();
|
||||
NodeList testCases = root.getElementsByTagName("testcase");
|
||||
List<TestCase> result = new ArrayList(testCases.getLength());
|
||||
|
||||
for (int i = 0; i < testCases.getLength(); i++) {
|
||||
Element item = (Element) testCases.item(i);
|
||||
final NodeList failure = item.getElementsByTagName("failure");
|
||||
String name = item.getAttribute("name");
|
||||
String clazz = item.getAttribute("classname");
|
||||
|
||||
if (failure.getLength() == 0) {
|
||||
result.add(new TestCase(name) {
|
||||
@Override
|
||||
protected void runTest() throws Throwable {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
result.add(new TestCase(name) {
|
||||
@Override
|
||||
protected void runTest() throws Throwable {
|
||||
Assert.fail(failure.item(0).getTextContent());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,10 @@ public class PathManager {
|
||||
return rootFolder + "/android.tests.dependencies";
|
||||
}
|
||||
|
||||
public String getGradleBinFolder() {
|
||||
return getDependenciesRoot() + "/gradle-2.12/bin";
|
||||
}
|
||||
|
||||
public String getRootForDownload() {
|
||||
return getDependenciesRoot() + "/download";
|
||||
}
|
||||
|
||||
@@ -34,13 +34,15 @@ public class SDKDownloader {
|
||||
private final String platformToolsZipPath;
|
||||
private final String skdToolsZipPath;
|
||||
private final String buildToolsZipPath;
|
||||
private final String gradleZipPath;
|
||||
|
||||
private final PathManager pathManager;
|
||||
|
||||
private static final String PLATFORM_TOOLS = "23.1.0";
|
||||
//NOTE: PLATFORM_TOOLS 23.1.0 requires only 64 bit build agents
|
||||
private static final String PLATFORM_TOOLS = "23.0.1";
|
||||
private static final String SDK_TOOLS = "25.1.1";
|
||||
public static final String BUILD_TOOLS = "23.0.3";
|
||||
private static final int ANDROID_VERSION = 16;
|
||||
private static final int ANDROID_VERSION = 19;
|
||||
|
||||
|
||||
public SDKDownloader(PathManager pathManager) {
|
||||
@@ -51,27 +53,32 @@ public class SDKDownloader {
|
||||
platformToolsZipPath = pathManager.getRootForDownload() + "/platform-tools.zip";
|
||||
skdToolsZipPath = pathManager.getRootForDownload() + "/tools.zip";
|
||||
buildToolsZipPath = pathManager.getRootForDownload() + "/build-tools.zip";
|
||||
gradleZipPath = pathManager.getRootForDownload() + "/gradle.zip";
|
||||
}
|
||||
|
||||
public void downloadPlatform() {
|
||||
download("http://dl-ssl.google.com/android/repository/android-" + ANDROID_VERSION + "_r05.zip", platformZipPath); //Same for all platforms
|
||||
download("https://dl-ssl.google.com/android/repository/android-" + ANDROID_VERSION + "_r04.zip", platformZipPath); //Same for all platforms
|
||||
}
|
||||
|
||||
private void downloadAbi() {
|
||||
download("http://dl.google.com/android/repository/sys-img/android/sysimg_armv7a-" + ANDROID_VERSION + "_r04.zip", armImage); //Same for all platforms
|
||||
download("https://dl.google.com/android/repository/sys-img/android/sysimg_x86-" + ANDROID_VERSION + "_r02.zip", x86Image); //Same for all platforms
|
||||
download("https://dl.google.com/android/repository/sys-img/android/sysimg_armv7a-" + ANDROID_VERSION + "_r03.zip", armImage); //Same for all platforms
|
||||
download("https://dl.google.com/android/repository/sys-img/android/sysimg_x86-" + ANDROID_VERSION + "_r03.zip", x86Image); //Same for all platforms
|
||||
}
|
||||
|
||||
public void downloadPlatformTools() {
|
||||
download(getDownloadUrl("http://dl-ssl.google.com/android/repository/platform-tools_r" + PLATFORM_TOOLS), platformToolsZipPath);
|
||||
download(getDownloadUrl("https://dl-ssl.google.com/android/repository/platform-tools_r" + PLATFORM_TOOLS), platformToolsZipPath);
|
||||
}
|
||||
|
||||
public void downloadSdkTools() {
|
||||
download(getDownloadUrl("http://dl.google.com/android/repository/tools_r" + SDK_TOOLS), skdToolsZipPath);
|
||||
download(getDownloadUrl("https://dl.google.com/android/repository/tools_r" + SDK_TOOLS), skdToolsZipPath);
|
||||
}
|
||||
|
||||
public void downloadBuildTools() {
|
||||
download(getDownloadUrl("http://dl.google.com/android/repository/build-tools_r" + BUILD_TOOLS), buildToolsZipPath);
|
||||
download(getDownloadUrl("https://dl.google.com/android/repository/build-tools_r" + BUILD_TOOLS), buildToolsZipPath);
|
||||
}
|
||||
|
||||
public void downloadGradle() {
|
||||
download("https://services.gradle.org/distributions/gradle-2.12-bin.zip", gradleZipPath);
|
||||
}
|
||||
|
||||
private static String getDownloadUrl(String prefix) {
|
||||
@@ -97,17 +104,23 @@ public class SDKDownloader {
|
||||
downloadPlatform();
|
||||
downloadPlatformTools();
|
||||
downloadBuildTools();
|
||||
downloadGradle();
|
||||
}
|
||||
|
||||
|
||||
public void unzipAll() {
|
||||
String androidSdkRoot = pathManager.getAndroidSdkRoot();
|
||||
unzip(platformZipPath, pathManager.getPlatformFolderInAndroidSdk());
|
||||
unzip(armImage, androidSdkRoot + "/system-images/android-" + ANDROID_VERSION + "/");
|
||||
unzip(x86Image, androidSdkRoot + "/system-images/android-" + ANDROID_VERSION + "/");
|
||||
new File(pathManager.getPlatformFolderInAndroidSdk() + "/android-4.4.2").renameTo(new File(pathManager.getPlatformFolderInAndroidSdk() + "/android-" + ANDROID_VERSION));
|
||||
|
||||
unzip(armImage, androidSdkRoot + "/system-images/android-" + ANDROID_VERSION + "/default/");
|
||||
unzip(x86Image, androidSdkRoot + "/system-images/android-" + ANDROID_VERSION + "/default/");
|
||||
|
||||
unzip(platformToolsZipPath, androidSdkRoot);
|
||||
unzip(skdToolsZipPath, androidSdkRoot);
|
||||
|
||||
unzip(gradleZipPath, pathManager.getDependenciesRoot());
|
||||
|
||||
//BUILD TOOLS
|
||||
String buildTools = androidSdkRoot + "/build-tools/";
|
||||
String buildToolsFolder = buildTools + BUILD_TOOLS + "/";
|
||||
@@ -123,6 +136,7 @@ public class SDKDownloader {
|
||||
delete(buildToolsZipPath);
|
||||
delete(armImage);
|
||||
delete(x86Image);
|
||||
delete(gradleZipPath);
|
||||
}
|
||||
|
||||
private static void download(String urlString, String output) {
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.jetbrains.kotlin.android.tests.OutputUtils;
|
||||
import org.jetbrains.kotlin.android.tests.PathManager;
|
||||
import org.jetbrains.kotlin.android.tests.run.RunResult;
|
||||
import org.jetbrains.kotlin.android.tests.run.RunUtils;
|
||||
import org.junit.Assert;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
@@ -123,7 +124,7 @@ public class Emulator {
|
||||
GeneralCommandLine commandLine = createAdbCommand();
|
||||
commandLine.addParameter("start-server");
|
||||
System.out.println("Start adb server...");
|
||||
OutputUtils.checkResult(RunUtils.execute(commandLine));
|
||||
OutputUtils.checkResult(RunUtils.execute(new RunUtils.RunSettings(commandLine, null, true, "ADB START:", true)));
|
||||
}
|
||||
|
||||
public void startEmulator() {
|
||||
@@ -138,13 +139,38 @@ public class Emulator {
|
||||
commandLine.addParameter("logcat");
|
||||
commandLine.addParameter("-v");
|
||||
commandLine.addParameter("time");
|
||||
commandLine.addParameter("*:I");
|
||||
commandLine.addParameter("-s");
|
||||
commandLine.addParameter("dalvikvm:W");
|
||||
commandLine.addParameter("TestRunner:I");
|
||||
RunUtils.executeOnSeparateThread(new RunUtils.RunSettings(commandLine, null, false, "LOGCAT: ", true));
|
||||
}
|
||||
|
||||
public void waitEmulatorStart() {
|
||||
System.out.println("Waiting for emulator start...");
|
||||
OutputUtils.checkResult(RunUtils.execute(getWaitCommand()));
|
||||
GeneralCommandLine bootCheckCommand = createAdbCommand();
|
||||
bootCheckCommand.addParameter("shell");
|
||||
bootCheckCommand.addParameter("getprop");
|
||||
bootCheckCommand.addParameter("sys.boot_completed");
|
||||
int counter = 0;
|
||||
RunResult execute = RunUtils.execute(bootCheckCommand);
|
||||
while (counter < 12) {
|
||||
String output = execute.getOutput();
|
||||
if (output.trim().endsWith("1")) {
|
||||
System.out.println("Emulator fully booted!");
|
||||
return;
|
||||
}
|
||||
System.out.println("Waiting for emulator boot (" + counter + ")...");
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
counter++;
|
||||
execute = RunUtils.execute(bootCheckCommand);
|
||||
}
|
||||
Assert.fail("Can't find booted emulator: " + execute.getOutput());
|
||||
}
|
||||
|
||||
public void stopEmulator() {
|
||||
@@ -212,6 +238,15 @@ public class Emulator {
|
||||
}
|
||||
}
|
||||
|
||||
public String runTestsViaAdb() {
|
||||
System.out.println("Running tests via adb...");
|
||||
GeneralCommandLine adbCommand = createAdbCommand();
|
||||
//adb shell am instrument -w -r org.jetbrains.kotlin.android.tests/android.test.InstrumentationTestRunner
|
||||
adbCommand.addParameters("shell", "am", "instrument", "-w", "-r", "org.jetbrains.kotlin.android.tests/android.test.InstrumentationTestRunner");
|
||||
RunResult execute = RunUtils.execute(adbCommand);
|
||||
return execute.getOutput();
|
||||
}
|
||||
|
||||
private void stopRedundantEmulators(PathManager pathManager) {
|
||||
GeneralCommandLine commandLineForListOfDevices = createAdbCommand();
|
||||
commandLineForListOfDevices.addParameter("devices");
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.android.tests.gradle;
|
||||
|
||||
import com.intellij.execution.configurations.GeneralCommandLine;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import org.jetbrains.kotlin.android.tests.OutputUtils;
|
||||
import org.jetbrains.kotlin.android.tests.PathManager;
|
||||
import org.jetbrains.kotlin.android.tests.run.RunResult;
|
||||
import org.jetbrains.kotlin.android.tests.run.RunUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GradleRunner {
|
||||
private final List<String> listOfCommands;
|
||||
|
||||
public GradleRunner(PathManager pathManager) {
|
||||
listOfCommands = new ArrayList<String>();
|
||||
String cmdName = SystemInfo.isWindows ? "gradle.bat" : "gradle";
|
||||
listOfCommands.add(pathManager.getGradleBinFolder() + "/" + cmdName);
|
||||
listOfCommands.add("--build-file");
|
||||
listOfCommands.add(pathManager.getTmpFolder() + "/build.gradle");
|
||||
}
|
||||
|
||||
|
||||
public void clean() {
|
||||
System.out.println("Building gradle project...");
|
||||
RunResult result = RunUtils.execute(generateCommandLine("clean"));
|
||||
OutputUtils.checkResult(result);
|
||||
}
|
||||
|
||||
public void build() {
|
||||
System.out.println("Building gradle project...");
|
||||
RunResult result = RunUtils.execute(generateCommandLine("build"));
|
||||
OutputUtils.checkResult(result);
|
||||
}
|
||||
|
||||
public void installDebugAndroidTest() {
|
||||
System.out.println("Install tests...");
|
||||
OutputUtils.checkResult(RunUtils.execute(generateCommandLine("installDebug")));
|
||||
OutputUtils.checkResult(RunUtils.execute(generateCommandLine("installDebugAndroidTest")));
|
||||
}
|
||||
|
||||
public void uninstallDebugAndroidTest() {
|
||||
System.out.println("Uninstall tests...");
|
||||
RunUtils.execute(generateCommandLine("uninstallDebugAndroidTest"));
|
||||
RunUtils.execute(generateCommandLine("uninstallDebug"));
|
||||
}
|
||||
|
||||
public String connectedDebugAndroidTest() {
|
||||
System.out.println("Starting tests...");
|
||||
RunResult result = RunUtils.execute(generateCommandLine("connectedAndroidTest"));
|
||||
return result.getOutput();
|
||||
}
|
||||
|
||||
private GeneralCommandLine generateCommandLine(String taskName) {
|
||||
GeneralCommandLine commandLine = new GeneralCommandLine(listOfCommands);
|
||||
commandLine.addParameter(taskName);
|
||||
return commandLine;
|
||||
}
|
||||
}
|
||||
@@ -31,8 +31,10 @@ public class PermissionManager {
|
||||
if (!SystemInfo.isWindows) {
|
||||
RunUtils.execute(generateChmodCmd(pathManager.getAntBinDirectory() + "/ant"));
|
||||
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk()));
|
||||
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk() + "/bin64"));
|
||||
setExecPermissionForSimpleNamedFiles(new File(pathManager.getBuildToolsFolderInAndroidSdk() + "/" + SDKDownloader.BUILD_TOOLS));
|
||||
setExecPermissionForSimpleNamedFiles(new File(pathManager.getPlatformToolsFolderInAndroidSdk()));
|
||||
RunUtils.execute(generateChmodCmd(pathManager.getGradleBinFolder() + "/gradle"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ import junit.framework.TestSuite;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
public class AndroidRunner extends TestSuite {
|
||||
|
||||
@@ -42,12 +44,15 @@ public class AndroidRunner extends TestSuite {
|
||||
PathManager pathManager = getPathManager();
|
||||
|
||||
FileUtil.copyDir(new File(pathManager.getAndroidModuleRoot()), new File(pathManager.getTmpFolder()));
|
||||
|
||||
writeAndroidSkdToLocalProperties();
|
||||
|
||||
CodegenTestsOnAndroidGenerator.generate(pathManager);
|
||||
|
||||
System.out.println("Run tests on android...");
|
||||
TestSuite suite = CodegenTestsOnAndroidRunner.getTestSuite(pathManager);
|
||||
suite.addTest(new AndroidJpsBuildTestCase());
|
||||
//AndroidJpsBuildTestCase indirectly depends on UsefulTestCase which compiled against java 8
|
||||
//TODO: Need add separate run configuration for AndroidJpsBuildTestCase
|
||||
//suite.addTest(new AndroidJpsBuildTestCase());
|
||||
return suite;
|
||||
}
|
||||
|
||||
@@ -55,4 +60,15 @@ public class AndroidRunner extends TestSuite {
|
||||
// Clear tmp folder where we run android tests
|
||||
FileUtil.delete(new File(pathManager.getTmpFolder()));
|
||||
}
|
||||
|
||||
private static void writeAndroidSkdToLocalProperties() throws IOException {
|
||||
System.out.println("Writing android sdk to local.properties: " + pathManager.getAndroidSdkRoot());
|
||||
File file = new File(pathManager.getTmpFolder() + "/local.properties");
|
||||
FileWriter fw = new FileWriter(file);
|
||||
try {
|
||||
fw.write("sdk.dir=" + pathManager.getAndroidSdkRoot());
|
||||
} finally {
|
||||
fw.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.android.tests
|
||||
|
||||
import com.intellij.openapi.util.Ref
|
||||
import org.jetbrains.kotlin.codegen.CodegenTestCase
|
||||
import org.jetbrains.kotlin.load.kotlin.PackagePartClassUtils
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import java.io.File
|
||||
import java.util.regex.Pattern
|
||||
|
||||
private val FILE_NAME_ANNOTATIONS = arrayOf("@file:JvmName", "@file:kotlin.jvm.JvmName")
|
||||
|
||||
private val packagePattern = Pattern.compile("(?m)^\\s*package[ |\t]+([\\w|\\.]*)")
|
||||
|
||||
private val importPattern = Pattern.compile("import[ |\t]([\\w|]*\\.)")
|
||||
|
||||
internal fun genFiles(file: File, fileContent: String, filesHolder: CodegenTestsOnAndroidGenerator.FilesWriter): FqName? {
|
||||
val testFiles = createTestFiles(file, fileContent)
|
||||
if (testFiles.filter { it.name.endsWith(".java") }.isNotEmpty()) {
|
||||
//TODO support java files
|
||||
return null;
|
||||
}
|
||||
val ktFiles = testFiles.filter { it.name.endsWith(".kt") }
|
||||
if (ktFiles.isEmpty()) return null
|
||||
|
||||
val newPackagePrefix = file.path.replace("\\\\|-|\\.|/".toRegex(), "_")
|
||||
val oldPackage = Ref<FqName>()
|
||||
val isSingle = testFiles.size == 1
|
||||
val resultFiles = testFiles.map {
|
||||
val fileName = if (isSingle) it.name else file.name.substringBeforeLast(".kt") + "/" + it.name
|
||||
TestClassInfo(
|
||||
fileName,
|
||||
changePackage(newPackagePrefix, it.content, oldPackage),
|
||||
oldPackage.get(),
|
||||
getGeneratedClassName(File(fileName), it.content, newPackagePrefix, oldPackage.get())
|
||||
)
|
||||
}
|
||||
|
||||
/*replace all Class.forName*/
|
||||
resultFiles.forEach {
|
||||
file ->
|
||||
file.content = resultFiles.fold(file.content) { r, param ->
|
||||
patchClassForName(param.newClassId, param.oldPackage, r)
|
||||
}
|
||||
}
|
||||
|
||||
/*patch imports and self imports*/
|
||||
resultFiles.forEach {
|
||||
file ->
|
||||
file.content = resultFiles.fold(file.content) { r, param ->
|
||||
r.patchImports(param.oldPackage, param.newPackage)
|
||||
}.patchSelfImports(file.newPackage)
|
||||
}
|
||||
|
||||
resultFiles.forEach { resultFile -> filesHolder.addFile(resultFile.name, resultFile.content) }
|
||||
|
||||
val boxFiles = resultFiles.filter { hasBoxMethod(it.content) }
|
||||
if (boxFiles.size != 1) {
|
||||
println("Several box methods in $file")
|
||||
}
|
||||
return boxFiles.last().newClassId
|
||||
}
|
||||
|
||||
|
||||
private fun createTestFiles(file: File, expectedText: String): List<CodegenTestCase.TestFile> {
|
||||
val files = KotlinTestUtils.createTestFiles(file.name, expectedText, object : KotlinTestUtils.TestFileFactoryNoModules<CodegenTestCase.TestFile>() {
|
||||
override fun create(fileName: String, text: String, directives: Map<String, String>): CodegenTestCase.TestFile {
|
||||
return CodegenTestCase.TestFile(fileName, text)
|
||||
}
|
||||
})
|
||||
return files
|
||||
}
|
||||
|
||||
private fun hasBoxMethod(text: String): Boolean {
|
||||
return text.contains("fun box()")
|
||||
}
|
||||
|
||||
class TestClassInfo(val name: String, var content: String, val oldPackage: FqName, val newClassId: FqName) {
|
||||
val newPackage = newClassId.parent()
|
||||
}
|
||||
|
||||
|
||||
private fun changePackage(newPackagePrefix: String, text: String, oldPackage: Ref<FqName>): String {
|
||||
val matcher = packagePattern.matcher(text)
|
||||
if (matcher.find()) {
|
||||
val oldPackageName = matcher.toMatchResult().group(1)
|
||||
oldPackage.set(FqName(oldPackageName))
|
||||
return matcher.replaceAll("package $newPackagePrefix.$oldPackageName")
|
||||
}
|
||||
else {
|
||||
oldPackage.set(FqName.ROOT)
|
||||
val packageDirective = "package $newPackagePrefix;\n"
|
||||
if (text.contains("@file:")) {
|
||||
val index = text.lastIndexOf("@file:")
|
||||
val packageDirectiveIndex = text.indexOf("\n", index)
|
||||
return text.substring(0, packageDirectiveIndex + 1) + packageDirective + text.substring(packageDirectiveIndex + 1)
|
||||
}
|
||||
else {
|
||||
return packageDirective + text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getGeneratedClassName(file: File, text: String, newPackagePrefix: String, oldPackage: FqName): FqName {
|
||||
//TODO support multifile facades
|
||||
var packageFqName = FqName(newPackagePrefix)
|
||||
if (!oldPackage.isRoot) {
|
||||
packageFqName = packageFqName.child(Name.identifier(oldPackage.asString()))
|
||||
}
|
||||
for (annotation in FILE_NAME_ANNOTATIONS) {
|
||||
if (text.contains(annotation)) {
|
||||
val indexOf = text.indexOf(annotation)
|
||||
val annotationParameter = text.substring(text.indexOf("(\"", indexOf) + 2, text.indexOf("\")", indexOf))
|
||||
return packageFqName.child(Name.identifier(annotationParameter))
|
||||
}
|
||||
}
|
||||
|
||||
return PackagePartClassUtils.getPackagePartFqName(packageFqName, file.name)
|
||||
}
|
||||
|
||||
private fun patchClassForName(className: FqName, oldPackage: FqName, text: String): String {
|
||||
return text.replace(("Class\\.forName\\(\"" + oldPackage.child(className.shortName()).asString() + "\"\\)").toRegex(), "Class.forName(\"" + className.asString() + "\")")
|
||||
}
|
||||
|
||||
private fun String.patchImports(oldPackage: FqName, newPackage: FqName): String {
|
||||
if (oldPackage.isRoot) return this
|
||||
|
||||
return this.replace(("import\\s+" + oldPackage.asString()).toRegex(), "import " + newPackage.asString())
|
||||
}
|
||||
|
||||
|
||||
private fun String.patchSelfImports(newPackage: FqName): String {
|
||||
var newText = this;
|
||||
val matcher = importPattern.matcher(this)
|
||||
while (matcher.find()) {
|
||||
val possibleSelfImport = matcher.toMatchResult().group(1)
|
||||
val classOrObjectPattern = Pattern.compile("[\\s|^](class|object)\\s$possibleSelfImport[\\s|\\(|{|;|:]")
|
||||
if (classOrObjectPattern.matcher(newText).find()) {
|
||||
newText = newText.replace("import " + possibleSelfImport, "import " + newPackage.child(Name.identifier(possibleSelfImport)).asString())
|
||||
}
|
||||
}
|
||||
return newText
|
||||
}
|
||||
@@ -20,7 +20,6 @@ import com.google.common.collect.Lists;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.testFramework.UsefulTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.backend.common.output.OutputFileCollection;
|
||||
import org.jetbrains.kotlin.cli.common.output.outputUtils.OutputUtilsKt;
|
||||
@@ -29,13 +28,17 @@ import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment;
|
||||
import org.jetbrains.kotlin.codegen.CodegenTestFiles;
|
||||
import org.jetbrains.kotlin.codegen.GenerationUtils;
|
||||
import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime;
|
||||
import org.jetbrains.kotlin.config.CompilerConfiguration;
|
||||
import org.jetbrains.kotlin.config.JVMConfigurationKeys;
|
||||
import org.jetbrains.kotlin.idea.KotlinFileType;
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
import org.jetbrains.kotlin.psi.KtFile;
|
||||
import org.jetbrains.kotlin.test.ConfigurationKind;
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.TestJdkKind;
|
||||
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase;
|
||||
import org.jetbrains.kotlin.utils.Printer;
|
||||
import org.junit.Assert;
|
||||
|
||||
@@ -43,10 +46,8 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
|
||||
public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
|
||||
|
||||
private final PathManager pathManager;
|
||||
private static final String testClassPackage = "org.jetbrains.kotlin.android.tests";
|
||||
@@ -55,7 +56,7 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
|
||||
private static final String baseTestClassName = "AbstractCodegenTestCaseOnAndroid";
|
||||
private static final String generatorName = "CodegenTestsOnAndroidGenerator";
|
||||
|
||||
private final Pattern packagePattern = Pattern.compile("package (.*)");
|
||||
private static int MODULE_INDEX = 1;
|
||||
|
||||
private final List<String> generatedTestNames = Lists.newArrayList();
|
||||
|
||||
@@ -113,7 +114,7 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
|
||||
p.println("public class ", testClassName, " extends ", baseTestClassName, " {");
|
||||
p.pushIndent();
|
||||
|
||||
generateTestMethodsForDirectories(p, new File("compiler/testData/codegen/box"));
|
||||
generateTestMethodsForDirectories(p, new File("compiler/testData/codegen/box"), new File("compiler/testData/codegen/boxInline"));
|
||||
|
||||
p.popIndent();
|
||||
p.println("}");
|
||||
@@ -124,27 +125,31 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
|
||||
}
|
||||
|
||||
private void generateTestMethodsForDirectories(Printer p, File... dirs) throws IOException {
|
||||
FilesWriter holderMock = new FilesWriter(false);
|
||||
FilesWriter holderFull = new FilesWriter(true);
|
||||
FilesWriter holderMock = new FilesWriter(false, false);
|
||||
FilesWriter holderFull = new FilesWriter(true, false);
|
||||
FilesWriter holderInheritMFP = new FilesWriter(true, true);
|
||||
|
||||
for (File dir : dirs) {
|
||||
File[] files = dir.listFiles();
|
||||
Assert.assertNotNull("Folder with testData is empty: " + dir.getAbsolutePath(), files);
|
||||
processFiles(p, files, holderFull, holderMock);
|
||||
processFiles(p, files, holderFull, holderMock, holderInheritMFP);
|
||||
}
|
||||
|
||||
holderFull.writeFilesOnDisk();
|
||||
holderMock.writeFilesOnDisk();
|
||||
holderInheritMFP.writeFilesOnDisk();
|
||||
}
|
||||
|
||||
private class FilesWriter {
|
||||
class FilesWriter {
|
||||
private final boolean isFullJdkAndRuntime;
|
||||
private boolean inheritMultifileParts;
|
||||
|
||||
public List<KtFile> files = new ArrayList<KtFile>();
|
||||
private KotlinCoreEnvironment environment;
|
||||
|
||||
private FilesWriter(boolean isFullJdkAndRuntime) {
|
||||
private FilesWriter(boolean isFullJdkAndRuntime, boolean inheritMultifileParts) {
|
||||
this.isFullJdkAndRuntime = isFullJdkAndRuntime;
|
||||
this.inheritMultifileParts = inheritMultifileParts;
|
||||
environment = createEnvironment(isFullJdkAndRuntime);
|
||||
}
|
||||
|
||||
@@ -152,7 +157,7 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
|
||||
return isFullJdkAndRuntime ?
|
||||
KotlinTestUtils.createEnvironmentWithJdkAndNullabilityAnnotationsFromIdea(
|
||||
myTestRootDisposable, ConfigurationKind.ALL, TestJdkKind.FULL_JDK
|
||||
) :
|
||||
) :
|
||||
KotlinTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, ConfigurationKind.JDK_ONLY);
|
||||
}
|
||||
|
||||
@@ -172,18 +177,35 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
|
||||
environment = createEnvironment(isFullJdkAndRuntime);
|
||||
}
|
||||
|
||||
public void addFile(String name, String content) {
|
||||
try {
|
||||
files.add(CodegenTestFiles.create(name, content, environment.getProject()).getPsiFile());
|
||||
} catch (Throwable e) {
|
||||
new RuntimeException("Problem during creating file " + name + ": \n" + content, e);
|
||||
}
|
||||
}
|
||||
|
||||
private void writeFiles(List<KtFile> filesToCompile) {
|
||||
if (filesToCompile.isEmpty()) return;
|
||||
|
||||
System.out.println("Generating " + filesToCompile.size() + " files" + (isFullJdkAndRuntime
|
||||
? " (full jdk and runtime)" : "") + "...");
|
||||
System.out.println("Generating " + filesToCompile.size() + " files" +
|
||||
(inheritMultifileParts
|
||||
? " (JVM.INHERIT_MULTIFILE_PARTS)"
|
||||
: isFullJdkAndRuntime ? " (full jdk and runtime)" : "") + "...");
|
||||
OutputFileCollection outputFiles;
|
||||
try {
|
||||
//hack to pass module name
|
||||
CompilerConfiguration configuration = environment.getConfiguration().copy();
|
||||
configuration.put(JVMConfigurationKeys.MODULE_NAME, "android-module-" + MODULE_INDEX++);
|
||||
if (inheritMultifileParts) {
|
||||
configuration.put(JVMConfigurationKeys.INHERIT_MULTIFILE_PARTS, true);
|
||||
}
|
||||
configuration.setReadOnly(true);
|
||||
outputFiles = GenerationUtils.compileManyFilesGetGenerationStateForTest(
|
||||
filesToCompile.iterator().next().getProject(),
|
||||
filesToCompile,
|
||||
new JvmPackagePartProvider(environment),
|
||||
null
|
||||
configuration
|
||||
).getFactory();
|
||||
}
|
||||
catch (Throwable e) {
|
||||
@@ -204,11 +226,12 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
|
||||
@NotNull Printer printer,
|
||||
@NotNull File[] files,
|
||||
@NotNull FilesWriter holderFull,
|
||||
@NotNull FilesWriter holderMock)
|
||||
throws IOException
|
||||
{
|
||||
@NotNull FilesWriter holderMock,
|
||||
@NotNull FilesWriter holderInheritMFP
|
||||
) throws IOException {
|
||||
holderFull.writeFilesOnDiskIfNeeded();
|
||||
holderMock.writeFilesOnDiskIfNeeded();
|
||||
holderInheritMFP.writeFilesOnDiskIfNeeded();
|
||||
|
||||
for (File file : files) {
|
||||
if (SpecialFiles.getExcludedFiles().contains(file.getName())) {
|
||||
@@ -217,60 +240,44 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
|
||||
if (file.isDirectory()) {
|
||||
File[] listFiles = file.listFiles();
|
||||
if (listFiles != null) {
|
||||
processFiles(printer, listFiles, holderFull, holderMock);
|
||||
processFiles(printer, listFiles, holderFull, holderMock, holderInheritMFP);
|
||||
}
|
||||
}
|
||||
else if (!FileUtilRt.getExtension(file.getName()).equals(KotlinFileType.INSTANCE.getDefaultExtension())) {
|
||||
// skip non kotlin files
|
||||
}
|
||||
else {
|
||||
String text = FileUtil.loadFile(file, true);
|
||||
//TODO: support multifile tests
|
||||
if (text.contains("FILE:")) continue;
|
||||
//TODO: support JvmFileName annotation & WITH_REFLECT directive
|
||||
if (InTextDirectivesUtils.isDirectiveDefined(text, "WITH_REFLECT") || text.contains("JvmFileName")) continue;
|
||||
String fullFileText = FileUtil.loadFile(file, true);
|
||||
|
||||
//TODO: support multifile facades
|
||||
//TODO: support multifile facades hierarchies
|
||||
if (hasBoxMethod(fullFileText)) {
|
||||
FilesWriter filesHolder = InTextDirectivesUtils.isDirectiveDefined(fullFileText, "FULL_JDK") ||
|
||||
InTextDirectivesUtils.isDirectiveDefined(fullFileText, "WITH_RUNTIME") ||
|
||||
InTextDirectivesUtils.isDirectiveDefined(fullFileText, "WITH_REFLECT") ? holderFull : holderMock;
|
||||
filesHolder = fullFileText.contains("+JVM.INHERIT_MULTIFILE_PARTS") ? holderInheritMFP : filesHolder;
|
||||
|
||||
FqName classWithBoxMethod = AndroidTestGeneratorKt.genFiles(file, fullFileText, filesHolder);
|
||||
if (classWithBoxMethod == null)
|
||||
continue;
|
||||
|
||||
if (hasBoxMethod(text)) {
|
||||
String generatedTestName = generateTestName(file.getName());
|
||||
String packageName = file.getPath().replaceAll("\\\\|-|\\.|/", "_");
|
||||
text = changePackage(packageName, text);
|
||||
|
||||
FilesWriter filesHolder = InTextDirectivesUtils.isDirectiveDefined(text, "FULL_JDK") ||
|
||||
InTextDirectivesUtils.isDirectiveDefined(text, "WITH_RUNTIME") ? holderFull : holderMock;
|
||||
CodegenTestFiles codegenFile = CodegenTestFiles.create(file.getName(), text, filesHolder.environment.getProject());
|
||||
filesHolder.files.add(codegenFile.getPsiFile());
|
||||
|
||||
generateTestMethod(printer, generatedTestName, StringUtil.escapeStringCharacters(file.getPath()));
|
||||
generateTestMethod(printer, generatedTestName, classWithBoxMethod.asString(), StringUtil.escapeStringCharacters(file.getPath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static boolean hasBoxMethod(String text) {
|
||||
return text.contains("fun box()");
|
||||
}
|
||||
|
||||
private String changePackage(String testName, String text) {
|
||||
if (text.contains("package ")) {
|
||||
Matcher matcher = packagePattern.matcher(text);
|
||||
return matcher.replaceAll("package " + testName);
|
||||
}
|
||||
else {
|
||||
String packageDirective = "package " + testName + ";\n";
|
||||
if (text.contains("@file:")) {
|
||||
int index = text.lastIndexOf("@file:");
|
||||
int packageDirectiveIndex = text.indexOf("\n", index);
|
||||
return text.substring(0, packageDirectiveIndex + 1) + packageDirective + text.substring(packageDirectiveIndex + 1);
|
||||
} else {
|
||||
return packageDirective + text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void generateTestMethod(Printer p, String testName, String packageName) {
|
||||
private static void generateTestMethod(Printer p, String testName, String className, String filePath) {
|
||||
p.println("public void test" + testName + "() throws Exception {");
|
||||
p.pushIndent();
|
||||
p.println("invokeBoxMethod(\"" + packageName + "\", \"OK\");");
|
||||
p.println("invokeBoxMethod(" + className + ".class, \"" + filePath + "\", \"OK\");");
|
||||
p.popIndent();
|
||||
p.println("}");
|
||||
p.println();
|
||||
|
||||
@@ -36,45 +36,64 @@ public class SpecialFiles {
|
||||
private static void fillExcludedFiles() {
|
||||
excludedFiles.add("native"); // Reflection is used to check full class name
|
||||
|
||||
excludedFiles.add("reflection");
|
||||
excludedFiles.add("enclosing"); //reflection tests
|
||||
excludedFiles.add("noReflectAtRuntime"); //reflection tests
|
||||
excludedFiles.add("methodsFromAny"); //reflection tests
|
||||
|
||||
excludedFiles.add("kt3238.kt"); // Reflection
|
||||
excludedFiles.add("kt1482_2279.kt"); // Reflection
|
||||
excludedFiles.add("extensionMethod.kt"); // Reflection loadClass
|
||||
|
||||
excludedFiles.add("nestedInPackage.kt"); // Cannot change package name
|
||||
excludedFiles.add("importNestedClass.kt"); // Cannot change package name
|
||||
excludedFiles.add("packageQualifiedMethod.kt"); // Cannot change package name
|
||||
excludedFiles.add("classObjectToString.kt"); // Cannot change package name
|
||||
excludedFiles.add("invokeOnClassObjectOfNestedClass2.kt"); // Cannot change package name
|
||||
excludedFiles.add("invokeOnImportedEnum1.kt"); // Cannot change package name
|
||||
excludedFiles.add("invokeOnImportedEnum2.kt"); // Cannot change package name
|
||||
excludedFiles.add("sortEnumEntries.kt"); // Cannot change package name
|
||||
excludedFiles.add("assertionStackTrace.kt"); // Cannot change package name
|
||||
excludedFiles.add("anonymousObjectReifiedSupertype.kt"); // Cannot change package name
|
||||
excludedFiles.add("innerAnonymousObject.kt"); // Cannot change package name
|
||||
excludedFiles.add("nestedReifiedSignature.kt"); // Cannot change package name
|
||||
excludedFiles.add("recursiveInnerAnonymousObject.kt"); // Cannot change package name
|
||||
excludedFiles.add("approximateCapturedTypes.kt"); // Cannot change package name
|
||||
excludedFiles.add("classForEnumEntry.kt"); // Cannot change package name
|
||||
excludedFiles.add("kt10143.kt"); // Cannot change package name
|
||||
excludedFiles.add("internalTopLevelOtherPackage.kt"); // Cannot change package name
|
||||
excludedFiles.add("noPrivateDelegation.kt"); // Cannot change package name
|
||||
excludedFiles.add("platformTypeAssertionStackTrace.kt"); // Cannot change package name
|
||||
excludedFiles.add("packages.kt"); // Cannot change package name
|
||||
excludedFiles.add("kt10259.kt"); // Cannot change package name
|
||||
excludedFiles.add("kt11081.kt"); // Cannot change package name
|
||||
excludedFiles.add("kt6990.kt"); // Cannot change package name
|
||||
excludedFiles.add("mainInFiles.kt"); // Cannot change package name
|
||||
excludedFiles.add("noClassForSimpleEnum.kt"); // Cannot change package name
|
||||
excludedFiles.add("simpleClassLiteral.kt"); // Cannot change package name
|
||||
excludedFiles.add("jvmName.kt"); // Cannot change package name
|
||||
excludedFiles.add("qualifiedName.kt"); // Cannot change package name
|
||||
excludedFiles.add("topLevelProperty.kt"); // Cannot change package name
|
||||
excludedFiles.add("typeParameters.kt"); // Cannot change package name
|
||||
excludedFiles.add("kt13133.kt"); // Cannot change package name
|
||||
|
||||
excludedFiles.add("kt684.kt"); // StackOverflow with StringBuilder (escape())
|
||||
|
||||
excludedFiles.add("kt529.kt"); // Bug
|
||||
excludedFiles.add("kt344.kt"); // Bug
|
||||
|
||||
excludedFiles.add("comparisonWithNullCallsFun.kt"); // java.lang.NoClassDefFoundError: kotlin.Nothing
|
||||
excludedFiles.add("kt3574.kt"); // java.lang.NoClassDefFoundError: kotlin.Nothing
|
||||
|
||||
excludedFiles.add("genericBackingFieldSignature.kt"); // Wrong signature after package renaming
|
||||
excludedFiles.add("genericMethodSignature.kt"); // Wrong signature after package renaming
|
||||
excludedFiles.add("kt11121.kt"); // Wrong signature after package renaming
|
||||
excludedFiles.add("kt5112.kt"); // Wrong signature after package renaming
|
||||
|
||||
excludedFiles.add("classpath.kt"); // Some classes are not visible on android
|
||||
|
||||
excludedFiles.add("manyNumbers.kt"); // Out of memory
|
||||
|
||||
excludedFiles.add("smap"); // Line numbers
|
||||
excludedFiles.add("external"); //native methods
|
||||
|
||||
// TODO: fix import processing
|
||||
excludedFiles.add("useImportedMemberFromCompanion.kt");
|
||||
excludedFiles.add("useImportedMember.kt");
|
||||
excludedFiles.add("importStaticMemberFromObject.kt");
|
||||
excludedFiles.add("enclosingInfo"); // Wrong enclosing info after package renaming
|
||||
excludedFiles.add("signature"); // Wrong signature after package renaming
|
||||
|
||||
excludedFiles.add("functionNtoStringNoReflect.kt"); // disabled cause test executed with reflection
|
||||
|
||||
excludedFiles.add("nestedClasses.kt"); // additional nested class in 'Thread' class on Android
|
||||
excludedFiles.add("kt12200Const.kt"); // no 'modifiers' field in 'java.lang.reflect.Field' class
|
||||
|
||||
excludedFiles.add("closureOfInnerLocalClass.kt"); // KT-8120
|
||||
excludedFiles.add("closureWithSelfInstantiation.kt"); // KT-8120
|
||||
}
|
||||
|
||||
private SpecialFiles() {
|
||||
|
||||
@@ -1,196 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.common;
|
||||
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.backend.common.bridges.ImplKt;
|
||||
import org.jetbrains.kotlin.descriptors.*;
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation;
|
||||
import org.jetbrains.kotlin.name.Name;
|
||||
import org.jetbrains.kotlin.psi.*;
|
||||
import org.jetbrains.kotlin.resolve.BindingContext;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||
import org.jetbrains.kotlin.resolve.calls.callResolverUtil.CallResolverUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.CallUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall;
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
import org.jetbrains.kotlin.types.TypeUtils;
|
||||
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class CodegenUtil {
|
||||
|
||||
private CodegenUtil() {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static FunctionDescriptor getDeclaredFunctionByRawSignature(
|
||||
@NotNull ClassDescriptor owner,
|
||||
@NotNull Name name,
|
||||
@NotNull ClassifierDescriptor returnedClassifier,
|
||||
@NotNull ClassifierDescriptor... valueParameterClassifiers
|
||||
) {
|
||||
Collection<SimpleFunctionDescriptor> functions = owner.getDefaultType().getMemberScope().getContributedFunctions(name, NoLookupLocation.FROM_BACKEND);
|
||||
for (FunctionDescriptor function : functions) {
|
||||
if (!CallResolverUtilKt.isOrOverridesSynthesized(function)
|
||||
&& function.getTypeParameters().isEmpty()
|
||||
&& valueParameterClassesMatch(function.getValueParameters(), Arrays.asList(valueParameterClassifiers))
|
||||
&& rawTypeMatches(function.getReturnType(), returnedClassifier)) {
|
||||
return function;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static PropertyDescriptor getDelegatePropertyIfAny(KtExpression expression, ClassDescriptor classDescriptor, BindingContext bindingContext) {
|
||||
PropertyDescriptor propertyDescriptor = null;
|
||||
if (expression instanceof KtSimpleNameExpression) {
|
||||
ResolvedCall<?> call = CallUtilKt.getResolvedCall(expression, bindingContext);
|
||||
if (call != null) {
|
||||
CallableDescriptor callResultingDescriptor = call.getResultingDescriptor();
|
||||
if (callResultingDescriptor instanceof ValueParameterDescriptor) {
|
||||
ValueParameterDescriptor valueParameterDescriptor = (ValueParameterDescriptor) callResultingDescriptor;
|
||||
// constructor parameter
|
||||
if (valueParameterDescriptor.getContainingDeclaration() instanceof ConstructorDescriptor) {
|
||||
// constructor of my class
|
||||
if (valueParameterDescriptor.getContainingDeclaration().getContainingDeclaration() == classDescriptor) {
|
||||
propertyDescriptor = bindingContext.get(BindingContext.VALUE_PARAMETER_AS_PROPERTY, valueParameterDescriptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// todo: when and if frontend will allow properties defined not as constructor parameters to be used in delegation specifier
|
||||
}
|
||||
}
|
||||
return propertyDescriptor;
|
||||
}
|
||||
|
||||
public static boolean isFinalPropertyWithBackingField(PropertyDescriptor propertyDescriptor, BindingContext bindingContext) {
|
||||
return propertyDescriptor != null &&
|
||||
!propertyDescriptor.isVar() &&
|
||||
Boolean.TRUE.equals(bindingContext.get(BindingContext.BACKING_FIELD_REQUIRED, propertyDescriptor));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Map<FunctionDescriptor, FunctionDescriptor> getNonPrivateTraitMethods(ClassDescriptor descriptor) {
|
||||
Map<FunctionDescriptor, FunctionDescriptor> result = new LinkedHashMap<FunctionDescriptor, FunctionDescriptor>();
|
||||
for (DeclarationDescriptor declaration : DescriptorUtils.getAllDescriptors(descriptor.getDefaultType().getMemberScope())) {
|
||||
if (!(declaration instanceof CallableMemberDescriptor)) continue;
|
||||
|
||||
CallableMemberDescriptor inheritedMember = (CallableMemberDescriptor) declaration;
|
||||
CallableMemberDescriptor traitMember = ImplKt.findTraitImplementation(inheritedMember);
|
||||
if (traitMember == null || Visibilities.isPrivate(traitMember.getVisibility())) continue;
|
||||
|
||||
assert traitMember.getModality() != Modality.ABSTRACT : "Cannot delegate to abstract trait method: " + inheritedMember;
|
||||
|
||||
// inheritedMember can be abstract here. In order for FunctionCodegen to generate the method body, we're creating a copy here
|
||||
// with traitMember's modality
|
||||
result.putAll(copyFunctions(inheritedMember, traitMember, inheritedMember.getContainingDeclaration(), traitMember.getModality(), Visibilities.PUBLIC,
|
||||
CallableMemberDescriptor.Kind.DECLARATION, true));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Map<FunctionDescriptor, FunctionDescriptor> copyFunctions(
|
||||
@NotNull CallableMemberDescriptor inheritedMember,
|
||||
@NotNull CallableMemberDescriptor traitMember,
|
||||
DeclarationDescriptor newOwner,
|
||||
Modality modality,
|
||||
Visibility visibility,
|
||||
CallableMemberDescriptor.Kind kind,
|
||||
boolean copyOverrides
|
||||
) {
|
||||
CallableMemberDescriptor copy = inheritedMember.copy(newOwner, modality, visibility, kind, copyOverrides);
|
||||
Map<FunctionDescriptor, FunctionDescriptor> result = new LinkedHashMap<FunctionDescriptor, FunctionDescriptor>(0);
|
||||
if (traitMember instanceof SimpleFunctionDescriptor) {
|
||||
result.put((FunctionDescriptor) traitMember, (FunctionDescriptor) copy);
|
||||
}
|
||||
else if (traitMember instanceof PropertyDescriptor) {
|
||||
for (PropertyAccessorDescriptor traitAccessor : ((PropertyDescriptor) traitMember).getAccessors()) {
|
||||
for (PropertyAccessorDescriptor inheritedAccessor : ((PropertyDescriptor) copy).getAccessors()) {
|
||||
if (inheritedAccessor.getClass() == traitAccessor.getClass()) { // same accessor kind
|
||||
result.put(traitAccessor, inheritedAccessor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static ClassDescriptor getSuperClassBySuperTypeListEntry(@NotNull KtSuperTypeListEntry specifier, @NotNull BindingContext bindingContext) {
|
||||
KotlinType superType = bindingContext.get(BindingContext.TYPE, specifier.getTypeReference());
|
||||
assert superType != null : "superType should not be null: " + specifier.getText();
|
||||
|
||||
ClassDescriptor superClassDescriptor = (ClassDescriptor) superType.getConstructor().getDeclarationDescriptor();
|
||||
assert superClassDescriptor != null : "superClassDescriptor should not be null: " + specifier.getText();
|
||||
return superClassDescriptor;
|
||||
}
|
||||
|
||||
private static boolean valueParameterClassesMatch(
|
||||
@NotNull List<ValueParameterDescriptor> parameters,
|
||||
@NotNull List<ClassifierDescriptor> classifiers
|
||||
) {
|
||||
if (parameters.size() != classifiers.size()) return false;
|
||||
for (int i = 0; i < parameters.size(); i++) {
|
||||
ValueParameterDescriptor parameterDescriptor = parameters.get(i);
|
||||
ClassifierDescriptor classDescriptor = classifiers.get(i);
|
||||
if (!rawTypeMatches(parameterDescriptor.getType(), classDescriptor)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean rawTypeMatches(KotlinType type, ClassifierDescriptor classifier) {
|
||||
return type.getConstructor().equals(classifier.getTypeConstructor());
|
||||
}
|
||||
|
||||
public static boolean isEnumValueOfMethod(@NotNull FunctionDescriptor functionDescriptor) {
|
||||
List<ValueParameterDescriptor> methodTypeParameters = functionDescriptor.getValueParameters();
|
||||
KotlinType nullableString = TypeUtils.makeNullable(DescriptorUtilsKt.getBuiltIns(functionDescriptor).getStringType());
|
||||
return DescriptorUtils.ENUM_VALUE_OF.equals(functionDescriptor.getName())
|
||||
&& methodTypeParameters.size() == 1
|
||||
&& KotlinTypeChecker.DEFAULT.isSubtypeOf(methodTypeParameters.get(0).getType(), nullableString);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Integer getLineNumberForElement(@NotNull PsiElement statement, boolean markEndOffset) {
|
||||
PsiFile file = statement.getContainingFile();
|
||||
if (file instanceof KtFile) {
|
||||
if (KtPsiFactoryKt.getDoNotAnalyze((KtFile) file) != null) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (statement instanceof KtConstructorDelegationReferenceExpression && statement.getTextLength() == 0) {
|
||||
// PsiElement for constructor delegation reference is always generated, so we shouldn't mark it's line number if it's empty
|
||||
return null;
|
||||
}
|
||||
|
||||
Document document = file.getViewProvider().getDocument();
|
||||
return document != null ? document.getLineNumber(markEndOffset ? statement.getTextRange().getEndOffset() : statement.getTextOffset()) + 1 : null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.common
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.backend.common.bridges.findTraitImplementation
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.MemberComparator
|
||||
import org.jetbrains.kotlin.resolve.calls.callResolverUtil.isOrOverridesSynthesized
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.TypeUtils
|
||||
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker
|
||||
import org.jetbrains.kotlin.types.isDynamic
|
||||
import org.jetbrains.kotlin.utils.keysToMapExceptNulls
|
||||
|
||||
object CodegenUtil {
|
||||
// class Foo : Bar by baz
|
||||
// descriptor = Foo
|
||||
// toInterface = Bar
|
||||
// delegateExpressionType = typeof(baz)
|
||||
// return Map<member of Foo, corresponding member of typeOf(baz)>
|
||||
@JvmStatic
|
||||
fun getDelegates(
|
||||
descriptor: ClassDescriptor,
|
||||
toInterface: ClassDescriptor,
|
||||
delegateExpressionType: KotlinType? = null
|
||||
): Map<CallableMemberDescriptor, CallableDescriptor> {
|
||||
if (delegateExpressionType?.isDynamic() ?: false) return emptyMap()
|
||||
|
||||
return descriptor.defaultType.memberScope.getContributedDescriptors().asSequence()
|
||||
.filterIsInstance<CallableMemberDescriptor>()
|
||||
.filter { it.kind == CallableMemberDescriptor.Kind.DELEGATION }
|
||||
.asIterable()
|
||||
.sortedWith(MemberComparator.INSTANCE)
|
||||
.keysToMapExceptNulls { delegatingMember ->
|
||||
val actualDelegates = DescriptorUtils.getAllOverriddenDescriptors(delegatingMember)
|
||||
.mapNotNull { overriddenDescriptor ->
|
||||
if (overriddenDescriptor.containingDeclaration == toInterface) {
|
||||
val scope = (delegateExpressionType ?: toInterface.defaultType).memberScope
|
||||
val name = overriddenDescriptor.name
|
||||
|
||||
// this is the actual member of delegateExpressionType that we are delegating to
|
||||
(scope.getContributedFunctions(name, NoLookupLocation.FROM_BACKEND) +
|
||||
scope.getContributedVariables(name, NoLookupLocation.FROM_BACKEND))
|
||||
.firstOrNull {
|
||||
(listOf(it) + DescriptorUtils.getAllOverriddenDescriptors(it))
|
||||
.map(CallableMemberDescriptor::getOriginal)
|
||||
.contains(overriddenDescriptor.original)
|
||||
}
|
||||
}
|
||||
else null
|
||||
}
|
||||
|
||||
assert(actualDelegates.size <= 1) { "Many delegates found for $delegatingMember: $actualDelegates" }
|
||||
|
||||
actualDelegates.firstOrNull()
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getDeclaredFunctionByRawSignature(
|
||||
owner: ClassDescriptor,
|
||||
name: Name,
|
||||
returnedClassifier: ClassifierDescriptor,
|
||||
vararg valueParameterClassifiers: ClassifierDescriptor
|
||||
): FunctionDescriptor? {
|
||||
return owner.defaultType.memberScope.getContributedFunctions(name, NoLookupLocation.FROM_BACKEND).firstOrNull { function ->
|
||||
!isOrOverridesSynthesized(function) &&
|
||||
function.typeParameters.isEmpty() &&
|
||||
valueParameterClassesMatch(function.valueParameters, valueParameterClassifiers.toList()) &&
|
||||
rawTypeMatches(function.returnType!!, returnedClassifier)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getDelegatePropertyIfAny(
|
||||
expression: KtExpression, classDescriptor: ClassDescriptor, bindingContext: BindingContext
|
||||
): PropertyDescriptor? {
|
||||
val call = (expression as? KtSimpleNameExpression)?.getResolvedCall(bindingContext) ?: return null
|
||||
val callResultingDescriptor = call.resultingDescriptor as? ValueParameterDescriptor ?: return null
|
||||
// constructor parameter
|
||||
if (callResultingDescriptor.containingDeclaration is ConstructorDescriptor) {
|
||||
// constructor of my class
|
||||
if (callResultingDescriptor.containingDeclaration.containingDeclaration === classDescriptor) {
|
||||
return bindingContext.get(BindingContext.VALUE_PARAMETER_AS_PROPERTY, callResultingDescriptor)
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun isFinalPropertyWithBackingField(propertyDescriptor: PropertyDescriptor?, bindingContext: BindingContext): Boolean {
|
||||
return propertyDescriptor != null &&
|
||||
!propertyDescriptor.isVar &&
|
||||
(bindingContext.get(BindingContext.BACKING_FIELD_REQUIRED, propertyDescriptor) ?: false)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getNonPrivateTraitMethods(descriptor: ClassDescriptor): Map<FunctionDescriptor, FunctionDescriptor> {
|
||||
val result = linkedMapOf<FunctionDescriptor, FunctionDescriptor>()
|
||||
for (declaration in DescriptorUtils.getAllDescriptors(descriptor.defaultType.memberScope)) {
|
||||
if (declaration !is CallableMemberDescriptor) continue
|
||||
|
||||
val traitMember = findTraitImplementation(declaration)
|
||||
if (traitMember == null || Visibilities.isPrivate(traitMember.visibility)) continue
|
||||
|
||||
assert(traitMember.modality !== Modality.ABSTRACT) { "Cannot delegate to abstract trait method: $declaration" }
|
||||
|
||||
// inheritedMember can be abstract here. In order for FunctionCodegen to generate the method body, we're creating a copy here
|
||||
// with traitMember's modality
|
||||
result.putAll(copyFunctions(declaration, traitMember, declaration.containingDeclaration, traitMember.modality,
|
||||
Visibilities.PUBLIC, CallableMemberDescriptor.Kind.DECLARATION, true))
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
fun copyFunctions(
|
||||
inheritedMember: CallableMemberDescriptor,
|
||||
traitMember: CallableMemberDescriptor,
|
||||
newOwner: DeclarationDescriptor,
|
||||
modality: Modality,
|
||||
visibility: Visibility,
|
||||
kind: CallableMemberDescriptor.Kind,
|
||||
copyOverrides: Boolean
|
||||
): Map<FunctionDescriptor, FunctionDescriptor> {
|
||||
val copy = inheritedMember.copy(newOwner, modality, visibility, kind, copyOverrides)
|
||||
val result = linkedMapOf<FunctionDescriptor, FunctionDescriptor>()
|
||||
if (traitMember is SimpleFunctionDescriptor) {
|
||||
result[traitMember] = copy as FunctionDescriptor
|
||||
}
|
||||
else if (traitMember is PropertyDescriptor) {
|
||||
for (traitAccessor in traitMember.accessors) {
|
||||
for (inheritedAccessor in (copy as PropertyDescriptor).accessors) {
|
||||
if (inheritedAccessor.javaClass == traitAccessor.javaClass) { // same accessor kind
|
||||
result.put(traitAccessor, inheritedAccessor)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getSuperClassBySuperTypeListEntry(specifier: KtSuperTypeListEntry, bindingContext: BindingContext): ClassDescriptor {
|
||||
val superType = bindingContext.get(BindingContext.TYPE, specifier.typeReference!!)
|
||||
?: error("superType should not be null: ${specifier.text}")
|
||||
|
||||
return superType.constructor.declarationDescriptor as? ClassDescriptor
|
||||
?: error("ClassDescriptor of superType should not be null: ${specifier.text}")
|
||||
}
|
||||
|
||||
private fun valueParameterClassesMatch(
|
||||
parameters: List<ValueParameterDescriptor>,
|
||||
classifiers: List<ClassifierDescriptor>
|
||||
): Boolean {
|
||||
if (parameters.size != classifiers.size) return false
|
||||
for ((parameterDescriptor, classDescriptor) in parameters.zip(classifiers)) {
|
||||
if (!rawTypeMatches(parameterDescriptor.type, classDescriptor)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private fun rawTypeMatches(type: KotlinType, classifier: ClassifierDescriptor): Boolean =
|
||||
type.constructor == classifier.typeConstructor
|
||||
|
||||
@JvmStatic
|
||||
fun isEnumValueOfMethod(functionDescriptor: FunctionDescriptor): Boolean {
|
||||
val methodTypeParameters = functionDescriptor.valueParameters
|
||||
val nullableString = TypeUtils.makeNullable(functionDescriptor.builtIns.stringType)
|
||||
return DescriptorUtils.ENUM_VALUE_OF == functionDescriptor.name
|
||||
&& methodTypeParameters.size == 1
|
||||
&& KotlinTypeChecker.DEFAULT.isSubtypeOf(methodTypeParameters[0].type, nullableString)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getLineNumberForElement(statement: PsiElement, markEndOffset: Boolean): Int? {
|
||||
val file = statement.containingFile
|
||||
if (file is KtFile && file.doNotAnalyze != null) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (statement is KtConstructorDelegationReferenceExpression && statement.textLength == 0) {
|
||||
// PsiElement for constructor delegation reference is always generated, so we shouldn't mark it's line number if it's empty
|
||||
return null
|
||||
}
|
||||
|
||||
val document = file.viewProvider.document
|
||||
return document?.getLineNumber(if (markEndOffset) statement.textRange.endOffset else statement.textOffset)?.plus(1)
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.common
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.MemberComparator
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.isDynamic
|
||||
import org.jetbrains.kotlin.utils.keysToMapExceptNulls
|
||||
import java.util.Comparator
|
||||
|
||||
object CodegenUtilKt {
|
||||
|
||||
// class Foo : Bar by baz
|
||||
// descriptor = Foo
|
||||
// toInterface = Bar
|
||||
// delegateExpressionType = typeof(baz)
|
||||
// return Map<member of Foo, corresponding member of typeOf(baz)>
|
||||
@JvmStatic fun getDelegates(
|
||||
descriptor: ClassDescriptor,
|
||||
toInterface: ClassDescriptor,
|
||||
delegateExpressionType: KotlinType? = null
|
||||
): Map<CallableMemberDescriptor, CallableDescriptor> {
|
||||
if (delegateExpressionType?.isDynamic() ?: false) return mapOf();
|
||||
|
||||
return descriptor.defaultType.memberScope.getContributedDescriptors().asSequence()
|
||||
.filterIsInstance<CallableMemberDescriptor>()
|
||||
.filter { it.kind == CallableMemberDescriptor.Kind.DELEGATION }
|
||||
.asIterable()
|
||||
.sortedWith(MemberComparator.INSTANCE)
|
||||
.keysToMapExceptNulls {
|
||||
delegatingMember ->
|
||||
|
||||
val actualDelegates = DescriptorUtils.getAllOverriddenDescriptors(delegatingMember)
|
||||
.mapNotNull {
|
||||
overriddenDescriptor ->
|
||||
if (overriddenDescriptor.containingDeclaration == toInterface) {
|
||||
val scope = (delegateExpressionType ?: toInterface.defaultType).memberScope
|
||||
val name = overriddenDescriptor.name
|
||||
|
||||
// this is the actual member of delegateExpressionType that we are delegating to
|
||||
(scope.getContributedFunctions(name, NoLookupLocation.FROM_BACKEND) + scope.getContributedVariables(name, NoLookupLocation.FROM_BACKEND))
|
||||
.firstOrNull {
|
||||
(listOf(it) + DescriptorUtils.getAllOverriddenDescriptors(it))
|
||||
.map { it.original }
|
||||
.contains(overriddenDescriptor.original)
|
||||
}
|
||||
}
|
||||
else null
|
||||
}
|
||||
assert(actualDelegates.size <= 1) { "Many delegates found for $delegatingMember: $actualDelegates" }
|
||||
|
||||
actualDelegates.firstOrNull()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,171 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.common;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
|
||||
import org.jetbrains.kotlin.descriptors.*;
|
||||
import org.jetbrains.kotlin.name.Name;
|
||||
import org.jetbrains.kotlin.psi.KtClass;
|
||||
import org.jetbrains.kotlin.psi.KtClassOrObject;
|
||||
import org.jetbrains.kotlin.psi.KtParameter;
|
||||
import org.jetbrains.kotlin.resolve.BindingContext;
|
||||
import org.jetbrains.kotlin.resolve.BindingContextUtils;
|
||||
import org.jetbrains.kotlin.resolve.OverrideResolver;
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A platform-independent logic for generating data class synthetic methods.
|
||||
* TODO: data class with zero components gets no toString/equals/hashCode methods. This is inconsistent and should be
|
||||
* changed here with the platform backends adopted.
|
||||
*/
|
||||
public abstract class DataClassMethodGenerator {
|
||||
private final KtClassOrObject declaration;
|
||||
private final BindingContext bindingContext;
|
||||
private final ClassDescriptor classDescriptor;
|
||||
private final KotlinBuiltIns builtIns;
|
||||
|
||||
public DataClassMethodGenerator(KtClassOrObject declaration, BindingContext bindingContext) {
|
||||
this.declaration = declaration;
|
||||
this.bindingContext = bindingContext;
|
||||
this.classDescriptor = BindingContextUtils.getNotNull(bindingContext, BindingContext.CLASS, declaration);
|
||||
this.builtIns = DescriptorUtilsKt.getBuiltIns(classDescriptor);
|
||||
}
|
||||
|
||||
public void generate() {
|
||||
generateComponentFunctionsForDataClasses();
|
||||
|
||||
generateCopyFunctionForDataClasses(getPrimaryConstructorParameters());
|
||||
|
||||
List<PropertyDescriptor> properties = getDataProperties();
|
||||
if (!properties.isEmpty()) {
|
||||
generateDataClassToStringIfNeeded(properties);
|
||||
generateDataClassHashCodeIfNeeded(properties);
|
||||
generateDataClassEqualsIfNeeded(properties);
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void generateComponentFunction(@NotNull FunctionDescriptor function, @NotNull ValueParameterDescriptor parameter);
|
||||
|
||||
protected abstract void generateCopyFunction(@NotNull FunctionDescriptor function, @NotNull List<KtParameter> constructorParameters);
|
||||
|
||||
protected abstract void generateToStringMethod(@NotNull FunctionDescriptor function, @NotNull List<PropertyDescriptor> properties);
|
||||
|
||||
protected abstract void generateHashCodeMethod(@NotNull FunctionDescriptor function, @NotNull List<PropertyDescriptor> properties);
|
||||
|
||||
protected abstract void generateEqualsMethod(@NotNull FunctionDescriptor function, @NotNull List<PropertyDescriptor> properties);
|
||||
|
||||
@NotNull
|
||||
protected ClassDescriptor getClassDescriptor() {
|
||||
return classDescriptor;
|
||||
}
|
||||
|
||||
private void generateComponentFunctionsForDataClasses() {
|
||||
ConstructorDescriptor constructor = classDescriptor.getUnsubstitutedPrimaryConstructor();
|
||||
// primary constructor should exist for data classes
|
||||
// but when generating light-classes still need to check we have one
|
||||
if (constructor == null) return;
|
||||
|
||||
for (ValueParameterDescriptor parameter : constructor.getValueParameters()) {
|
||||
FunctionDescriptor function = bindingContext.get(BindingContext.DATA_CLASS_COMPONENT_FUNCTION, parameter);
|
||||
if (function != null) {
|
||||
generateComponentFunction(function, parameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void generateCopyFunctionForDataClasses(List<KtParameter> constructorParameters) {
|
||||
FunctionDescriptor copyFunction = bindingContext.get(BindingContext.DATA_CLASS_COPY_FUNCTION, classDescriptor);
|
||||
if (copyFunction != null) {
|
||||
generateCopyFunction(copyFunction, constructorParameters);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateDataClassToStringIfNeeded(@NotNull List<PropertyDescriptor> properties) {
|
||||
FunctionDescriptor function = getDeclaredMember("toString", builtIns.getString());
|
||||
if (function != null && isTrivial(function)) {
|
||||
generateToStringMethod(function, properties);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateDataClassHashCodeIfNeeded(@NotNull List<PropertyDescriptor> properties) {
|
||||
FunctionDescriptor function = getDeclaredMember("hashCode", builtIns.getInt());
|
||||
if (function != null && isTrivial(function)) {
|
||||
generateHashCodeMethod(function, properties);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateDataClassEqualsIfNeeded(@NotNull List<PropertyDescriptor> properties) {
|
||||
FunctionDescriptor function = getDeclaredMember("equals", builtIns.getBoolean(), builtIns.getAny());
|
||||
if (function != null && isTrivial(function)) {
|
||||
generateEqualsMethod(function, properties);
|
||||
}
|
||||
}
|
||||
|
||||
private List<PropertyDescriptor> getDataProperties() {
|
||||
List<PropertyDescriptor> result = Lists.newArrayList();
|
||||
for (KtParameter parameter : getPrimaryConstructorParameters()) {
|
||||
if (parameter.hasValOrVar()) {
|
||||
result.add(bindingContext.get(BindingContext.PRIMARY_CONSTRUCTOR_PARAMETER, parameter));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<KtParameter> getPrimaryConstructorParameters() {
|
||||
if (declaration instanceof KtClass) {
|
||||
return declaration.getPrimaryConstructorParameters();
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private FunctionDescriptor getDeclaredMember(
|
||||
@NotNull String name,
|
||||
@NotNull ClassDescriptor returnedClassifier,
|
||||
@NotNull ClassDescriptor... valueParameterClassifiers
|
||||
) {
|
||||
return CodegenUtil.getDeclaredFunctionByRawSignature(
|
||||
classDescriptor, Name.identifier(name), returnedClassifier, valueParameterClassifiers
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if the member is an inherited implementation of a method from Any
|
||||
*/
|
||||
private boolean isTrivial(@NotNull FunctionDescriptor function) {
|
||||
if (function.getKind() == CallableMemberDescriptor.Kind.DECLARATION) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (CallableDescriptor overridden : OverrideResolver.getOverriddenDeclarations(function)) {
|
||||
if (overridden instanceof CallableMemberDescriptor
|
||||
&& ((CallableMemberDescriptor) overridden).getKind() == CallableMemberDescriptor.Kind.DECLARATION
|
||||
&& !overridden.getContainingDeclaration().equals(builtIns.getAny())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.common
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.KtClass
|
||||
import org.jetbrains.kotlin.psi.KtClassOrObject
|
||||
import org.jetbrains.kotlin.psi.KtParameter
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
import org.jetbrains.kotlin.resolve.BindingContextUtils
|
||||
import org.jetbrains.kotlin.resolve.OverridingUtil
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
|
||||
|
||||
/**
|
||||
* A platform-independent logic for generating data class synthetic methods.
|
||||
* TODO: data class with zero components gets no toString/equals/hashCode methods. This is inconsistent and should be
|
||||
* changed here with the platform backends adopted.
|
||||
*/
|
||||
abstract class DataClassMethodGenerator(private val declaration: KtClassOrObject, private val bindingContext: BindingContext) {
|
||||
protected val classDescriptor: ClassDescriptor = BindingContextUtils.getNotNull(bindingContext, BindingContext.CLASS, declaration)
|
||||
|
||||
private val builtIns = classDescriptor.builtIns
|
||||
|
||||
fun generate() {
|
||||
generateComponentFunctionsForDataClasses()
|
||||
|
||||
generateCopyFunctionForDataClasses(primaryConstructorParameters)
|
||||
|
||||
val properties = dataProperties
|
||||
if (properties.isNotEmpty()) {
|
||||
generateDataClassToStringIfNeeded(properties)
|
||||
generateDataClassHashCodeIfNeeded(properties)
|
||||
generateDataClassEqualsIfNeeded(properties)
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract fun generateComponentFunction(function: FunctionDescriptor, parameter: ValueParameterDescriptor)
|
||||
|
||||
protected abstract fun generateCopyFunction(function: FunctionDescriptor, constructorParameters: List<KtParameter>)
|
||||
|
||||
protected abstract fun generateToStringMethod(function: FunctionDescriptor, properties: List<PropertyDescriptor>)
|
||||
|
||||
protected abstract fun generateHashCodeMethod(function: FunctionDescriptor, properties: List<PropertyDescriptor>)
|
||||
|
||||
protected abstract fun generateEqualsMethod(function: FunctionDescriptor, properties: List<PropertyDescriptor>)
|
||||
|
||||
private fun generateComponentFunctionsForDataClasses() {
|
||||
// primary constructor should exist for data classes
|
||||
// but when generating light-classes still need to check we have one
|
||||
val constructor = classDescriptor.unsubstitutedPrimaryConstructor ?: return
|
||||
|
||||
for (parameter in constructor.valueParameters) {
|
||||
val function = bindingContext.get(BindingContext.DATA_CLASS_COMPONENT_FUNCTION, parameter)
|
||||
if (function != null) {
|
||||
generateComponentFunction(function, parameter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun generateCopyFunctionForDataClasses(constructorParameters: List<KtParameter>) {
|
||||
val copyFunction = bindingContext.get(BindingContext.DATA_CLASS_COPY_FUNCTION, classDescriptor) ?: return
|
||||
generateCopyFunction(copyFunction, constructorParameters)
|
||||
}
|
||||
|
||||
private fun generateDataClassToStringIfNeeded(properties: List<PropertyDescriptor>) {
|
||||
val function = getDeclaredMember("toString", builtIns.string)
|
||||
if (function != null && isTrivial(function)) {
|
||||
generateToStringMethod(function, properties)
|
||||
}
|
||||
}
|
||||
|
||||
private fun generateDataClassHashCodeIfNeeded(properties: List<PropertyDescriptor>) {
|
||||
val function = getDeclaredMember("hashCode", builtIns.int)
|
||||
if (function != null && isTrivial(function)) {
|
||||
generateHashCodeMethod(function, properties)
|
||||
}
|
||||
}
|
||||
|
||||
private fun generateDataClassEqualsIfNeeded(properties: List<PropertyDescriptor>) {
|
||||
val function = getDeclaredMember("equals", builtIns.boolean, builtIns.any)
|
||||
if (function != null && isTrivial(function)) {
|
||||
generateEqualsMethod(function, properties)
|
||||
}
|
||||
}
|
||||
|
||||
private val dataProperties: List<PropertyDescriptor>
|
||||
get() = primaryConstructorParameters
|
||||
.filter { it.hasValOrVar() }
|
||||
.map { bindingContext.get(BindingContext.PRIMARY_CONSTRUCTOR_PARAMETER, it)!! }
|
||||
|
||||
private val primaryConstructorParameters: List<KtParameter>
|
||||
get() = (declaration as? KtClass)?.getPrimaryConstructorParameters().orEmpty()
|
||||
|
||||
private fun getDeclaredMember(
|
||||
name: String,
|
||||
returnedClassifier: ClassDescriptor,
|
||||
vararg valueParameterClassifiers: ClassDescriptor
|
||||
): FunctionDescriptor? = CodegenUtil.getDeclaredFunctionByRawSignature(
|
||||
classDescriptor, Name.identifier(name), returnedClassifier, *valueParameterClassifiers
|
||||
)
|
||||
|
||||
/**
|
||||
* @return true if the member is an inherited implementation of a method from Any
|
||||
*/
|
||||
private fun isTrivial(function: FunctionDescriptor): Boolean {
|
||||
return function.kind != CallableMemberDescriptor.Kind.DECLARATION &&
|
||||
OverridingUtil.getOverriddenDeclarations(function).none { overridden ->
|
||||
overridden is CallableMemberDescriptor &&
|
||||
overridden.kind == CallableMemberDescriptor.Kind.DECLARATION &&
|
||||
overridden.containingDeclaration != builtIns.any
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ interface FunctionHandle {
|
||||
fun getOverridden(): Iterable<FunctionHandle>
|
||||
}
|
||||
|
||||
data class Bridge<Signature>(
|
||||
data class Bridge<out Signature>(
|
||||
val from: Signature,
|
||||
val to: Signature
|
||||
) {
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.OverrideResolver
|
||||
import org.jetbrains.kotlin.resolve.OverridingUtil
|
||||
import org.jetbrains.kotlin.resolve.calls.callResolverUtil.isOrOverridesSynthesized
|
||||
|
||||
fun <Signature> generateBridgesForFunctionDescriptor(
|
||||
@@ -87,8 +87,8 @@ fun findTraitImplementation(descriptor: CallableMemberDescriptor): CallableMembe
|
||||
* that should be called when the given fake override is called.
|
||||
*/
|
||||
fun findImplementationFromInterface(descriptor: CallableMemberDescriptor): CallableMemberDescriptor? {
|
||||
val overridden = OverrideResolver.getOverriddenDeclarations(descriptor)
|
||||
val filtered = OverrideResolver.filterOutOverridden(overridden)
|
||||
val overridden = OverridingUtil.getOverriddenDeclarations(descriptor)
|
||||
val filtered = OverridingUtil.filterOutOverridden(overridden)
|
||||
|
||||
val result = filtered.firstOrNull { it.modality != Modality.ABSTRACT } ?: return null
|
||||
|
||||
@@ -108,6 +108,6 @@ fun firstSuperMethodFromKotlin(
|
||||
): CallableMemberDescriptor? {
|
||||
return descriptor.overriddenDescriptors.firstOrNull { overridden ->
|
||||
overridden.modality != Modality.ABSTRACT &&
|
||||
(overridden == implementation || OverrideResolver.overrides(overridden, implementation))
|
||||
(overridden == implementation || OverridingUtil.overrides(overridden, implementation))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ public abstract class AnnotationCodegen {
|
||||
ClassifierDescriptor classifierDescriptor = annotationDescriptor.getType().getConstructor().getDeclarationDescriptor();
|
||||
assert classifierDescriptor != null : "Annotation descriptor has no class: " + annotationDescriptor;
|
||||
RetentionPolicy rp = getRetentionPolicy(classifierDescriptor);
|
||||
if (rp == RetentionPolicy.SOURCE && typeMapper.getClassBuilderMode() != ClassBuilderMode.LIGHT_CLASSES) {
|
||||
if (rp == RetentionPolicy.SOURCE && !typeMapper.getClassBuilderMode().generateSourceRetentionAnnotations) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -400,13 +400,10 @@ public abstract class AnnotationCodegen {
|
||||
|
||||
private Void visitUnsupportedValue(ConstantValue<?> value) {
|
||||
ClassBuilderMode mode = typeMapper.getClassBuilderMode();
|
||||
switch (mode) {
|
||||
case FULL:
|
||||
throw new IllegalStateException("Don't know how to compile annotation value " + value);
|
||||
case LIGHT_CLASSES:
|
||||
return null;
|
||||
default:
|
||||
throw new IllegalStateException("Unknown builder mode: " + mode);
|
||||
if (mode.generateBodies) {
|
||||
throw new IllegalStateException("Don't know how to compile annotation value " + value);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.codegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.protobuf.MessageLite;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import kotlin.Unit;
|
||||
@@ -34,17 +33,19 @@ import org.jetbrains.kotlin.codegen.serialization.JvmStringTable;
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState;
|
||||
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
|
||||
import org.jetbrains.kotlin.descriptors.*;
|
||||
import org.jetbrains.kotlin.jvm.RuntimeAssertionInfo;
|
||||
import org.jetbrains.kotlin.lexer.KtTokens;
|
||||
import org.jetbrains.kotlin.load.java.JavaVisibilities;
|
||||
import org.jetbrains.kotlin.load.java.JvmAnnotationNames;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
import org.jetbrains.kotlin.protobuf.MessageLite;
|
||||
import org.jetbrains.kotlin.renderer.DescriptorRenderer;
|
||||
import org.jetbrains.kotlin.resolve.DeprecationUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||
import org.jetbrains.kotlin.resolve.annotations.AnnotationUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.inline.InlineUtil;
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmClassName;
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType;
|
||||
import org.jetbrains.kotlin.resolve.jvm.RuntimeAssertionInfo;
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin;
|
||||
import org.jetbrains.kotlin.serialization.DescriptorSerializer;
|
||||
import org.jetbrains.kotlin.serialization.jvm.BitEncoding;
|
||||
@@ -244,13 +245,10 @@ public class AsmUtil {
|
||||
if (specialCase != null) {
|
||||
return specialCase;
|
||||
}
|
||||
return getDefaultVisibilityFlag(descriptor.getVisibility());
|
||||
}
|
||||
|
||||
public static int getDefaultVisibilityFlag(@NotNull Visibility visibility) {
|
||||
Visibility visibility = descriptor.getVisibility();
|
||||
Integer defaultMapping = visibilityToAccessFlag.get(visibility);
|
||||
if (defaultMapping == null) {
|
||||
throw new IllegalStateException(visibility + " is not a valid visibility in backend");
|
||||
throw new IllegalStateException(visibility + " is not a valid visibility in backend for " + DescriptorRenderer.DEBUG_TEXT.render(descriptor));
|
||||
}
|
||||
return defaultMapping;
|
||||
}
|
||||
@@ -562,11 +560,6 @@ public class AsmUtil {
|
||||
v.invokestatic(IntrinsicMethods.INTRINSICS_CLASS_NAME, "areEqual", "(Ljava/lang/Object;Ljava/lang/Object;)Z", false);
|
||||
}
|
||||
|
||||
public static void genIncrement(Type expectedType, int myDelta, InstructionAdapter v) {
|
||||
numConst(myDelta, expectedType, v);
|
||||
v.add(expectedType);
|
||||
}
|
||||
|
||||
public static void numConst(int value, Type type, InstructionAdapter v) {
|
||||
if (type == Type.FLOAT_TYPE) {
|
||||
v.fconst(value);
|
||||
@@ -585,9 +578,11 @@ public class AsmUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static void genIncrement(Type expectedType, Type baseType, int myDelta, InstructionAdapter v) {
|
||||
genIncrement(baseType, myDelta, v);
|
||||
StackValue.coerce(baseType, expectedType, v);
|
||||
public static void genIncrement(Type baseType, int myDelta, InstructionAdapter v) {
|
||||
Type operationType = numberFunctionOperandType(baseType);
|
||||
numConst(myDelta, operationType, v);
|
||||
v.add(operationType);
|
||||
StackValue.coerce(operationType, baseType, v);
|
||||
}
|
||||
|
||||
public static void swap(InstructionAdapter v, Type stackTop, Type afterTop) {
|
||||
|
||||
@@ -32,8 +32,6 @@ open class BranchedValue(
|
||||
val opcode: Int
|
||||
) : StackValue(Type.BOOLEAN_TYPE) {
|
||||
|
||||
constructor(or: BranchedValue, opcode: Int) : this(or.arg1, or.arg2, or.operandType, opcode)
|
||||
|
||||
override fun putSelector(type: Type, v: InstructionAdapter) {
|
||||
val branchJumpLabel = Label()
|
||||
condJump(branchJumpLabel, v, true)
|
||||
@@ -63,7 +61,7 @@ open class BranchedValue(
|
||||
companion object {
|
||||
val negatedOperations = hashMapOf<Int, Int>()
|
||||
|
||||
val TRUE: BranchedValue = object : BranchedValue(StackValue.Constant(true, Type.BOOLEAN_TYPE), null, Type.BOOLEAN_TYPE, IFEQ) {
|
||||
val TRUE: BranchedValue = object : BranchedValue(StackValue.none()/*not used*/, null, Type.BOOLEAN_TYPE, IFEQ) {
|
||||
override fun condJump(jumpLabel: Label, v: InstructionAdapter, jumpIfFalse: Boolean) {
|
||||
if (!jumpIfFalse) {
|
||||
v.goTo(jumpLabel)
|
||||
@@ -85,7 +83,7 @@ open class BranchedValue(
|
||||
}
|
||||
}
|
||||
|
||||
val FALSE: BranchedValue = object : BranchedValue(StackValue.Constant(false, Type.BOOLEAN_TYPE), null, Type.BOOLEAN_TYPE, IFEQ) {
|
||||
val FALSE: BranchedValue = object : BranchedValue(StackValue.none()/*not used*/, null, Type.BOOLEAN_TYPE, IFEQ) {
|
||||
override fun condJump(jumpLabel: Label, v: InstructionAdapter, jumpIfFalse: Boolean) {
|
||||
if (jumpIfFalse) {
|
||||
v.goTo(jumpLabel)
|
||||
@@ -249,7 +247,7 @@ class NumberCompare(
|
||||
}
|
||||
|
||||
class ObjectCompare(
|
||||
val opToken: IElementType,
|
||||
opToken: IElementType,
|
||||
operandType: Type,
|
||||
left: StackValue,
|
||||
right: StackValue
|
||||
|
||||
@@ -79,5 +79,5 @@ class CallableMethod(
|
||||
invokeOpcode == INVOKESTATIC
|
||||
|
||||
override fun toString(): String =
|
||||
"${Printer.OPCODES[invokeOpcode]} ${owner.internalName}.$signature"
|
||||
"${Printer.OPCODES[invokeOpcode]} $owner.$signature"
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ClassBuilderFactories {
|
||||
@NotNull
|
||||
@Override
|
||||
public ClassBuilderMode getClassBuilderMode() {
|
||||
return ClassBuilderMode.FULL;
|
||||
return ClassBuilderMode.full(false);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -55,13 +55,22 @@ public class ClassBuilderFactories {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
};
|
||||
|
||||
public static ClassBuilderFactory TEST = new TestClassBuilderFactory(false);
|
||||
|
||||
public static ClassBuilderFactory TEST_WITH_SOURCE_RETENTION_ANNOTATIONS = new TestClassBuilderFactory(true);
|
||||
|
||||
private static class TestClassBuilderFactory implements ClassBuilderFactory {
|
||||
private final boolean generateSourceRetentionAnnotations;
|
||||
|
||||
public TestClassBuilderFactory(boolean generateSourceRetentionAnnotations) {
|
||||
this.generateSourceRetentionAnnotations = generateSourceRetentionAnnotations;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static ClassBuilderFactory TEST = new ClassBuilderFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public ClassBuilderMode getClassBuilderMode() {
|
||||
return ClassBuilderMode.FULL;
|
||||
return ClassBuilderMode.full(generateSourceRetentionAnnotations);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -89,38 +98,40 @@ public class ClassBuilderFactories {
|
||||
public void close() {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static ClassBuilderFactory BINARIES = new ClassBuilderFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public ClassBuilderMode getClassBuilderMode() {
|
||||
return ClassBuilderMode.FULL;
|
||||
}
|
||||
public static ClassBuilderFactory binaries(final boolean generateSourceRetentionAnnotations) {
|
||||
return new ClassBuilderFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public ClassBuilderMode getClassBuilderMode() {
|
||||
return ClassBuilderMode.full(generateSourceRetentionAnnotations);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ClassBuilder newClassBuilder(@NotNull JvmDeclarationOrigin origin) {
|
||||
return new AbstractClassBuilder.Concrete(new BinaryClassWriter());
|
||||
}
|
||||
@NotNull
|
||||
@Override
|
||||
public ClassBuilder newClassBuilder(@NotNull JvmDeclarationOrigin origin) {
|
||||
return new AbstractClassBuilder.Concrete(new BinaryClassWriter());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String asText(ClassBuilder builder) {
|
||||
throw new UnsupportedOperationException("BINARIES generator asked for text");
|
||||
}
|
||||
@Override
|
||||
public String asText(ClassBuilder builder) {
|
||||
throw new UnsupportedOperationException("BINARIES generator asked for text");
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] asBytes(ClassBuilder builder) {
|
||||
ClassWriter visitor = (ClassWriter) builder.getVisitor();
|
||||
return visitor.toByteArray();
|
||||
}
|
||||
@Override
|
||||
public byte[] asBytes(ClassBuilder builder) {
|
||||
ClassWriter visitor = (ClassWriter) builder.getVisitor();
|
||||
return visitor.toByteArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
@Override
|
||||
public void close() {
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private ClassBuilderFactories() {
|
||||
}
|
||||
|
||||
@@ -16,13 +16,50 @@
|
||||
|
||||
package org.jetbrains.kotlin.codegen;
|
||||
|
||||
public enum ClassBuilderMode {
|
||||
public class ClassBuilderMode {
|
||||
public final boolean generateBodies;
|
||||
public final boolean generateMetadata;
|
||||
public final boolean generateSourceRetentionAnnotations;
|
||||
|
||||
private ClassBuilderMode(boolean generateBodies, boolean generateMetadata, boolean generateSourceRetentionAnnotations) {
|
||||
this.generateBodies = generateBodies;
|
||||
this.generateMetadata = generateMetadata;
|
||||
this.generateSourceRetentionAnnotations = generateSourceRetentionAnnotations;
|
||||
}
|
||||
|
||||
public static ClassBuilderMode full(boolean generateSourceRetentionAnnotations) {
|
||||
return generateSourceRetentionAnnotations ? KAPT2 : FULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Full function bodies
|
||||
*/
|
||||
FULL,
|
||||
private final static ClassBuilderMode FULL = new ClassBuilderMode(
|
||||
/* bodies = */ true,
|
||||
/* metadata = */ true,
|
||||
/* sourceRetention = */ false);
|
||||
|
||||
/**
|
||||
* Full function bodies, write annotations with the "source" retention.
|
||||
*/
|
||||
private final static ClassBuilderMode KAPT2 = new ClassBuilderMode(
|
||||
/* bodies = */ true,
|
||||
/* metadata = */ true,
|
||||
/* sourceRetention = */ true);
|
||||
|
||||
/**
|
||||
* Generating light classes: Only function signatures
|
||||
*/
|
||||
LIGHT_CLASSES,
|
||||
public final static ClassBuilderMode LIGHT_CLASSES = new ClassBuilderMode(
|
||||
/* bodies = */ false,
|
||||
/* metadata = */ false,
|
||||
/* sourceRetention = */ true);
|
||||
|
||||
/**
|
||||
* Function signatures + metadata (to support incremental compilation with kapt)
|
||||
*/
|
||||
public final static ClassBuilderMode KAPT = new ClassBuilderMode(
|
||||
/* bodies = */ false,
|
||||
/* metadata = */ true,
|
||||
/* sourceRetention = */ true);
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ import static org.jetbrains.kotlin.codegen.ExpressionCodegen.generateClassLitera
|
||||
import static org.jetbrains.kotlin.codegen.JvmCodegenUtil.isConst;
|
||||
import static org.jetbrains.kotlin.codegen.binding.CodegenBinding.CLOSURE;
|
||||
import static org.jetbrains.kotlin.codegen.binding.CodegenBinding.asmTypeForAnonymousClass;
|
||||
import static org.jetbrains.kotlin.codegen.serialization.JvmSerializationBindings.METHOD_FOR_FUNCTION;
|
||||
import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.*;
|
||||
import static org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin.NO_ORIGIN;
|
||||
import static org.jetbrains.org.objectweb.asm.Opcodes.*;
|
||||
@@ -219,10 +220,15 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
|
||||
|
||||
@Override
|
||||
protected void generateKotlinMetadataAnnotation() {
|
||||
FunctionDescriptor freeLambdaDescriptor = createFreeLambdaDescriptor(funDescriptor);
|
||||
Method method = v.getSerializationBindings().get(METHOD_FOR_FUNCTION, funDescriptor);
|
||||
assert method != null : "No method for " + funDescriptor;
|
||||
v.getSerializationBindings().put(METHOD_FOR_FUNCTION, freeLambdaDescriptor, method);
|
||||
|
||||
final DescriptorSerializer serializer =
|
||||
DescriptorSerializer.createForLambda(new JvmSerializerExtension(v.getSerializationBindings(), state));
|
||||
|
||||
final ProtoBuf.Function functionProto = serializer.functionProto(funDescriptor).build();
|
||||
final ProtoBuf.Function functionProto = serializer.functionProto(freeLambdaDescriptor).build();
|
||||
|
||||
WriteAnnotationUtilKt.writeKotlinMetadata(v, KotlinClassHeader.Kind.SYNTHETIC_CLASS, new Function1<AnnotationVisitor, Unit>() {
|
||||
@Override
|
||||
@@ -233,6 +239,30 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a function descriptor, creates another function descriptor with type parameters copied from outer context(s).
|
||||
* This is needed because once we're serializing this to a proto, there's no place to store information about external type parameters.
|
||||
*/
|
||||
@NotNull
|
||||
private static FunctionDescriptor createFreeLambdaDescriptor(@NotNull FunctionDescriptor descriptor) {
|
||||
FunctionDescriptor.CopyBuilder<? extends FunctionDescriptor> builder = descriptor.newCopyBuilder();
|
||||
List<TypeParameterDescriptor> typeParameters = new ArrayList<TypeParameterDescriptor>(0);
|
||||
builder.setTypeParameters(typeParameters);
|
||||
|
||||
DeclarationDescriptor container = descriptor.getContainingDeclaration();
|
||||
while (container != null) {
|
||||
if (container instanceof ClassDescriptor) {
|
||||
typeParameters.addAll(((ClassDescriptor) container).getDeclaredTypeParameters());
|
||||
}
|
||||
else if (container instanceof CallableDescriptor && !(container instanceof ConstructorDescriptor)) {
|
||||
typeParameters.addAll(((CallableDescriptor) container).getTypeParameters());
|
||||
}
|
||||
container = container.getContainingDeclaration();
|
||||
}
|
||||
|
||||
return typeParameters.isEmpty() ? descriptor : builder.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void done() {
|
||||
writeOuterClassAndEnclosingMethod();
|
||||
@@ -270,7 +300,7 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
|
||||
v.newMethod(JvmDeclarationOriginKt.OtherOrigin(element, funDescriptor), ACC_PUBLIC | ACC_BRIDGE | ACC_SYNTHETIC,
|
||||
bridge.getName(), bridge.getDescriptor(), null, ArrayUtil.EMPTY_STRING_ARRAY);
|
||||
|
||||
if (state.getClassBuilderMode() != ClassBuilderMode.FULL) return;
|
||||
if (!state.getClassBuilderMode().generateBodies) return;
|
||||
|
||||
mv.visitCode();
|
||||
|
||||
@@ -304,7 +334,7 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
|
||||
// TODO: ImplementationBodyCodegen.markLineNumberForSyntheticFunction?
|
||||
private void generateFunctionReferenceMethods(@NotNull FunctionDescriptor descriptor) {
|
||||
int flags = ACC_PUBLIC | ACC_FINAL;
|
||||
boolean generateBody = state.getClassBuilderMode() == ClassBuilderMode.FULL;
|
||||
boolean generateBody = state.getClassBuilderMode().generateBodies;
|
||||
|
||||
{
|
||||
MethodVisitor mv =
|
||||
@@ -374,7 +404,7 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
|
||||
Method constructor = new Method("<init>", Type.VOID_TYPE, argTypes);
|
||||
MethodVisitor mv = v.newMethod(JvmDeclarationOriginKt.OtherOrigin(element, funDescriptor), visibilityFlag, "<init>", constructor.getDescriptor(), null,
|
||||
ArrayUtil.EMPTY_STRING_ARRAY);
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
if (state.getClassBuilderMode().generateBodies) {
|
||||
mv.visitCode();
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
|
||||
|
||||
@@ -23,16 +23,20 @@ import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.load.java.BuiltinMethodsWithSpecialGenericSignature.getSpecialSignatureInfo
|
||||
import org.jetbrains.kotlin.load.java.BuiltinMethodsWithSpecialGenericSignature.isBuiltinWithSpecialDescriptorInJvm
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.platform.JavaToKotlinClassMap
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.NonReportingOverrideStrategy
|
||||
import org.jetbrains.kotlin.resolve.OverrideResolver
|
||||
import org.jetbrains.kotlin.resolve.OverridingStrategy
|
||||
import org.jetbrains.kotlin.resolve.OverridingUtil
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin
|
||||
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodGenericSignature
|
||||
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature
|
||||
import org.jetbrains.kotlin.types.*
|
||||
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes.*
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes.ACC_PUBLIC
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes.ACC_SYNTHETIC
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
|
||||
import java.util.*
|
||||
|
||||
@@ -49,6 +53,7 @@ class CollectionStubMethodGenerator(
|
||||
private val typeMapper = state.typeMapper
|
||||
|
||||
fun generate() {
|
||||
if (descriptor.kind == ClassKind.INTERFACE) return
|
||||
val superCollectionClasses = findRelevantSuperCollectionClasses()
|
||||
if (superCollectionClasses.isEmpty()) return
|
||||
|
||||
@@ -193,11 +198,40 @@ class CollectionStubMethodGenerator(
|
||||
): List<FunctionDescriptor> {
|
||||
val result = ArrayList<FunctionDescriptor>()
|
||||
|
||||
OverrideResolver.generateOverridesInAClass(klass, listOf(), object : NonReportingOverrideStrategy() {
|
||||
generateOverridesInAClass(klass, object : NonReportingOverrideStrategy() {
|
||||
override fun addFakeOverride(fakeOverride: CallableMemberDescriptor) {
|
||||
if (fakeOverride !is FunctionDescriptor) return
|
||||
if (fakeOverride.findOverriddenFromDirectSuperClass(mutableCollectionClass)?.kind == DECLARATION) {
|
||||
result.add(fakeOverride)
|
||||
val foundOverriddenFromDirectSuperClass = fakeOverride.findOverriddenFromDirectSuperClass(mutableCollectionClass) ?: return
|
||||
if (foundOverriddenFromDirectSuperClass.kind == DECLARATION) {
|
||||
// For regular classes there should no be fake overrides having return types incompatible with return types of their
|
||||
// overridden, while here it's possible to create declaration like `fun remove(e: E): ImmutableCollection<E>`
|
||||
// in read-only class that obviously conflicts with `fun remove(e: E): Boolean`.
|
||||
// But overrides binding algorithm suppose there should be no conflicts like this, so it simply chooses a random
|
||||
// representative for fake override, while we interested here in ones from mutable version.
|
||||
//
|
||||
// NB: READ_ONLY_ARE_EQUAL_TO_MUTABLE_TYPE_CHECKER is used here for cases like:
|
||||
// `fun iterator(): CharIterator` defined in read-only collection
|
||||
// The problem is that 'CharIterator' is not a subtype of 'MutableIterator' while from Java's point of view it is,
|
||||
// so we must hack our subtyping a little bit
|
||||
val newDescriptor =
|
||||
if (READ_ONLY_ARE_EQUAL_TO_MUTABLE_TYPE_CHECKER.isSubtypeOf(
|
||||
fakeOverride.returnType!!, foundOverriddenFromDirectSuperClass.returnType!!))
|
||||
fakeOverride
|
||||
else
|
||||
foundOverriddenFromDirectSuperClass.copy(
|
||||
fakeOverride.containingDeclaration,
|
||||
foundOverriddenFromDirectSuperClass.modality,
|
||||
foundOverriddenFromDirectSuperClass.visibility,
|
||||
fakeOverride.kind, false)
|
||||
|
||||
newDescriptor.overriddenDescriptors =
|
||||
fakeOverride.overriddenDescriptors.filter {
|
||||
superDescriptor ->
|
||||
// filter out incompatible descriptors, e.g. `fun remove(e: E): ImmutableCollection<E>` for `fun remove(e: E): Boolean`
|
||||
READ_ONLY_ARE_EQUAL_TO_MUTABLE_TYPE_CHECKER.isSubtypeOf(newDescriptor.returnType!!, superDescriptor.returnType!!)
|
||||
}
|
||||
|
||||
result.add(newDescriptor)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,6 +254,20 @@ class CollectionStubMethodGenerator(
|
||||
}
|
||||
}
|
||||
|
||||
private fun generateOverridesInAClass(classDescriptor: ClassDescriptor, strategy: OverridingStrategy) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val membersFromSupertypesByName =
|
||||
classDescriptor.typeConstructor.supertypes.flatMapTo(linkedSetOf()) { type ->
|
||||
DescriptorUtils.getAllDescriptors(type.memberScope).filter {
|
||||
it is PropertyDescriptor || it is SimpleFunctionDescriptor
|
||||
} as List<CallableMemberDescriptor>
|
||||
}.groupBy { it.name }
|
||||
|
||||
for ((name, fromSupertypes) in membersFromSupertypesByName) {
|
||||
OverridingUtil.generateOverridesInFunctionGroup(name, fromSupertypes, emptyList(), classDescriptor, strategy)
|
||||
}
|
||||
}
|
||||
|
||||
private fun createSyntheticSubclass(): Pair<MutableClassDescriptor, List<TypeParameterDescriptor>> {
|
||||
val child = MutableClassDescriptor(descriptor.containingDeclaration, ClassKind.CLASS, false,
|
||||
Name.special("<synthetic inheritor of ${descriptor.name}>"), descriptor.source)
|
||||
@@ -243,18 +291,24 @@ class CollectionStubMethodGenerator(
|
||||
private fun FunctionDescriptor.signature(): JvmMethodGenericSignature = typeMapper.mapSignatureWithGeneric(this, OwnerKind.IMPLEMENTATION)
|
||||
|
||||
private fun generateMethodStub(signature: JvmMethodGenericSignature, synthetic: Boolean) {
|
||||
// TODO: investigate if it makes sense to generate abstract stubs in traits
|
||||
var access = ACC_PUBLIC
|
||||
if (descriptor.kind == ClassKind.INTERFACE) access = access or ACC_ABSTRACT
|
||||
if (synthetic) access = access or ACC_SYNTHETIC
|
||||
assert(descriptor.kind != ClassKind.INTERFACE) { "No stubs should be generated for interface ${descriptor.fqNameUnsafe}" }
|
||||
|
||||
val access = ACC_PUBLIC or (if (synthetic) ACC_SYNTHETIC else 0)
|
||||
val asmMethod = signature.asmMethod
|
||||
val genericSignature = if (synthetic) null else signature.genericsSignature
|
||||
val mv = v.newMethod(JvmDeclarationOrigin.NO_ORIGIN, access, asmMethod.name, asmMethod.descriptor, genericSignature, null)
|
||||
if (descriptor.kind != ClassKind.INTERFACE) {
|
||||
mv.visitCode()
|
||||
AsmUtil.genThrow(InstructionAdapter(mv), "java/lang/UnsupportedOperationException", "Mutating immutable collection")
|
||||
FunctionCodegen.endVisit(mv, "built-in stub for $signature", null)
|
||||
}
|
||||
mv.visitCode()
|
||||
AsmUtil.genThrow(InstructionAdapter(mv), "java/lang/UnsupportedOperationException", "Mutating immutable collection")
|
||||
FunctionCodegen.endVisit(mv, "built-in stub for $signature", null)
|
||||
}
|
||||
}
|
||||
|
||||
private val READ_ONLY_ARE_EQUAL_TO_MUTABLE_TYPE_CHECKER = KotlinTypeChecker.withAxioms { x, y ->
|
||||
val firstClass = x.declarationDescriptor as? ClassDescriptor ?: return@withAxioms x == y
|
||||
val secondClass = y.declarationDescriptor as? ClassDescriptor ?: return@withAxioms x == y
|
||||
|
||||
val j2k = JavaToKotlinClassMap.INSTANCE
|
||||
val firstReadOnly = if (j2k.isMutable(firstClass)) j2k.convertMutableToReadOnly(firstClass) else firstClass
|
||||
val secondReadOnly = if (j2k.isMutable(secondClass)) j2k.convertMutableToReadOnly(secondClass) else secondClass
|
||||
firstReadOnly.typeConstructor == secondReadOnly.typeConstructor
|
||||
}
|
||||
|
||||
@@ -16,53 +16,21 @@
|
||||
|
||||
package org.jetbrains.kotlin.codegen;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.diagnostics.DiagnosticUtils;
|
||||
import org.jetbrains.kotlin.util.ExceptionUtilKt;
|
||||
|
||||
public class CompilationException extends RuntimeException {
|
||||
private final PsiElement element;
|
||||
|
||||
public CompilationException(@NotNull String message, @Nullable Throwable cause, @NotNull PsiElement element) {
|
||||
super(getMessage(message, cause, element), cause);
|
||||
public CompilationException(@NotNull String message, @Nullable Throwable cause, @Nullable PsiElement element) {
|
||||
super(ExceptionUtilKt.getExceptionMessage("Back-end (JVM)", message, cause, element), cause);
|
||||
this.element = element;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Nullable
|
||||
public PsiElement getElement() {
|
||||
return element;
|
||||
}
|
||||
|
||||
|
||||
private static String where(@NotNull Throwable cause) {
|
||||
StackTraceElement[] stackTrace = cause.getStackTrace();
|
||||
if (stackTrace != null && stackTrace.length > 0) {
|
||||
return stackTrace[0].getFileName() + ":" + stackTrace[0].getLineNumber();
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
public static String getMessage(@NotNull final String message, @Nullable final Throwable cause, @NotNull final PsiElement element) {
|
||||
return ApplicationManager.getApplication().runReadAction(new Computable<String>() {
|
||||
@Override
|
||||
public String compute() {
|
||||
StringBuilder result =
|
||||
new StringBuilder("Back-end (JVM) Internal error: ").append(message).append("\n");
|
||||
if (cause != null) {
|
||||
String causeMessage = cause.getMessage();
|
||||
result.append("Cause: ").append(causeMessage == null ? cause.toString() : causeMessage).append("\n");
|
||||
}
|
||||
result.append("File being compiled and position: ").append(DiagnosticUtils.atLocation(element)).append("\n");
|
||||
result.append("PsiElement: ").append(element.getText()).append("\n");
|
||||
if (cause != null) {
|
||||
result.append("The root cause was thrown at: ").append(where(cause));
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ class DefaultParameterValueSubstitutor(val state: GenerationState) {
|
||||
annotationCodegen.genAnnotations(it.value, signature.valueParameters[it.index].asmType)
|
||||
}
|
||||
|
||||
if (state.classBuilderMode == ClassBuilderMode.LIGHT_CLASSES) {
|
||||
if (!state.classBuilderMode.generateBodies) {
|
||||
FunctionCodegen.generateLocalVariablesForParameters(mv, signature, null, Label(), Label(), remainingParameters, isStatic)
|
||||
mv.visitEnd()
|
||||
return
|
||||
|
||||
@@ -38,13 +38,10 @@ import org.jetbrains.kotlin.codegen.binding.CodegenBinding;
|
||||
import org.jetbrains.kotlin.codegen.context.*;
|
||||
import org.jetbrains.kotlin.codegen.extensions.ExpressionCodegenExtension;
|
||||
import org.jetbrains.kotlin.codegen.inline.*;
|
||||
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicCallable;
|
||||
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicMethod;
|
||||
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicMethods;
|
||||
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicPropertyGetter;
|
||||
import org.jetbrains.kotlin.codegen.intrinsics.*;
|
||||
import org.jetbrains.kotlin.codegen.pseudoInsns.PseudoInsnsKt;
|
||||
import org.jetbrains.kotlin.codegen.signature.JvmSignatureWriter;
|
||||
import org.jetbrains.kotlin.codegen.signature.BothSignatureWriter;
|
||||
import org.jetbrains.kotlin.codegen.signature.JvmSignatureWriter;
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState;
|
||||
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
|
||||
import org.jetbrains.kotlin.codegen.when.SwitchCodegen;
|
||||
@@ -54,8 +51,6 @@ import org.jetbrains.kotlin.descriptors.impl.SyntheticFieldDescriptor;
|
||||
import org.jetbrains.kotlin.diagnostics.DiagnosticUtils;
|
||||
import org.jetbrains.kotlin.diagnostics.Errors;
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation;
|
||||
import org.jetbrains.kotlin.jvm.RuntimeAssertionInfo;
|
||||
import org.jetbrains.kotlin.jvm.bindingContextSlices.BindingContextSlicesKt;
|
||||
import org.jetbrains.kotlin.lexer.KtTokens;
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi;
|
||||
import org.jetbrains.kotlin.load.java.descriptors.SamConstructorDescriptor;
|
||||
@@ -66,6 +61,7 @@ import org.jetbrains.kotlin.resolve.BindingContextUtils;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||
import org.jetbrains.kotlin.resolve.annotations.AnnotationUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.bindingContextUtil.BindingContextUtilsKt;
|
||||
import org.jetbrains.kotlin.resolve.calls.callResolverUtil.CallResolverUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.CallUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.calls.model.*;
|
||||
@@ -77,6 +73,8 @@ import org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluat
|
||||
import org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluatorKt;
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt;
|
||||
import org.jetbrains.kotlin.resolve.inline.InlineUtil;
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmBindingContextSlices;
|
||||
import org.jetbrains.kotlin.resolve.jvm.RuntimeAssertionInfo;
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKt;
|
||||
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodParameterKind;
|
||||
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodParameterSignature;
|
||||
@@ -286,7 +284,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
|
||||
RuntimeAssertionInfo runtimeAssertionInfo = null;
|
||||
if (selector instanceof KtExpression) {
|
||||
runtimeAssertionInfo = bindingContext.get(BindingContextSlicesKt.getRUNTIME_ASSERTION_INFO(), (KtExpression) selector);
|
||||
runtimeAssertionInfo = bindingContext.get(JvmBindingContextSlices.RUNTIME_ASSERTION_INFO, (KtExpression) selector);
|
||||
}
|
||||
|
||||
if (BuiltinSpecialBridgesKt.isValueArgumentForCallToMethodWithTypeCheckBarrier(selector, bindingContext)) return stackValue;
|
||||
@@ -389,18 +387,12 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
@NotNull CodegenContext<?> context,
|
||||
@NotNull KtSuperExpression expression
|
||||
) {
|
||||
BindingContext bindingContext = context.getState().getBindingContext();
|
||||
PsiElement labelPsi = bindingContext.get(LABEL_TARGET, expression.getTargetLabel());
|
||||
ClassDescriptor labelTarget = (ClassDescriptor) bindingContext.get(DECLARATION_TO_DESCRIPTOR, labelPsi);
|
||||
DeclarationDescriptor descriptor = bindingContext.get(REFERENCE_TARGET, expression.getInstanceReference());
|
||||
// "super<descriptor>@labelTarget"
|
||||
if (labelTarget != null) {
|
||||
return labelTarget;
|
||||
}
|
||||
assert descriptor instanceof ClassDescriptor : "Don't know how to generate super-call to not a class";
|
||||
CodegenContext result = getParentContextSubclassOf((ClassDescriptor) descriptor, context);
|
||||
assert result != null : "Can't find parent context for " + descriptor;
|
||||
return result.getThisDescriptor();
|
||||
KotlinType thisTypeForSuperCall = context.getState().getBindingContext().get(BindingContext.THIS_TYPE_FOR_SUPER_EXPRESSION, expression);
|
||||
assert thisTypeForSuperCall != null : "This type for superCall ''" + expression.getText() + "'' should be not null!";
|
||||
ClassifierDescriptor descriptor = thisTypeForSuperCall.getConstructor().getDeclarationDescriptor();
|
||||
assert descriptor instanceof ClassDescriptor :
|
||||
"'This' reference target for ''" + expression.getText() + "''should be class descriptor, but was " + descriptor;
|
||||
return (ClassDescriptor) descriptor;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -502,6 +494,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
|
||||
generateLoopBody(expression.getBody());
|
||||
|
||||
markStartLineNumber(expression);
|
||||
v.goTo(condition);
|
||||
|
||||
v.mark(end);
|
||||
@@ -528,6 +521,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
KtExpression condition = expression.getCondition();
|
||||
StackValue conditionValue;
|
||||
|
||||
StackValueWithLeaveTask leaveTask = null;
|
||||
if (body instanceof KtBlockExpression) {
|
||||
// If body's a block, it can contain variable declarations which may be used in the condition of a do-while loop.
|
||||
// We handle this case separately because otherwise such variable will be out of the frame map after the block ends
|
||||
@@ -537,7 +531,9 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
statements.addAll(doWhileStatements);
|
||||
statements.add(condition);
|
||||
|
||||
conditionValue = generateBlock(statements, false, continueLabel, null);
|
||||
//Need to split leave task and condition cause otherwise BranchedValue optimizations wouldn't work
|
||||
leaveTask = generateBlock(statements, false, continueLabel, null);
|
||||
conditionValue = leaveTask.getStackValue();
|
||||
}
|
||||
else {
|
||||
if (body != null) {
|
||||
@@ -548,6 +544,9 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
}
|
||||
|
||||
BranchedValue.Companion.loopJump(conditionValue, beginLoopLabel, false, v);
|
||||
if (leaveTask != null) {
|
||||
leaveTask.getLeaveTasks().invoke(conditionValue);
|
||||
}
|
||||
v.mark(breakLabel);
|
||||
|
||||
blockStackElements.pop();
|
||||
@@ -556,15 +555,12 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
|
||||
@Override
|
||||
public StackValue visitForExpression(@NotNull KtForExpression forExpression, StackValue receiver) {
|
||||
// Is it a "1..2" or so
|
||||
RangeCodegenUtil.BinaryCall binaryCall = RangeCodegenUtil.getRangeAsBinaryCall(forExpression);
|
||||
if (binaryCall != null) {
|
||||
ResolvedCall<?> resolvedCall = CallUtilKt.getResolvedCall(binaryCall.op, bindingContext);
|
||||
if (resolvedCall != null) {
|
||||
if (RangeCodegenUtil.isOptimizableRangeTo(resolvedCall.getResultingDescriptor())) {
|
||||
generateForLoop(new ForInRangeLiteralLoopGenerator(forExpression, binaryCall));
|
||||
return StackValue.none();
|
||||
}
|
||||
ResolvedCall<? extends CallableDescriptor> loopRangeCall = RangeCodegenUtil.getLoopRangeResolvedCall(forExpression, bindingContext);
|
||||
if (loopRangeCall != null) {
|
||||
AbstractForLoopGenerator optimizedForLoopGenerator = createOptimizedForLoopGeneratorOrNull(forExpression, loopRangeCall);
|
||||
if (optimizedForLoopGenerator != null) {
|
||||
generateForLoop(optimizedForLoopGenerator);
|
||||
return StackValue.none();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -592,6 +588,45 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
return StackValue.none();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private AbstractForLoopGenerator createOptimizedForLoopGeneratorOrNull(
|
||||
@NotNull KtForExpression forExpression,
|
||||
@NotNull ResolvedCall<? extends CallableDescriptor> loopRangeCall
|
||||
) {
|
||||
CallableDescriptor loopRangeCallee = loopRangeCall.getResultingDescriptor();
|
||||
if (RangeCodegenUtil.isOptimizableRangeTo(loopRangeCallee)) {
|
||||
return new ForInRangeLiteralLoopGenerator(forExpression, loopRangeCall);
|
||||
}
|
||||
else if (RangeCodegenUtil.isOptimizableDownTo(loopRangeCallee)) {
|
||||
return new ForInDownToProgressionLoopGenerator(forExpression, loopRangeCall);
|
||||
}
|
||||
else if (RangeCodegenUtil.isArrayOrPrimitiveArrayIndices(loopRangeCallee)) {
|
||||
return new ForInArrayIndicesRangeLoopGenerator(forExpression, loopRangeCall);
|
||||
}
|
||||
else if (RangeCodegenUtil.isCollectionIndices(loopRangeCallee)) {
|
||||
return new ForInCollectionIndicesRangeLoopGenerator(forExpression, loopRangeCall);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static KotlinType getExpectedReceiverType(@NotNull ResolvedCall<? extends CallableDescriptor> resolvedCall) {
|
||||
ReceiverParameterDescriptor extensionReceiver = resolvedCall.getResultingDescriptor().getExtensionReceiverParameter();
|
||||
assert extensionReceiver != null : "Extension receiver should be non-null";
|
||||
return extensionReceiver.getType();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static KtExpression getSingleArgumentExpression(@NotNull ResolvedCall<? extends CallableDescriptor> resolvedCall) {
|
||||
List<ResolvedValueArgument> resolvedValueArguments = resolvedCall.getValueArgumentsByIndex();
|
||||
if (resolvedValueArguments == null) return null;
|
||||
if (resolvedValueArguments.size() != 1) return null;
|
||||
List<ValueArgument> valueArguments = resolvedValueArguments.get(0).getArguments();
|
||||
if (valueArguments.size() != 1) return null;
|
||||
return valueArguments.get(0).getArgumentExpression();
|
||||
}
|
||||
|
||||
private OwnerKind contextKind() {
|
||||
return context.getContextKind();
|
||||
}
|
||||
@@ -765,9 +800,15 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
|
||||
// This method consumes range/progression from stack
|
||||
// The result is stored to local variable
|
||||
protected void generateRangeOrProgressionProperty(Type loopRangeType, String getterName, Type elementType, int varToStore) {
|
||||
v.invokevirtual(loopRangeType.getInternalName(), getterName, "()" + elementType.getDescriptor(), false);
|
||||
v.store(varToStore, elementType);
|
||||
protected void generateRangeOrProgressionProperty(
|
||||
@NotNull Type loopRangeType,
|
||||
@NotNull String getterName,
|
||||
@NotNull Type getterReturnType,
|
||||
@NotNull Type varType,
|
||||
int varToStore
|
||||
) {
|
||||
v.invokevirtual(loopRangeType.getInternalName(), getterName, "()" + getterReturnType.getDescriptor(), false);
|
||||
StackValue.local(varToStore, varType).store(StackValue.onStack(getterReturnType), v);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -922,6 +963,8 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
private abstract class AbstractForInProgressionOrRangeLoopGenerator extends AbstractForLoopGenerator {
|
||||
protected int endVar;
|
||||
|
||||
private StackValue loopParameter;
|
||||
|
||||
private AbstractForInProgressionOrRangeLoopGenerator(@NotNull KtForExpression forExpression) {
|
||||
super(forExpression);
|
||||
|
||||
@@ -948,8 +991,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
protected void checkPostCondition(@NotNull Label loopExit) {
|
||||
assert endVar != -1 :
|
||||
"endVar must be allocated, endVar = " + endVar;
|
||||
|
||||
v.load(loopParameterVar, asmElementType);
|
||||
loopParameter().put(asmElementType, v);
|
||||
v.load(endVar, asmElementType);
|
||||
if (asmElementType.getSort() == Type.LONG) {
|
||||
v.lcmp();
|
||||
@@ -963,11 +1005,27 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
@Override
|
||||
public void checkPreCondition(@NotNull Label loopExit) {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected StackValue loopParameter() {
|
||||
if (loopParameter == null) {
|
||||
loopParameter = StackValue.local(loopParameterVar, loopParameterType);
|
||||
}
|
||||
return loopParameter;
|
||||
}
|
||||
}
|
||||
|
||||
private abstract class AbstractForInRangeLoopGenerator extends AbstractForInProgressionOrRangeLoopGenerator {
|
||||
private AbstractForInRangeLoopGenerator(@NotNull KtForExpression forExpression) {
|
||||
private final int step;
|
||||
|
||||
private AbstractForInRangeLoopGenerator(@NotNull KtForExpression forExpression, int step) {
|
||||
super(forExpression);
|
||||
this.step = step;
|
||||
assert step == 1 || step == -1 : "'step' should be either 1 or -1: " + step;
|
||||
}
|
||||
|
||||
private AbstractForInRangeLoopGenerator(@NotNull KtForExpression forExpression) {
|
||||
this(forExpression, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -981,15 +1039,24 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
|
||||
@Override
|
||||
public void checkEmptyLoop(@NotNull Label loopExit) {
|
||||
|
||||
v.load(loopParameterVar, asmElementType);
|
||||
loopParameter().put(asmElementType, v);
|
||||
v.load(endVar, asmElementType);
|
||||
if (asmElementType.getSort() == Type.LONG) {
|
||||
v.lcmp();
|
||||
v.ifgt(loopExit);
|
||||
if (step > 0) {
|
||||
v.ifgt(loopExit);
|
||||
}
|
||||
else {
|
||||
v.iflt(loopExit);
|
||||
}
|
||||
}
|
||||
else {
|
||||
v.ificmpgt(loopExit);
|
||||
if (step > 0) {
|
||||
v.ificmpgt(loopExit);
|
||||
}
|
||||
else {
|
||||
v.ificmplt(loopExit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1001,35 +1068,49 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
protected void increment(@NotNull Label loopExit) {
|
||||
checkPostCondition(loopExit);
|
||||
|
||||
if (asmElementType == Type.INT_TYPE) {
|
||||
v.iinc(loopParameterVar, 1);
|
||||
if (loopParameterType == Type.INT_TYPE) {
|
||||
v.iinc(loopParameterVar, step);
|
||||
}
|
||||
else {
|
||||
v.load(loopParameterVar, asmElementType);
|
||||
genIncrement(asmElementType, 1, v);
|
||||
v.store(loopParameterVar, asmElementType);
|
||||
StackValue loopParameter = loopParameter();
|
||||
loopParameter.put(asmElementType, v);
|
||||
genIncrement(asmElementType, step, v);
|
||||
loopParameter.store(StackValue.onStack(asmElementType), v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ForInRangeLiteralLoopGenerator extends AbstractForInRangeLoopGenerator {
|
||||
private final RangeCodegenUtil.BinaryCall rangeCall;
|
||||
private final ReceiverValue from;
|
||||
private final KtExpression to;
|
||||
|
||||
private ForInRangeLiteralLoopGenerator(
|
||||
@NotNull KtForExpression forExpression,
|
||||
@NotNull RangeCodegenUtil.BinaryCall rangeCall
|
||||
) {
|
||||
private ForInRangeLiteralLoopGenerator(@NotNull KtForExpression forExpression, @NotNull ResolvedCall<?> loopRangeCall) {
|
||||
super(forExpression);
|
||||
this.rangeCall = rangeCall;
|
||||
this.from = loopRangeCall.getDispatchReceiver();
|
||||
this.to = getSingleArgumentExpression(loopRangeCall);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void storeRangeStartAndEnd() {
|
||||
gen(rangeCall.left, asmElementType);
|
||||
v.store(loopParameterVar, asmElementType);
|
||||
loopParameter().store(generateReceiverValue(from, false), v);
|
||||
StackValue.local(endVar, asmElementType).store(gen(to), v);
|
||||
}
|
||||
}
|
||||
|
||||
gen(rangeCall.right, asmElementType);
|
||||
v.store(endVar, asmElementType);
|
||||
private class ForInDownToProgressionLoopGenerator extends AbstractForInRangeLoopGenerator {
|
||||
private final ReceiverValue from;
|
||||
private final KtExpression to;
|
||||
|
||||
private ForInDownToProgressionLoopGenerator(@NotNull KtForExpression forExpression, @NotNull ResolvedCall<?> loopRangeCall) {
|
||||
super(forExpression, -1);
|
||||
this.from = loopRangeCall.getExtensionReceiver();
|
||||
this.to = getSingleArgumentExpression(loopRangeCall);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void storeRangeStartAndEnd() {
|
||||
loopParameter().store(generateReceiverValue(from, false), v);
|
||||
StackValue.local(endVar, asmElementType).store(gen(to), v);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1047,8 +1128,59 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
v.dup();
|
||||
|
||||
// ranges inherit first and last from corresponding progressions
|
||||
generateRangeOrProgressionProperty(asmLoopRangeType, "getFirst", asmElementType, loopParameterVar);
|
||||
generateRangeOrProgressionProperty(asmLoopRangeType, "getLast", asmElementType, endVar);
|
||||
generateRangeOrProgressionProperty(asmLoopRangeType, "getFirst", asmElementType, loopParameterType, loopParameterVar);
|
||||
generateRangeOrProgressionProperty(asmLoopRangeType, "getLast", asmElementType, asmElementType, endVar);
|
||||
}
|
||||
}
|
||||
|
||||
private abstract class ForInOptimizedIndicesLoopGenerator extends AbstractForInRangeLoopGenerator {
|
||||
protected final ReceiverValue receiverValue;
|
||||
protected final KotlinType expectedReceiverType;
|
||||
|
||||
private ForInOptimizedIndicesLoopGenerator(@NotNull KtForExpression forExpression, @NotNull ResolvedCall<?> loopRangeCall) {
|
||||
super(forExpression);
|
||||
this.receiverValue = loopRangeCall.getExtensionReceiver();
|
||||
this.expectedReceiverType = getExpectedReceiverType(loopRangeCall);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void storeRangeStartAndEnd() {
|
||||
loopParameter().store(StackValue.constant(0, asmElementType), v);
|
||||
|
||||
StackValue receiver = generateReceiverValue(receiverValue, false);
|
||||
Type receiverType = asmType(expectedReceiverType);
|
||||
receiver.put(receiverType, v);
|
||||
getReceiverSizeAsInt();
|
||||
v.iconst(1);
|
||||
v.sub(Type.INT_TYPE);
|
||||
StackValue.local(endVar, asmElementType).store(StackValue.onStack(Type.INT_TYPE), v);
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>(receiver -> size:I)</code>
|
||||
*/
|
||||
protected abstract void getReceiverSizeAsInt();
|
||||
}
|
||||
|
||||
private class ForInCollectionIndicesRangeLoopGenerator extends ForInOptimizedIndicesLoopGenerator {
|
||||
private ForInCollectionIndicesRangeLoopGenerator(@NotNull KtForExpression forExpression, @NotNull ResolvedCall<?> loopRangeCall) {
|
||||
super(forExpression, loopRangeCall);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getReceiverSizeAsInt() {
|
||||
v.invokeinterface("java/util/Collection", "size", "()I");
|
||||
}
|
||||
}
|
||||
|
||||
private class ForInArrayIndicesRangeLoopGenerator extends ForInOptimizedIndicesLoopGenerator {
|
||||
private ForInArrayIndicesRangeLoopGenerator(@NotNull KtForExpression forExpression, @NotNull ResolvedCall<?> loopRangeCall) {
|
||||
super(forExpression, loopRangeCall);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getReceiverSizeAsInt() {
|
||||
v.arraylength();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1079,15 +1211,14 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
v.dup();
|
||||
v.dup();
|
||||
|
||||
generateRangeOrProgressionProperty(asmLoopRangeType, "getFirst", asmElementType, loopParameterVar);
|
||||
generateRangeOrProgressionProperty(asmLoopRangeType, "getLast", asmElementType, endVar);
|
||||
generateRangeOrProgressionProperty(asmLoopRangeType, "getStep", incrementType, incrementVar);
|
||||
generateRangeOrProgressionProperty(asmLoopRangeType, "getFirst", asmElementType, loopParameterType, loopParameterVar);
|
||||
generateRangeOrProgressionProperty(asmLoopRangeType, "getLast", asmElementType, asmElementType, endVar);
|
||||
generateRangeOrProgressionProperty(asmLoopRangeType, "getStep", incrementType, incrementType, incrementVar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkEmptyLoop(@NotNull Label loopExit) {
|
||||
|
||||
v.load(loopParameterVar, asmElementType);
|
||||
loopParameter().put(asmElementType, v);
|
||||
v.load(endVar, asmElementType);
|
||||
v.load(incrementVar, incrementType);
|
||||
|
||||
@@ -1132,7 +1263,8 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
protected void increment(@NotNull Label loopExit) {
|
||||
checkPostCondition(loopExit);
|
||||
|
||||
v.load(loopParameterVar, asmElementType);
|
||||
StackValue loopParameter = loopParameter();
|
||||
loopParameter.put(asmElementType, v);
|
||||
v.load(incrementVar, asmElementType);
|
||||
v.add(asmElementType);
|
||||
|
||||
@@ -1140,7 +1272,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
StackValue.coerce(Type.INT_TYPE, asmElementType, v);
|
||||
}
|
||||
|
||||
v.store(loopParameterVar, asmElementType);
|
||||
loopParameter.store(StackValue.onStack(asmElementType), v);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1163,44 +1295,44 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
) {
|
||||
assert expression instanceof KtContinueExpression || expression instanceof KtBreakExpression;
|
||||
|
||||
if (!blockStackElements.isEmpty()) {
|
||||
BlockStackElement stackElement = blockStackElements.peek();
|
||||
|
||||
if (stackElement instanceof FinallyBlockStackElement) {
|
||||
FinallyBlockStackElement finallyBlockStackElement = (FinallyBlockStackElement) stackElement;
|
||||
//noinspection ConstantConditions
|
||||
genFinallyBlockOrGoto(finallyBlockStackElement, null, afterBreakContinueLabel);
|
||||
}
|
||||
else if (stackElement instanceof LoopBlockStackElement) {
|
||||
LoopBlockStackElement loopBlockStackElement = (LoopBlockStackElement) stackElement;
|
||||
KtSimpleNameExpression labelElement = expression.getTargetLabel();
|
||||
//noinspection ConstantConditions
|
||||
if (labelElement == null ||
|
||||
loopBlockStackElement.targetLabel != null &&
|
||||
labelElement.getReferencedName().equals(loopBlockStackElement.targetLabel.getReferencedName())) {
|
||||
final Label label = isBreak ? loopBlockStackElement.breakLabel : loopBlockStackElement.continueLabel;
|
||||
return StackValue.operation(Type.VOID_TYPE, new Function1<InstructionAdapter, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(InstructionAdapter adapter) {
|
||||
PseudoInsnsKt.fixStackAndJump(v, label);
|
||||
v.mark(afterBreakContinueLabel);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new UnsupportedOperationException("Wrong BlockStackElement in processing stack");
|
||||
}
|
||||
|
||||
blockStackElements.pop();
|
||||
StackValue result = generateBreakOrContinueExpression(expression, isBreak, afterBreakContinueLabel);
|
||||
blockStackElements.push(stackElement);
|
||||
return result;
|
||||
if (blockStackElements.isEmpty()) {
|
||||
throw new UnsupportedOperationException("Target label for break/continue not found");
|
||||
}
|
||||
|
||||
throw new UnsupportedOperationException("Target label for break/continue not found");
|
||||
BlockStackElement stackElement = blockStackElements.peek();
|
||||
|
||||
if (stackElement instanceof FinallyBlockStackElement) {
|
||||
FinallyBlockStackElement finallyBlockStackElement = (FinallyBlockStackElement) stackElement;
|
||||
//noinspection ConstantConditions
|
||||
genFinallyBlockOrGoto(finallyBlockStackElement, null, afterBreakContinueLabel);
|
||||
}
|
||||
else if (stackElement instanceof LoopBlockStackElement) {
|
||||
LoopBlockStackElement loopBlockStackElement = (LoopBlockStackElement) stackElement;
|
||||
KtSimpleNameExpression labelElement = expression.getTargetLabel();
|
||||
//noinspection ConstantConditions
|
||||
if (labelElement == null ||
|
||||
loopBlockStackElement.targetLabel != null &&
|
||||
labelElement.getReferencedName().equals(loopBlockStackElement.targetLabel.getReferencedName())) {
|
||||
final Label label = isBreak ? loopBlockStackElement.breakLabel : loopBlockStackElement.continueLabel;
|
||||
return StackValue.operation(Type.VOID_TYPE, new Function1<InstructionAdapter, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(InstructionAdapter adapter) {
|
||||
PseudoInsnsKt.fixStackAndJump(v, label);
|
||||
v.mark(afterBreakContinueLabel);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new UnsupportedOperationException("Wrong BlockStackElement in processing stack");
|
||||
}
|
||||
|
||||
blockStackElements.pop();
|
||||
StackValue result = generateBreakOrContinueExpression(expression, isBreak, afterBreakContinueLabel);
|
||||
blockStackElements.push(stackElement);
|
||||
return result;
|
||||
}
|
||||
|
||||
private StackValue generateSingleBranchIf(
|
||||
@@ -1555,7 +1687,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
throw new IllegalStateException("Can't get outer value in " + this + " for " + d);
|
||||
}
|
||||
|
||||
private StackValue generateBlock(
|
||||
private StackValueWithLeaveTask generateBlock(
|
||||
List<KtExpression> statements,
|
||||
boolean isStatement,
|
||||
Label labelBeforeLastExpression,
|
||||
@@ -1983,8 +2115,14 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
VariableAsFunctionResolvedCall call = (VariableAsFunctionResolvedCall) resolvedCall;
|
||||
resolvedCall = call.getVariableCall();
|
||||
}
|
||||
receiver = StackValue.receiver(resolvedCall, receiver, this, null);
|
||||
|
||||
descriptor = resolvedCall.getResultingDescriptor();
|
||||
|
||||
//Check early if KCallableNameProperty is applicable to prevent closure generation
|
||||
StackValue intrinsicResult = applyIntrinsic(descriptor, KCallableNameProperty.class, resolvedCall, receiver);
|
||||
if (intrinsicResult != null) return intrinsicResult;
|
||||
|
||||
receiver = StackValue.receiver(resolvedCall, receiver, this, null);
|
||||
if (descriptor instanceof FakeCallableDescriptorForObject) {
|
||||
descriptor = ((FakeCallableDescriptorForObject) descriptor).getReferencedDescriptor();
|
||||
}
|
||||
@@ -1997,17 +2135,9 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
if (isSyntheticField) {
|
||||
descriptor = ((SyntheticFieldDescriptor) descriptor).getPropertyDescriptor();
|
||||
}
|
||||
if (descriptor instanceof CallableMemberDescriptor) {
|
||||
CallableMemberDescriptor memberDescriptor = DescriptorUtils.unwrapFakeOverride((CallableMemberDescriptor) descriptor);
|
||||
|
||||
IntrinsicMethod intrinsic = state.getIntrinsics().getIntrinsic(memberDescriptor);
|
||||
if (intrinsic instanceof IntrinsicPropertyGetter) {
|
||||
//TODO: intrinsic properties (see intermediateValueForProperty)
|
||||
Type returnType = typeMapper.mapType(memberDescriptor);
|
||||
StackValue intrinsicResult = ((IntrinsicPropertyGetter) intrinsic).generate(resolvedCall, this, returnType, receiver);
|
||||
if (intrinsicResult != null) return intrinsicResult;
|
||||
}
|
||||
}
|
||||
StackValue intrinsicResult = applyIntrinsic(descriptor, IntrinsicPropertyGetter.class, resolvedCall, receiver);
|
||||
if (intrinsicResult != null) return intrinsicResult;
|
||||
|
||||
if (descriptor instanceof PropertyDescriptor) {
|
||||
PropertyDescriptor propertyDescriptor = (PropertyDescriptor) descriptor;
|
||||
@@ -2056,6 +2186,25 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
throw new UnsupportedOperationException("don't know how to generate reference " + descriptor);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private StackValue applyIntrinsic(
|
||||
DeclarationDescriptor descriptor,
|
||||
Class<? extends IntrinsicPropertyGetter> intrinsicType,
|
||||
ResolvedCall<?> resolvedCall,
|
||||
@NotNull StackValue receiver
|
||||
) {
|
||||
if (descriptor instanceof CallableMemberDescriptor) {
|
||||
CallableMemberDescriptor memberDescriptor = DescriptorUtils.unwrapFakeOverride((CallableMemberDescriptor) descriptor);
|
||||
IntrinsicMethod intrinsic = state.getIntrinsics().getIntrinsic(memberDescriptor);
|
||||
if (intrinsicType.isInstance(intrinsic)) {
|
||||
//TODO: intrinsic properties (see intermediateValueForProperty)
|
||||
Type returnType = typeMapper.mapType(memberDescriptor);
|
||||
return ((IntrinsicPropertyGetter) intrinsic).generate(resolvedCall, this, returnType, receiver);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private ClassDescriptor getSuperCallTarget(@NotNull Call call) {
|
||||
KtSuperExpression superExpression = CallResolverUtilKt.getSuperCallExpression(call);
|
||||
@@ -2718,7 +2867,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
if (hasSpread) {
|
||||
boolean arrayOfReferences = KotlinBuiltIns.isArray(outType);
|
||||
if (size == 1) {
|
||||
// Arrays.copyOf(array, newLength)
|
||||
// Arrays.copyOf(receiverValue, newLength)
|
||||
ValueArgument argument = arguments.get(0);
|
||||
Type arrayType = arrayOfReferences ? Type.getType("[Ljava/lang/Object;")
|
||||
: Type.getType("[" + elementType.getDescriptor());
|
||||
@@ -2836,7 +2985,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
|
||||
PropertyReferenceCodegen codegen = new PropertyReferenceCodegen(
|
||||
state, parentCodegen, context.intoAnonymousClass(classDescriptor, this, OwnerKind.IMPLEMENTATION),
|
||||
element, classBuilder, resolvedCall
|
||||
element, classBuilder, variableDescriptor, resolvedCall
|
||||
);
|
||||
codegen.generate();
|
||||
|
||||
@@ -3334,7 +3483,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
|
||||
Type storeType;
|
||||
if (isPrimitiveNumberClassDescriptor && AsmUtil.isPrimitive(asmBaseType)) {
|
||||
genIncrement(asmResultType, asmBaseType, increment, v);
|
||||
genIncrement(asmBaseType, increment, v);
|
||||
storeType = asmBaseType;
|
||||
}
|
||||
else {
|
||||
@@ -3958,7 +4107,7 @@ The "returned" value of try expression with no finally is either the last expres
|
||||
}
|
||||
|
||||
private boolean isExhaustive(@NotNull KtWhenExpression whenExpression, boolean isStatement) {
|
||||
if (isStatement) {
|
||||
if (isStatement && !BindingContextUtilsKt.isUsedAsExpression(whenExpression, bindingContext)) {
|
||||
return Boolean.TRUE.equals(bindingContext.get(BindingContext.IMPLICIT_EXHAUSTIVE_WHEN, whenExpression));
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -22,30 +22,25 @@ import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatform;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
|
||||
import static org.jetbrains.kotlin.resolve.DescriptorUtils.isNonCompanionObject;
|
||||
|
||||
public class FieldInfo {
|
||||
|
||||
private static final CompanionObjectMapping COMPANION_OBJECT_MAPPING = new CompanionObjectMapping(JvmPlatform.INSTANCE.getBuiltIns());
|
||||
|
||||
@NotNull
|
||||
public static FieldInfo createForSingleton(@NotNull ClassDescriptor classDescriptor, @NotNull KotlinTypeMapper typeMapper) {
|
||||
if (!classDescriptor.getKind().isSingleton() || DescriptorUtils.isEnumEntry(classDescriptor)) {
|
||||
throw new UnsupportedOperationException("Can't create singleton field for class: " + classDescriptor);
|
||||
}
|
||||
|
||||
if (isNonCompanionObject(classDescriptor) || COMPANION_OBJECT_MAPPING.hasMappingToObject(classDescriptor)) {
|
||||
if (isNonCompanionObject(classDescriptor) || CompanionObjectMapping.INSTANCE.isMappedIntrinsicCompanionObject(classDescriptor)) {
|
||||
return createSingletonViaInstance(classDescriptor, typeMapper);
|
||||
}
|
||||
else {
|
||||
ClassDescriptor ownerDescriptor = DescriptorUtils.getParentOfType(classDescriptor, ClassDescriptor.class);
|
||||
assert ownerDescriptor != null : "Owner not found for class: " + classDescriptor;
|
||||
Type ownerType = typeMapper.mapType(ownerDescriptor);
|
||||
return new FieldInfo(ownerType, typeMapper.mapType(classDescriptor), classDescriptor.getName().asString(), true);
|
||||
}
|
||||
|
||||
ClassDescriptor ownerDescriptor = DescriptorUtils.getParentOfType(classDescriptor, ClassDescriptor.class);
|
||||
assert ownerDescriptor != null : "Owner not found for class: " + classDescriptor;
|
||||
Type ownerType = typeMapper.mapType(ownerDescriptor);
|
||||
return new FieldInfo(ownerType, typeMapper.mapType(classDescriptor), classDescriptor.getName().asString(), true);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -36,11 +36,9 @@ import org.jetbrains.kotlin.descriptors.*;
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotated;
|
||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor;
|
||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget;
|
||||
import org.jetbrains.kotlin.jvm.RuntimeAssertionInfo;
|
||||
import org.jetbrains.kotlin.load.java.BuiltinMethodsWithSpecialGenericSignature;
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi;
|
||||
import org.jetbrains.kotlin.load.java.SpecialBuiltinMembers;
|
||||
import org.jetbrains.kotlin.load.kotlin.nativeDeclarations.NativeKt;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
import org.jetbrains.kotlin.psi.KtElement;
|
||||
import org.jetbrains.kotlin.psi.KtFunction;
|
||||
@@ -49,11 +47,11 @@ import org.jetbrains.kotlin.resolve.BindingContext;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||
import org.jetbrains.kotlin.resolve.annotations.AnnotationUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.calls.callResolverUtil.CallResolverUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.constants.ArrayValue;
|
||||
import org.jetbrains.kotlin.resolve.constants.ConstantValue;
|
||||
import org.jetbrains.kotlin.resolve.constants.KClassValue;
|
||||
import org.jetbrains.kotlin.resolve.inline.InlineUtil;
|
||||
import org.jetbrains.kotlin.resolve.jvm.RuntimeAssertionInfo;
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin;
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKind;
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKt;
|
||||
@@ -169,9 +167,7 @@ public class FunctionCodegen {
|
||||
flags |= ACC_SYNTHETIC;
|
||||
}
|
||||
|
||||
boolean isNative = NativeKt.hasNativeAnnotation(functionDescriptor);
|
||||
|
||||
if (isNative && owner instanceof MultifileClassFacadeContext) {
|
||||
if (functionDescriptor.isExternal() && owner instanceof MultifileClassFacadeContext) {
|
||||
// Native methods are only defined in facades and do not need package part implementations
|
||||
return;
|
||||
}
|
||||
@@ -198,7 +194,7 @@ public class FunctionCodegen {
|
||||
parentBodyCodegen.addAdditionalTask(new JvmStaticGenerator(functionDescriptor, origin, state, parentBodyCodegen));
|
||||
}
|
||||
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.LIGHT_CLASSES || isAbstractMethod(functionDescriptor, contextKind)) {
|
||||
if (!state.getClassBuilderMode().generateBodies || isAbstractMethod(functionDescriptor, contextKind)) {
|
||||
generateLocalVariableTable(
|
||||
mv,
|
||||
jvmSignature,
|
||||
@@ -213,7 +209,7 @@ public class FunctionCodegen {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isNative) {
|
||||
if (!functionDescriptor.isExternal()) {
|
||||
generateMethodBody(mv, functionDescriptor, methodContext, jvmSignature, strategy, memberCodegen);
|
||||
}
|
||||
else if (staticInCompanionObject) {
|
||||
@@ -564,9 +560,6 @@ public class FunctionCodegen {
|
||||
// equals(Any?), hashCode(), toString() never need bridges
|
||||
if (isMethodOfAny(descriptor)) return;
|
||||
|
||||
// If the function doesn't have a physical declaration among super-functions, it's a SAM adapter or alike and doesn't need bridges
|
||||
if (CallResolverUtilKt.isOrOverridesSynthesized(descriptor)) return;
|
||||
|
||||
boolean isSpecial = SpecialBuiltinMembers.getOverriddenBuiltinReflectingJvmDescriptor(descriptor) != null;
|
||||
|
||||
Set<Bridge<Method>> bridgesToGenerate;
|
||||
@@ -706,7 +699,7 @@ public class FunctionCodegen {
|
||||
// enum constructors have two additional synthetic parameters which somewhat complicate this task
|
||||
AnnotationCodegen.forMethod(mv, typeMapper).genAnnotations(functionDescriptor, defaultMethod.getReturnType());
|
||||
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
if (state.getClassBuilderMode().generateBodies) {
|
||||
if (this.owner instanceof MultifileClassFacadeContext) {
|
||||
mv.visitCode();
|
||||
generateFacadeDelegateMethodBody(mv, defaultMethod, (MultifileClassFacadeContext) this.owner);
|
||||
@@ -880,7 +873,7 @@ public class FunctionCodegen {
|
||||
|
||||
MethodVisitor mv =
|
||||
v.newMethod(JvmDeclarationOriginKt.Bridge(descriptor, origin), flags, bridge.getName(), bridge.getDescriptor(), null, null);
|
||||
if (state.getClassBuilderMode() != ClassBuilderMode.FULL) return;
|
||||
if (!state.getClassBuilderMode().generateBodies) return;
|
||||
|
||||
mv.visitCode();
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import kotlin.jvm.functions.Function2;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.backend.common.CodegenUtil;
|
||||
import org.jetbrains.kotlin.backend.common.CodegenUtilKt;
|
||||
import org.jetbrains.kotlin.backend.common.DataClassMethodGenerator;
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
|
||||
import org.jetbrains.kotlin.codegen.binding.MutableClosure;
|
||||
@@ -50,7 +49,6 @@ import org.jetbrains.kotlin.psi.*;
|
||||
import org.jetbrains.kotlin.resolve.BindingContext;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||
import org.jetbrains.kotlin.resolve.calls.callResolverUtil.CallResolverUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.CallUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.calls.model.DefaultValueArgument;
|
||||
import org.jetbrains.kotlin.resolve.calls.model.ExpressionValueArgument;
|
||||
@@ -158,7 +156,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
|
||||
if (!ktClass.hasModifier(KtTokens.OPEN_KEYWORD) && !isAbstract) {
|
||||
// Light-class mode: Do not make enum classes final since PsiClass corresponding to enum is expected to be inheritable from
|
||||
isFinal = !(ktClass.isEnum() && state.getClassBuilderMode() == ClassBuilderMode.LIGHT_CLASSES);
|
||||
isFinal = !(ktClass.isEnum() && !state.getClassBuilderMode().generateBodies);
|
||||
}
|
||||
isStatic = !ktClass.isInner();
|
||||
}
|
||||
@@ -169,8 +167,8 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
|
||||
int access = 0;
|
||||
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.LIGHT_CLASSES && !DescriptorUtils.isTopLevelDeclaration(descriptor)) {
|
||||
// ClassBuilderMode.LIGHT_CLASSES means we are generating light classes & looking at a nested or inner class
|
||||
if (!state.getClassBuilderMode().generateBodies && !DescriptorUtils.isTopLevelDeclaration(descriptor)) {
|
||||
// !ClassBuilderMode.generateBodies means we are generating light classes & looking at a nested or inner class
|
||||
// Light class generation is implemented so that Cls-classes only read bare code of classes,
|
||||
// without knowing whether these classes are inner or not (see ClassStubBuilder.EMPTY_STRATEGY)
|
||||
// Thus we must write full accessibility flags on inner classes in this mode
|
||||
@@ -265,7 +263,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
|
||||
private void writeEnclosingMethod() {
|
||||
// Do not emit enclosing method in "light-classes mode" since currently we generate local light classes as if they're top level
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.LIGHT_CLASSES) {
|
||||
if (!state.getClassBuilderMode().generateBodies) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -412,72 +410,78 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isGenericToArrayPresent() {
|
||||
Collection<SimpleFunctionDescriptor> functions =
|
||||
descriptor.getDefaultType().getMemberScope().getContributedFunctions(Name.identifier("toArray"), NoLookupLocation.FROM_BACKEND);
|
||||
for (FunctionDescriptor function : functions) {
|
||||
if (CallResolverUtilKt.isOrOverridesSynthesized(function)) {
|
||||
continue;
|
||||
}
|
||||
private boolean isGenericToArray(@NotNull FunctionDescriptor function) {
|
||||
if (function.getValueParameters().size() != 1 || function.getTypeParameters().size() != 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (function.getValueParameters().size() != 1 || function.getTypeParameters().size() != 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
KotlinType returnType = function.getReturnType();
|
||||
assert returnType != null : function.toString();
|
||||
KotlinType paramType = function.getValueParameters().get(0).getType();
|
||||
if (KotlinBuiltIns.isArray(returnType) && KotlinBuiltIns.isArray(paramType)) {
|
||||
KotlinType elementType = function.getTypeParameters().get(0).getDefaultType();
|
||||
if (KotlinTypeChecker.DEFAULT.equalTypes(elementType, DescriptorUtilsKt.getBuiltIns(descriptor).getArrayElementType(returnType))
|
||||
&& KotlinTypeChecker.DEFAULT.equalTypes(elementType, DescriptorUtilsKt
|
||||
.getBuiltIns(descriptor).getArrayElementType(paramType))) {
|
||||
return true;
|
||||
}
|
||||
KotlinType returnType = function.getReturnType();
|
||||
assert returnType != null : function.toString();
|
||||
KotlinType paramType = function.getValueParameters().get(0).getType();
|
||||
if (KotlinBuiltIns.isArray(returnType) && KotlinBuiltIns.isArray(paramType)) {
|
||||
KotlinType elementType = function.getTypeParameters().get(0).getDefaultType();
|
||||
KotlinBuiltIns builtIns = DescriptorUtilsKt.getBuiltIns(descriptor);
|
||||
if (KotlinTypeChecker.DEFAULT.equalTypes(elementType, builtIns.getArrayElementType(returnType))
|
||||
&& KotlinTypeChecker.DEFAULT.equalTypes(elementType, builtIns.getArrayElementType(paramType))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean isNonGenericToArray(@NotNull FunctionDescriptor function) {
|
||||
if (!function.getValueParameters().isEmpty() || !function.getTypeParameters().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
KotlinType returnType = function.getReturnType();
|
||||
return returnType != null && KotlinBuiltIns.isArray(returnType);
|
||||
}
|
||||
|
||||
private void generateToArray() {
|
||||
if (descriptor.getKind() == ClassKind.INTERFACE) return;
|
||||
|
||||
KotlinBuiltIns builtIns = DescriptorUtilsKt.getBuiltIns(descriptor);
|
||||
if (!isSubclass(descriptor, builtIns.getCollection())) return;
|
||||
|
||||
int access = descriptor.getKind() == ClassKind.INTERFACE ?
|
||||
ACC_PUBLIC | ACC_ABSTRACT :
|
||||
ACC_PUBLIC;
|
||||
if (CodegenUtil.getDeclaredFunctionByRawSignature(descriptor, Name.identifier("toArray"), builtIns.getArray()) == null) {
|
||||
MethodVisitor mv = v.newMethod(NO_ORIGIN, access, "toArray", "()[Ljava/lang/Object;", null, null);
|
||||
|
||||
if (descriptor.getKind() != ClassKind.INTERFACE) {
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
mv.visitCode();
|
||||
|
||||
iv.load(0, classAsmType);
|
||||
iv.invokestatic("kotlin/jvm/internal/CollectionToArray", "toArray", "(Ljava/util/Collection;)[Ljava/lang/Object;", false);
|
||||
iv.areturn(Type.getType("[Ljava/lang/Object;"));
|
||||
|
||||
FunctionCodegen.endVisit(mv, "toArray", myClass);
|
||||
}
|
||||
Collection<SimpleFunctionDescriptor> functions = descriptor.getDefaultType().getMemberScope().getContributedFunctions(
|
||||
Name.identifier("toArray"), NoLookupLocation.FROM_BACKEND
|
||||
);
|
||||
boolean hasGenericToArray = false;
|
||||
boolean hasNonGenericToArray = false;
|
||||
for (FunctionDescriptor function : functions) {
|
||||
hasGenericToArray |= isGenericToArray(function);
|
||||
hasNonGenericToArray |= isNonGenericToArray(function);
|
||||
}
|
||||
|
||||
if (!isGenericToArrayPresent()) {
|
||||
MethodVisitor mv = v.newMethod(NO_ORIGIN, access, "toArray", "([Ljava/lang/Object;)[Ljava/lang/Object;", null, null);
|
||||
if (!hasNonGenericToArray) {
|
||||
MethodVisitor mv = v.newMethod(NO_ORIGIN, ACC_PUBLIC, "toArray", "()[Ljava/lang/Object;", null, null);
|
||||
|
||||
if (descriptor.getKind() != ClassKind.INTERFACE) {
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
mv.visitCode();
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
mv.visitCode();
|
||||
|
||||
iv.load(0, classAsmType);
|
||||
iv.load(1, Type.getType("[Ljava/lang/Object;"));
|
||||
iv.load(0, classAsmType);
|
||||
iv.invokestatic("kotlin/jvm/internal/CollectionToArray", "toArray", "(Ljava/util/Collection;)[Ljava/lang/Object;", false);
|
||||
iv.areturn(Type.getType("[Ljava/lang/Object;"));
|
||||
|
||||
iv.invokestatic("kotlin/jvm/internal/CollectionToArray", "toArray",
|
||||
"(Ljava/util/Collection;[Ljava/lang/Object;)[Ljava/lang/Object;", false);
|
||||
iv.areturn(Type.getType("[Ljava/lang/Object;"));
|
||||
FunctionCodegen.endVisit(mv, "toArray", myClass);
|
||||
}
|
||||
|
||||
FunctionCodegen.endVisit(mv, "toArray", myClass);
|
||||
}
|
||||
if (!hasGenericToArray) {
|
||||
MethodVisitor mv = v.newMethod(NO_ORIGIN, ACC_PUBLIC, "toArray", "([Ljava/lang/Object;)[Ljava/lang/Object;", null, null);
|
||||
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
mv.visitCode();
|
||||
|
||||
iv.load(0, classAsmType);
|
||||
iv.load(1, Type.getType("[Ljava/lang/Object;"));
|
||||
|
||||
iv.invokestatic("kotlin/jvm/internal/CollectionToArray", "toArray",
|
||||
"(Ljava/util/Collection;[Ljava/lang/Object;)[Ljava/lang/Object;", false);
|
||||
iv.areturn(Type.getType("[Ljava/lang/Object;"));
|
||||
|
||||
FunctionCodegen.endVisit(mv, "toArray", myClass);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -496,7 +500,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateEqualsMethod(@NotNull FunctionDescriptor function, @NotNull List<PropertyDescriptor> properties) {
|
||||
public void generateEqualsMethod(@NotNull FunctionDescriptor function, @NotNull List<? extends PropertyDescriptor> properties) {
|
||||
MethodContext context = ImplementationBodyCodegen.this.context.intoFunction(function);
|
||||
MethodVisitor mv = v.newMethod(JvmDeclarationOriginKt.OtherOrigin(function), ACC_PUBLIC, "equals", "(Ljava/lang/Object;)Z", null, null);
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
@@ -553,7 +557,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateHashCodeMethod(@NotNull FunctionDescriptor function, @NotNull List<PropertyDescriptor> properties) {
|
||||
public void generateHashCodeMethod(@NotNull FunctionDescriptor function, @NotNull List<? extends PropertyDescriptor> properties) {
|
||||
MethodContext context = ImplementationBodyCodegen.this.context.intoFunction(function);
|
||||
MethodVisitor mv = v.newMethod(JvmDeclarationOriginKt.OtherOrigin(function), ACC_PUBLIC, "hashCode", "()I", null, null);
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
@@ -602,7 +606,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateToStringMethod(@NotNull FunctionDescriptor function, @NotNull List<PropertyDescriptor> properties) {
|
||||
public void generateToStringMethod(@NotNull FunctionDescriptor function, @NotNull List<? extends PropertyDescriptor> properties) {
|
||||
MethodContext context = ImplementationBodyCodegen.this.context.intoFunction(function);
|
||||
MethodVisitor mv = v.newMethod(JvmDeclarationOriginKt.OtherOrigin(function), ACC_PUBLIC, "toString", "()Ljava/lang/String;", null, null);
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
@@ -654,7 +658,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
Type type = typeMapper.mapType(propertyDescriptor.getType());
|
||||
String fieldName = ((FieldOwnerContext) context.getParentContext()).getFieldName(propertyDescriptor, false);
|
||||
iv.getfield(classAsmType.getInternalName(), fieldName, type.getDescriptor());
|
||||
return type.getReturnType();
|
||||
return type;
|
||||
}
|
||||
else {
|
||||
//noinspection ConstantConditions
|
||||
@@ -692,7 +696,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateCopyFunction(@NotNull final FunctionDescriptor function, @NotNull List<KtParameter> constructorParameters) {
|
||||
public void generateCopyFunction(
|
||||
@NotNull final FunctionDescriptor function,
|
||||
@NotNull List<? extends KtParameter> constructorParameters
|
||||
) {
|
||||
final Type thisDescriptorType = typeMapper.mapType(descriptor);
|
||||
|
||||
functionCodegen.generateMethod(JvmDeclarationOriginKt.OtherOrigin(myClass, function), function, new FunctionGenerationStrategy() {
|
||||
@@ -801,7 +808,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
JvmDeclarationOriginKt.OtherOrigin(myClass, valuesFunction), ACC_PUBLIC | ACC_STATIC, ENUM_VALUES.asString(),
|
||||
"()" + type.getDescriptor(), null, null
|
||||
);
|
||||
if (state.getClassBuilderMode() != ClassBuilderMode.FULL) return;
|
||||
if (!state.getClassBuilderMode().generateBodies) return;
|
||||
|
||||
mv.visitCode();
|
||||
mv.visitFieldInsn(GETSTATIC, classAsmType.getInternalName(), ENUM_VALUES_FIELD_NAME, type.getDescriptor());
|
||||
@@ -821,7 +828,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
});
|
||||
MethodVisitor mv = v.newMethod(JvmDeclarationOriginKt.OtherOrigin(myClass, valueOfFunction), ACC_PUBLIC | ACC_STATIC, ENUM_VALUE_OF.asString(),
|
||||
"(Ljava/lang/String;)" + classAsmType.getDescriptor(), null, null);
|
||||
if (state.getClassBuilderMode() != ClassBuilderMode.FULL) return;
|
||||
if (!state.getClassBuilderMode().generateBodies) return;
|
||||
|
||||
mv.visitCode();
|
||||
mv.visitLdcInsn(classAsmType);
|
||||
@@ -841,7 +848,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
ACC_PUBLIC | ACC_STATIC | ACC_FINAL,
|
||||
field.name, field.type.getDescriptor(), null, null);
|
||||
|
||||
if (state.getClassBuilderMode() != ClassBuilderMode.FULL) return;
|
||||
if (!state.getClassBuilderMode().generateBodies) return;
|
||||
// Invoke the object constructor but ignore the result because INSTANCE will be initialized in the first line of <init>
|
||||
InstructionAdapter v = createOrGetClInitCodegen().v;
|
||||
markLineNumberForElement(element, v);
|
||||
@@ -881,7 +888,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
//This field are always static and final so if it has constant initializer don't do anything in clinit,
|
||||
//field would be initialized via default value in v.newField(...) - see JVM SPEC Ch.4
|
||||
// TODO: test this code
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.FULL && info.defaultValue == null) {
|
||||
if (state.getClassBuilderMode().generateBodies && info.defaultValue == null) {
|
||||
ExpressionCodegen codegen = createOrGetClInitCodegen();
|
||||
int companionObjectIndex = putCompanionObjectInLocalVar(codegen);
|
||||
StackValue.local(companionObjectIndex, OBJECT_TYPE).put(OBJECT_TYPE, codegen.v);
|
||||
@@ -1171,7 +1178,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
KotlinType expressionType = expression != null ? bindingContext.getType(expression) : null;
|
||||
Type asmType =
|
||||
expressionType != null ? typeMapper.mapType(expressionType) : typeMapper.mapType(getSuperClass(specifier));
|
||||
result.addField((KtDelegatedSuperTypeEntry) specifier, asmType, "$delegate_" + n);
|
||||
result.addField((KtDelegatedSuperTypeEntry) specifier, asmType, JvmAbi.DELEGATE_SUPER_FIELD_PREFIX + n);
|
||||
}
|
||||
n++;
|
||||
}
|
||||
@@ -1200,7 +1207,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
}
|
||||
|
||||
private void lookupConstructorExpressionsInClosureIfPresent() {
|
||||
if (state.getClassBuilderMode() != ClassBuilderMode.FULL || descriptor.getConstructors().isEmpty()) return;
|
||||
if (!state.getClassBuilderMode().generateBodies || descriptor.getConstructors().isEmpty()) return;
|
||||
|
||||
KtVisitorVoid visitor = new KtVisitorVoid() {
|
||||
@Override
|
||||
@@ -1267,6 +1274,11 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitSuperExpression(@NotNull KtSuperExpression expression) {
|
||||
lookupInContext(ExpressionCodegen.getSuperCallLabelTarget(context, expression));
|
||||
}
|
||||
};
|
||||
|
||||
for (KtDeclaration declaration : myClass.getDeclarations()) {
|
||||
@@ -1293,21 +1305,8 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
assert delegateExpression != null;
|
||||
delegateExpression.accept(visitor);
|
||||
}
|
||||
}
|
||||
|
||||
ClassDescriptor superClass = DescriptorUtilsKt.getSuperClassNotAny(descriptor);
|
||||
if (superClass != null) {
|
||||
if (superClass.isInner()) {
|
||||
context.lookupInContext(superClass.getContainingDeclaration(), StackValue.LOCAL_0, state, true);
|
||||
}
|
||||
|
||||
ConstructorDescriptor primaryConstructor = descriptor.getUnsubstitutedPrimaryConstructor();
|
||||
if (primaryConstructor != null && !isAnonymousObject(descriptor)) {
|
||||
ResolvedCall<ConstructorDescriptor> delegationCall = getDelegationConstructorCall(bindingContext, primaryConstructor);
|
||||
KtValueArgumentList argumentList = delegationCall != null ? delegationCall.getCall().getValueArgumentList() : null;
|
||||
if (argumentList != null) {
|
||||
argumentList.accept(visitor);
|
||||
}
|
||||
else if (specifier instanceof KtSuperTypeCallEntry) {
|
||||
specifier.accept(visitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1565,7 +1564,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
}
|
||||
|
||||
private void initializeEnumConstants(@NotNull List<KtEnumEntry> enumEntries) {
|
||||
if (state.getClassBuilderMode() != ClassBuilderMode.FULL) return;
|
||||
if (!state.getClassBuilderMode().generateBodies) return;
|
||||
|
||||
ExpressionCodegen codegen = createOrGetClInitCodegen();
|
||||
InstructionAdapter iv = codegen.v;
|
||||
@@ -1640,8 +1639,9 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
fieldInfo.name, fieldInfo.type.getDescriptor(), /*TODO*/null, null);
|
||||
}
|
||||
|
||||
protected void generateDelegates(ClassDescriptor toTrait, KotlinType delegateExpressionType, DelegationFieldsInfo.Field field) {
|
||||
for (Map.Entry<CallableMemberDescriptor, CallableDescriptor> entry : CodegenUtilKt.getDelegates(descriptor, toTrait, delegateExpressionType).entrySet()) {
|
||||
private void generateDelegates(ClassDescriptor toTrait, KotlinType delegateExpressionType, DelegationFieldsInfo.Field field) {
|
||||
for (Map.Entry<CallableMemberDescriptor, CallableDescriptor> entry :
|
||||
CodegenUtil.getDelegates(descriptor, toTrait, delegateExpressionType).entrySet()) {
|
||||
CallableMemberDescriptor callableMemberDescriptor = entry.getKey();
|
||||
CallableDescriptor delegateTo = entry.getValue();
|
||||
if (callableMemberDescriptor instanceof PropertyDescriptor) {
|
||||
|
||||
@@ -146,8 +146,27 @@ public class JvmCodegenUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only properties of the same class can be directly accessed, except when we are evaluating expressions in the debugger
|
||||
if (!isCallInsideSameClassAsDeclared(property, context) && !isDebuggerContext(context)) return false;
|
||||
if (!isCallInsideSameClassAsDeclared(property, context)) {
|
||||
if (!isDebuggerContext(context)) {
|
||||
// Unless we are evaluating expression in debugger context, only properties of the same class can be directly accessed
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
// In debugger we want to access through accessors if they are generated
|
||||
|
||||
// Non default accessors must always be generated
|
||||
for (PropertyAccessorDescriptor accessorDescriptor : property.getAccessors()) {
|
||||
if (!accessorDescriptor.isDefault()) {
|
||||
if (forGetter == accessorDescriptor instanceof PropertyGetterDescriptor) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If property overrides something, accessors must be generated too
|
||||
if (!property.getOverriddenDescriptors().isEmpty()) return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Delegated and extension properties have no backing fields
|
||||
if (isDelegated || property.getExtensionReceiverParameter() != null) return false;
|
||||
|
||||
@@ -109,9 +109,9 @@ public class JvmRuntimeTypes {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public KotlinType getSupertypeForPropertyReference(@NotNull PropertyDescriptor descriptor) {
|
||||
public KotlinType getSupertypeForPropertyReference(@NotNull PropertyDescriptor descriptor, boolean isMutable) {
|
||||
int arity = (descriptor.getExtensionReceiverParameter() != null ? 1 : 0) +
|
||||
(descriptor.getDispatchReceiverParameter() != null ? 1 : 0);
|
||||
return (descriptor.isVar() ? mutablePropertyReferences : propertyReferences).get(arity).getDefaultType();
|
||||
return (isMutable ? mutablePropertyReferences : propertyReferences).get(arity).getDefaultType();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,12 +82,13 @@ class JvmStaticGenerator(
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic fun createStaticFunctionDescriptor(descriptor: FunctionDescriptor): FunctionDescriptor {
|
||||
@JvmStatic
|
||||
fun createStaticFunctionDescriptor(descriptor: FunctionDescriptor): FunctionDescriptor {
|
||||
val memberDescriptor = if (descriptor is PropertyAccessorDescriptor) descriptor.correspondingProperty else descriptor
|
||||
val copies = CodegenUtil.copyFunctions(
|
||||
memberDescriptor,
|
||||
memberDescriptor,
|
||||
descriptor.containingDeclaration.containingDeclaration,
|
||||
descriptor.containingDeclaration.containingDeclaration!!,
|
||||
descriptor.modality,
|
||||
descriptor.visibility,
|
||||
CallableMemberDescriptor.Kind.SYNTHESIZED,
|
||||
|
||||
@@ -82,7 +82,7 @@ public class KotlinCodegenFacade {
|
||||
}
|
||||
|
||||
private static void doCheckCancelled(GenerationState state) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
if (state.getClassBuilderMode().generateBodies) {
|
||||
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ public abstract class MemberCodegen<T extends KtElement/* TODO: & JetDeclaration
|
||||
|
||||
generateSyntheticParts();
|
||||
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
if (state.getClassBuilderMode().generateMetadata) {
|
||||
generateKotlinMetadataAnnotation();
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ public abstract class MemberCodegen<T extends KtElement/* TODO: & JetDeclaration
|
||||
}
|
||||
|
||||
private static void badDescriptor(ClassDescriptor descriptor, ClassBuilderMode mode) {
|
||||
if (mode != ClassBuilderMode.LIGHT_CLASSES) {
|
||||
if (mode.generateBodies) {
|
||||
throw new IllegalStateException("Generating bad descriptor in ClassBuilderMode = " + mode + ": " + descriptor);
|
||||
}
|
||||
}
|
||||
@@ -408,10 +408,11 @@ public abstract class MemberCodegen<T extends KtElement/* TODO: & JetDeclaration
|
||||
|
||||
KtExpression initializer = property.getInitializer();
|
||||
|
||||
ConstantValue<?> initializerValue = computeInitializerValue(property, propertyDescriptor, initializer);
|
||||
ConstantValue<?> initializerValue =
|
||||
initializer != null ? ExpressionCodegen.getCompileTimeConstant(initializer, bindingContext) : null;
|
||||
// we must write constant values for fields in light classes,
|
||||
// because Java's completion for annotation arguments uses this information
|
||||
if (initializerValue == null) return state.getClassBuilderMode() != ClassBuilderMode.LIGHT_CLASSES;
|
||||
if (initializerValue == null) return state.getClassBuilderMode().generateBodies;
|
||||
|
||||
//TODO: OPTIMIZATION: don't initialize static final fields
|
||||
KotlinType jetType = getPropertyOrDelegateType(property, propertyDescriptor);
|
||||
@@ -419,19 +420,6 @@ public abstract class MemberCodegen<T extends KtElement/* TODO: & JetDeclaration
|
||||
return !skipDefaultValue(propertyDescriptor, initializerValue.getValue(), type);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private ConstantValue<?> computeInitializerValue(
|
||||
@NotNull KtProperty property,
|
||||
@NotNull PropertyDescriptor propertyDescriptor,
|
||||
@Nullable KtExpression initializer
|
||||
) {
|
||||
if (property.isVar() && initializer != null) {
|
||||
BindingTrace tempTrace = TemporaryBindingTrace.create(state.getBindingTrace(), "property initializer");
|
||||
return constantExpressionEvaluator.evaluateToConstantValue(initializer, tempTrace, propertyDescriptor.getType());
|
||||
}
|
||||
return propertyDescriptor.getCompileTimeInitializer();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private KotlinType getPropertyOrDelegateType(@NotNull KtProperty property, @NotNull PropertyDescriptor descriptor) {
|
||||
KtExpression delegateExpression = property.getDelegateExpression();
|
||||
@@ -495,7 +483,7 @@ public abstract class MemberCodegen<T extends KtElement/* TODO: & JetDeclaration
|
||||
v.newField(NO_ORIGIN, ACC_PRIVATE | ACC_STATIC | ACC_FINAL | ACC_SYNTHETIC, JvmAbi.DELEGATED_PROPERTIES_ARRAY_NAME,
|
||||
"[" + K_PROPERTY_TYPE, null, null);
|
||||
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.LIGHT_CLASSES) return;
|
||||
if (!state.getClassBuilderMode().generateBodies) return;
|
||||
|
||||
InstructionAdapter iv = createOrGetClInitCodegen().v;
|
||||
iv.iconst(delegatedProperties.size());
|
||||
@@ -569,7 +557,7 @@ public abstract class MemberCodegen<T extends KtElement/* TODO: & JetDeclaration
|
||||
fieldAsmType.getDescriptor(), null, null
|
||||
);
|
||||
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
if (state.getClassBuilderMode().generateBodies) {
|
||||
InstructionAdapter iv = createOrGetClInitCodegen().v;
|
||||
iv.anew(thisAsmType);
|
||||
iv.dup();
|
||||
|
||||
@@ -32,7 +32,8 @@ import org.jetbrains.kotlin.diagnostics.DiagnosticUtils
|
||||
import org.jetbrains.kotlin.fileClasses.JvmFileClassUtil
|
||||
import org.jetbrains.kotlin.load.java.JvmAnnotationNames
|
||||
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
|
||||
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader.MultifileClassKind.*
|
||||
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader.MultifileClassKind.DELEGATING
|
||||
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader.MultifileClassKind.INHERITING
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.IncrementalPackageFragmentProvider
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus
|
||||
@@ -262,7 +263,7 @@ class MultifileClassCodegen(
|
||||
if (Visibilities.isPrivate(descriptor.visibility)) return false
|
||||
if (AsmUtil.getVisibilityAccessFlag(descriptor) == Opcodes.ACC_PRIVATE) return false
|
||||
|
||||
if (state.classBuilderMode == ClassBuilderMode.LIGHT_CLASSES) return true
|
||||
if (!state.classBuilderMode.generateBodies) return true
|
||||
|
||||
if (shouldGeneratePartHierarchy) {
|
||||
if (descriptor !is PropertyDescriptor || !descriptor.isConst) return false
|
||||
@@ -322,7 +323,7 @@ class MultifileClassCodegen(
|
||||
}
|
||||
|
||||
private fun writeKotlinMultifileFacadeAnnotationIfNeeded() {
|
||||
if (state.classBuilderMode != ClassBuilderMode.FULL) return
|
||||
if (!state.classBuilderMode.generateMetadata) return
|
||||
if (files.any { it.isScript }) return
|
||||
|
||||
writeKotlinMetadata(classBuilder, KotlinClassHeader.Kind.MULTIFILE_CLASS) { av ->
|
||||
|
||||
@@ -24,7 +24,8 @@ import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
|
||||
import org.jetbrains.kotlin.load.java.JvmAnnotationNames
|
||||
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
|
||||
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader.MultifileClassKind.*
|
||||
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader.MultifileClassKind.DELEGATING
|
||||
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader.MultifileClassKind.INHERITING
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.psi.KtNamedFunction
|
||||
import org.jetbrains.kotlin.psi.KtProperty
|
||||
@@ -45,7 +46,7 @@ class MultifileClassPartCodegen(
|
||||
private val packageFragment: PackageFragmentDescriptor,
|
||||
private val superClassInternalName: String,
|
||||
private val shouldGeneratePartHierarchy: Boolean,
|
||||
private val partContext: MultifileClassPartContext,
|
||||
partContext: MultifileClassPartContext,
|
||||
state: GenerationState
|
||||
) : MemberCodegen<KtFile>(state, null, partContext, file, v) {
|
||||
private val partType = partContext.filePartType
|
||||
@@ -76,7 +77,7 @@ class MultifileClassPartCodegen(
|
||||
}
|
||||
|
||||
override fun generate() {
|
||||
if (state.classBuilderMode == ClassBuilderMode.LIGHT_CLASSES) return
|
||||
if (!state.classBuilderMode.generateBodies) return
|
||||
|
||||
super.generate()
|
||||
|
||||
@@ -131,7 +132,7 @@ class MultifileClassPartCodegen(
|
||||
}
|
||||
}
|
||||
|
||||
if (state.classBuilderMode == ClassBuilderMode.FULL) {
|
||||
if (state.classBuilderMode.generateBodies) {
|
||||
generateInitializers { createOrGetClInitCodegen() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class PackagePartCodegen extends MemberCodegen<KtFile> {
|
||||
}
|
||||
}
|
||||
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
if (state.getClassBuilderMode().generateBodies) {
|
||||
generateInitializers(new Function0<ExpressionCodegen>() {
|
||||
@Override
|
||||
public ExpressionCodegen invoke() {
|
||||
|
||||
@@ -120,7 +120,6 @@ public class PropertyCodegen {
|
||||
assert kind == OwnerKind.PACKAGE || kind == OwnerKind.IMPLEMENTATION || kind == OwnerKind.DEFAULT_IMPLS
|
||||
: "Generating property with a wrong kind (" + kind + "): " + descriptor;
|
||||
|
||||
assert declaration != null : "Declaration is null: " + descriptor + " (context=" + context + ")";
|
||||
genBackingFieldAndAnnotations(declaration, descriptor, false);
|
||||
|
||||
if (isAccessorNeeded(declaration, descriptor, getter)) {
|
||||
@@ -131,8 +130,10 @@ public class PropertyCodegen {
|
||||
}
|
||||
}
|
||||
|
||||
private void genBackingFieldAndAnnotations(@NotNull KtNamedDeclaration declaration, @NotNull PropertyDescriptor descriptor, boolean isParameter) {
|
||||
boolean hasBackingField = hasBackingField(declaration, descriptor);
|
||||
private void genBackingFieldAndAnnotations(
|
||||
@Nullable KtNamedDeclaration declaration, @NotNull PropertyDescriptor descriptor, boolean isParameter
|
||||
) {
|
||||
boolean hasBackingField = hasBackingField(descriptor);
|
||||
boolean hasDelegate = declaration instanceof KtProperty && ((KtProperty) declaration).hasDelegate();
|
||||
|
||||
AnnotationSplitter annotationSplitter =
|
||||
@@ -150,6 +151,7 @@ public class PropertyCodegen {
|
||||
if (isBackingFieldOwner) {
|
||||
Annotations fieldAnnotations = annotationSplitter.getAnnotationsForTarget(AnnotationUseSiteTarget.FIELD);
|
||||
Annotations delegateAnnotations = annotationSplitter.getAnnotationsForTarget(AnnotationUseSiteTarget.PROPERTY_DELEGATE_FIELD);
|
||||
assert declaration != null : "Declaration is null: " + descriptor + " (context=" + context + ")";
|
||||
generateBackingField(declaration, descriptor, fieldAnnotations, delegateAnnotations);
|
||||
generateSyntheticMethodIfNeeded(descriptor, propertyAnnotations);
|
||||
}
|
||||
@@ -228,7 +230,7 @@ public class PropertyCodegen {
|
||||
KtExpression defaultValue = p.getDefaultValue();
|
||||
if (defaultValue != null) {
|
||||
ConstantValue<?> constant = ExpressionCodegen.getCompileTimeConstant(defaultValue, bindingContext, true);
|
||||
assert state.getClassBuilderMode() != ClassBuilderMode.FULL || constant != null
|
||||
assert !state.getClassBuilderMode().generateBodies || constant != null
|
||||
: "Default value for annotation parameter should be compile time value: " + defaultValue.getText();
|
||||
if (constant != null) {
|
||||
AnnotationCodegen annotationCodegen = AnnotationCodegen.forAnnotationDefaultValue(mv, typeMapper);
|
||||
@@ -239,7 +241,7 @@ public class PropertyCodegen {
|
||||
mv.visitEnd();
|
||||
}
|
||||
|
||||
private boolean hasBackingField(@NotNull KtNamedDeclaration p, @NotNull PropertyDescriptor descriptor) {
|
||||
private boolean hasBackingField(@NotNull PropertyDescriptor descriptor) {
|
||||
return !isJvmInterface(descriptor.getContainingDeclaration()) &&
|
||||
kind != OwnerKind.DEFAULT_IMPLS &&
|
||||
!Boolean.FALSE.equals(bindingContext.get(BindingContext.BACKING_FIELD_REQUIRED, descriptor));
|
||||
@@ -348,7 +350,7 @@ public class PropertyCodegen {
|
||||
|
||||
FieldVisitor fv = builder.newField(
|
||||
JvmDeclarationOriginKt.OtherOrigin(element, propertyDescriptor), modifiers, name, type.getDescriptor(),
|
||||
typeMapper.mapFieldSignature(kotlinType, propertyDescriptor), defaultValue
|
||||
isDelegate ? null : typeMapper.mapFieldSignature(kotlinType, propertyDescriptor), defaultValue
|
||||
);
|
||||
|
||||
Annotated fieldAnnotated = new AnnotatedWithFakeAnnotations(propertyDescriptor, annotations);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.codegen
|
||||
|
||||
import org.jetbrains.kotlin.builtins.ReflectionTypes
|
||||
import org.jetbrains.kotlin.codegen.AsmUtil.method
|
||||
import org.jetbrains.kotlin.codegen.context.ClassContext
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState
|
||||
@@ -44,6 +45,7 @@ class PropertyReferenceCodegen(
|
||||
context: ClassContext,
|
||||
expression: KtElement,
|
||||
classBuilder: ClassBuilder,
|
||||
private val localVariableDescriptorForReference: VariableDescriptor,
|
||||
resolvedCall: ResolvedCall<*>
|
||||
) : MemberCodegen<KtElement>(state, parentCodegen, context, expression, classBuilder) {
|
||||
private val classDescriptor = context.contextDescriptor
|
||||
@@ -136,7 +138,7 @@ class PropertyReferenceCodegen(
|
||||
value.put(OBJECT_TYPE, this)
|
||||
}
|
||||
|
||||
if (!target.isVar) return
|
||||
if (!ReflectionTypes.isNumberedKMutablePropertyType(localVariableDescriptorForReference.type)) return
|
||||
|
||||
val setterParameters = (getterParameters + arrayOf(OBJECT_TYPE))
|
||||
generateAccessor(method("set", Type.VOID_TYPE, *setterParameters)) { value ->
|
||||
@@ -148,7 +150,7 @@ class PropertyReferenceCodegen(
|
||||
private fun generateMethod(debugString: String, access: Int, method: Method, generate: InstructionAdapter.() -> Unit) {
|
||||
val mv = v.newMethod(JvmDeclarationOrigin.NO_ORIGIN, access, method.name, method.descriptor, null, null)
|
||||
|
||||
if (state.classBuilderMode == ClassBuilderMode.FULL) {
|
||||
if (state.classBuilderMode.generateBodies) {
|
||||
val iv = InstructionAdapter(mv)
|
||||
iv.visitCode()
|
||||
iv.generate()
|
||||
@@ -174,7 +176,7 @@ class PropertyReferenceCodegen(
|
||||
initialize(property.type)
|
||||
}
|
||||
|
||||
val method = state.typeMapper.mapAsmMethod(getter)
|
||||
val method = state.typeMapper.mapAsmMethod(getter.original)
|
||||
return method.name + method.descriptor
|
||||
}
|
||||
|
||||
|
||||
@@ -19,14 +19,17 @@ package org.jetbrains.kotlin.codegen;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
|
||||
import org.jetbrains.kotlin.builtins.PrimitiveType;
|
||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.kotlin.descriptors.ClassifierDescriptor;
|
||||
import org.jetbrains.kotlin.descriptors.*;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
import org.jetbrains.kotlin.name.FqNameUnsafe;
|
||||
import org.jetbrains.kotlin.name.Name;
|
||||
import org.jetbrains.kotlin.psi.*;
|
||||
import org.jetbrains.kotlin.resolve.BindingContext;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.CallUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -68,32 +71,23 @@ public class RangeCodegenUtil {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static BinaryCall getRangeAsBinaryCall(@NotNull KtForExpression forExpression) {
|
||||
// We are looking for rangeTo() calls
|
||||
// Other binary operations will succeed too, but will be filtered out later (by examining a resolvedCall)
|
||||
KtExpression rangeExpression = forExpression.getLoopRange();
|
||||
assert rangeExpression != null;
|
||||
KtExpression loopRange = KtPsiUtil.deparenthesize(rangeExpression);
|
||||
public static ResolvedCall<? extends CallableDescriptor> getLoopRangeResolvedCall(@NotNull KtForExpression forExpression, @NotNull BindingContext bindingContext) {
|
||||
KtExpression loopRange = KtPsiUtil.deparenthesize(forExpression.getLoopRange());
|
||||
|
||||
if (loopRange instanceof KtQualifiedExpression) {
|
||||
// a.rangeTo(b)
|
||||
KtQualifiedExpression qualifiedExpression = (KtQualifiedExpression) loopRange;
|
||||
KtExpression selector = qualifiedExpression.getSelectorExpression();
|
||||
if (selector instanceof KtCallExpression) {
|
||||
KtCallExpression callExpression = (KtCallExpression) selector;
|
||||
List<? extends ValueArgument> arguments = callExpression.getValueArguments();
|
||||
if (arguments.size() == 1) {
|
||||
return new BinaryCall(qualifiedExpression.getReceiverExpression(), callExpression.getCalleeExpression(),
|
||||
arguments.get(0).getArgumentExpression());
|
||||
}
|
||||
if (selector instanceof KtCallExpression || selector instanceof KtSimpleNameExpression) {
|
||||
return CallUtilKt.getResolvedCall(selector, bindingContext);
|
||||
}
|
||||
}
|
||||
else if (loopRange instanceof KtBinaryExpression) {
|
||||
// a rangeTo b
|
||||
// a .. b
|
||||
KtBinaryExpression binaryExpression = (KtBinaryExpression) loopRange;
|
||||
return new BinaryCall(binaryExpression.getLeft(), binaryExpression.getOperationReference(), binaryExpression.getRight());
|
||||
|
||||
else if (loopRange instanceof KtSimpleNameExpression || loopRange instanceof KtCallExpression) {
|
||||
return CallUtilKt.getResolvedCall(loopRange, bindingContext);
|
||||
}
|
||||
else if (loopRange instanceof KtBinaryExpression) {
|
||||
return CallUtilKt.getResolvedCall(((KtBinaryExpression) loopRange).getOperationReference(), bindingContext);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -138,15 +132,47 @@ public class RangeCodegenUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static class BinaryCall {
|
||||
public final KtExpression left;
|
||||
public final KtExpression op;
|
||||
public final KtExpression right;
|
||||
public static boolean isOptimizableDownTo(@NotNull CallableDescriptor descriptor) {
|
||||
if (!isTopLevelInPackage(descriptor, "downTo", "kotlin.ranges")) return false;
|
||||
|
||||
private BinaryCall(KtExpression left, KtExpression op, KtExpression right) {
|
||||
this.left = left;
|
||||
this.op = op;
|
||||
this.right = right;
|
||||
}
|
||||
ReceiverParameterDescriptor extensionReceiver = descriptor.getExtensionReceiverParameter();
|
||||
if (extensionReceiver == null) return false;
|
||||
ClassifierDescriptor extensionReceiverClassifier = extensionReceiver.getType().getConstructor().getDeclarationDescriptor();
|
||||
if (!isPrimitiveNumberClassDescriptor(extensionReceiverClassifier)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isArrayOrPrimitiveArrayIndices(@NotNull CallableDescriptor descriptor) {
|
||||
if (!isTopLevelInPackage(descriptor, "indices", "kotlin.collections")) return false;
|
||||
|
||||
ReceiverParameterDescriptor extensionReceiver = descriptor.getExtensionReceiverParameter();
|
||||
if (extensionReceiver == null) return false;
|
||||
KotlinType extensionReceiverType = extensionReceiver.getType();
|
||||
if (!KotlinBuiltIns.isArray(extensionReceiverType) && !KotlinBuiltIns.isPrimitiveArray(extensionReceiverType)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isCollectionIndices(@NotNull CallableDescriptor descriptor) {
|
||||
if (!isTopLevelInPackage(descriptor, "indices", "kotlin.collections")) return false;
|
||||
|
||||
ReceiverParameterDescriptor extensionReceiver = descriptor.getExtensionReceiverParameter();
|
||||
if (extensionReceiver == null) return false;
|
||||
KotlinType extensionReceiverType = extensionReceiver.getType();
|
||||
if (!KotlinBuiltIns.isCollectionOrNullableCollection(extensionReceiverType)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean isTopLevelInPackage(@NotNull CallableDescriptor descriptor, @NotNull String name, @NotNull String packageName) {
|
||||
if (!name.equals(descriptor.getName().asString())) return false;
|
||||
|
||||
DeclarationDescriptor containingDeclaration = descriptor.getContainingDeclaration();
|
||||
if (!(containingDeclaration instanceof PackageFragmentDescriptor)) return false;
|
||||
String packageFqName = ((PackageFragmentDescriptor) containingDeclaration).getFqName().asString();
|
||||
if (!packageName.equals(packageFqName)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,18 +19,16 @@ package org.jetbrains.kotlin.codegen;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor;
|
||||
import org.jetbrains.kotlin.descriptors.synthetic.SyntheticMemberDescriptor;
|
||||
import org.jetbrains.kotlin.load.java.descriptors.SamAdapterDescriptor;
|
||||
import org.jetbrains.kotlin.synthetic.SamAdapterExtensionFunctionDescriptor;
|
||||
|
||||
public class SamCodegenUtil {
|
||||
@Nullable
|
||||
public static FunctionDescriptor getOriginalIfSamAdapter(@NotNull FunctionDescriptor fun) {
|
||||
if (fun instanceof SamAdapterDescriptor<?>) {
|
||||
return ((SamAdapterDescriptor<?>) fun).getOriginForSam();
|
||||
}
|
||||
|
||||
if (fun instanceof SamAdapterExtensionFunctionDescriptor) {
|
||||
return ((SamAdapterExtensionFunctionDescriptor) fun).getSourceFunction();
|
||||
if (fun instanceof SamAdapterDescriptor<?> || fun instanceof SamAdapterExtensionFunctionDescriptor) {
|
||||
//noinspection unchecked
|
||||
return ((SyntheticMemberDescriptor<FunctionDescriptor>) fun).getBaseDescriptorForSynthetic();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -130,7 +130,7 @@ public class SamWrapperCodegen {
|
||||
MethodVisitor mv = cv.newMethod(JvmDeclarationOriginKt.OtherOrigin(samType.getJavaClassDescriptor()),
|
||||
visibility, "<init>", Type.getMethodDescriptor(Type.VOID_TYPE, functionType), null, null);
|
||||
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
if (state.getClassBuilderMode().generateBodies) {
|
||||
mv.visitCode();
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ public class ScriptCodegen extends MemberCodegen<KtScript> {
|
||||
ACC_PUBLIC, jvmSignature.getAsmMethod().getName(), jvmSignature.getAsmMethod().getDescriptor(),
|
||||
null, null);
|
||||
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
if (state.getClassBuilderMode().generateBodies) {
|
||||
mv.visitCode();
|
||||
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
|
||||
@@ -394,9 +394,10 @@ public abstract class StackValue {
|
||||
}
|
||||
}
|
||||
else if (fromType.getSort() == Type.OBJECT) {
|
||||
if (fromType.equals(getType(Boolean.class)) || fromType.equals(getType(Character.class))) {
|
||||
unbox(unboxType(fromType), v);
|
||||
coerce(unboxType(fromType), toType, v);
|
||||
Type unboxedType = unboxPrimitiveTypeOrNull(fromType);
|
||||
if (unboxedType != null) {
|
||||
unbox(unboxedType, v);
|
||||
coerce(unboxedType, toType, v);
|
||||
}
|
||||
else {
|
||||
if (toType.getSort() == Type.BOOLEAN || toType.getSort() == Type.CHAR) {
|
||||
@@ -709,12 +710,13 @@ public abstract class StackValue {
|
||||
}
|
||||
}
|
||||
|
||||
public static class Constant extends StackValue {
|
||||
private static class Constant extends StackValue {
|
||||
@Nullable
|
||||
private final Object value;
|
||||
|
||||
public Constant(@Nullable Object value, Type type) {
|
||||
super(type, false);
|
||||
assert !Type.BOOLEAN_TYPE.equals(type) : "Boolean constants should be created via 'StackValue.constant'";
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@@ -723,6 +725,9 @@ public abstract class StackValue {
|
||||
if (value instanceof Integer || value instanceof Byte || value instanceof Short) {
|
||||
v.iconst(((Number) value).intValue());
|
||||
}
|
||||
else if (value instanceof Character) {
|
||||
v.iconst(((Character) value).charValue());
|
||||
}
|
||||
else if (value instanceof Long) {
|
||||
v.lconst((Long) value);
|
||||
}
|
||||
@@ -1146,7 +1151,7 @@ public abstract class StackValue {
|
||||
value = ((Double) value).floatValue();
|
||||
}
|
||||
|
||||
new Constant(value, this.type).putSelector(type, v);
|
||||
StackValue.constant(value, this.type).putSelector(type, v);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1417,7 +1422,7 @@ public abstract class StackValue {
|
||||
|
||||
if (descriptor instanceof PropertyDescriptor &&
|
||||
// hackaround: boxing changes behaviour of T.javaClass intrinsic
|
||||
!(state.getIntrinsics().getIntrinsic((PropertyDescriptor) descriptor) instanceof JavaClassProperty)
|
||||
state.getIntrinsics().getIntrinsic((PropertyDescriptor) descriptor) != JavaClassProperty.INSTANCE
|
||||
) {
|
||||
ReceiverParameterDescriptor receiverCandidate = descriptor.getExtensionReceiverParameter();
|
||||
assert receiverCandidate != null;
|
||||
|
||||
@@ -59,7 +59,7 @@ class StackValueWithLeaveTask(
|
||||
}
|
||||
}
|
||||
|
||||
open class OperationStackValue(val resultType: Type, val lambda: (v: InstructionAdapter) -> Unit) : StackValue(resultType) {
|
||||
open class OperationStackValue(resultType: Type, val lambda: (v: InstructionAdapter) -> Unit) : StackValue(resultType) {
|
||||
|
||||
override fun putSelector(type: Type, v: InstructionAdapter) {
|
||||
lambda(v)
|
||||
|
||||
@@ -30,7 +30,7 @@ class AnnotatedWithFakeAnnotations(override val originalAnnotated: Annotated, pr
|
||||
override fun getAnnotations() = actual
|
||||
}
|
||||
|
||||
class AnnotatedWithOnlyTargetedAnnotations(private val original: Annotated) : Annotated {
|
||||
class AnnotatedWithOnlyTargetedAnnotations(original: Annotated) : Annotated {
|
||||
private val annotations: Annotations = UseSiteTargetedAnnotations(original.annotations)
|
||||
|
||||
override fun getAnnotations() = annotations
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.intellij.util.containers.Stack;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.builtins.ReflectionTypes;
|
||||
import org.jetbrains.kotlin.cfg.WhenChecker;
|
||||
import org.jetbrains.kotlin.codegen.*;
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState;
|
||||
@@ -46,7 +47,6 @@ import org.jetbrains.kotlin.resolve.calls.model.ResolvedValueArgument;
|
||||
import org.jetbrains.kotlin.resolve.constants.ConstantValue;
|
||||
import org.jetbrains.kotlin.resolve.constants.EnumValue;
|
||||
import org.jetbrains.kotlin.resolve.constants.NullValue;
|
||||
import org.jetbrains.kotlin.synthetic.SamAdapterExtensionFunctionDescriptor;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
|
||||
@@ -295,7 +295,11 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
|
||||
callableDescriptor = bindingContext.get(VARIABLE, expression);
|
||||
if (callableDescriptor == null) return;
|
||||
|
||||
supertypes = Collections.singleton(runtimeTypes.getSupertypeForPropertyReference((PropertyDescriptor) target));
|
||||
//noinspection ConstantConditions
|
||||
supertypes = Collections.singleton(runtimeTypes.getSupertypeForPropertyReference(
|
||||
(PropertyDescriptor) target,
|
||||
ReflectionTypes.Companion.isNumberedKMutablePropertyType(callableDescriptor.getReturnType())
|
||||
));
|
||||
}
|
||||
else {
|
||||
return;
|
||||
@@ -335,7 +339,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
|
||||
if (delegate != null && descriptor instanceof PropertyDescriptor) {
|
||||
PropertyDescriptor propertyDescriptor = (PropertyDescriptor) descriptor;
|
||||
String name = inventAnonymousClassName();
|
||||
KotlinType supertype = runtimeTypes.getSupertypeForPropertyReference(propertyDescriptor);
|
||||
KotlinType supertype = runtimeTypes.getSupertypeForPropertyReference(propertyDescriptor, propertyDescriptor.isVar());
|
||||
ClassDescriptor classDescriptor = recordClassForCallable(delegate, propertyDescriptor, Collections.singleton(supertype), name);
|
||||
recordClosure(classDescriptor, name);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -149,7 +149,6 @@ public class CodegenBinding {
|
||||
closure.setCaptureThis();
|
||||
}
|
||||
|
||||
assert PsiCodegenPredictor.checkPredictedNameFromPsi(classDescriptor, asmType, fileClassesManager);
|
||||
trace.record(ASM_TYPE, classDescriptor, asmType);
|
||||
trace.record(CLOSURE, classDescriptor, closure);
|
||||
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.codegen.binding;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.codegen.AsmUtil;
|
||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor;
|
||||
import org.jetbrains.kotlin.fileClasses.FileClasses;
|
||||
import org.jetbrains.kotlin.fileClasses.JvmFileClassesProvider;
|
||||
import org.jetbrains.kotlin.name.Name;
|
||||
import org.jetbrains.kotlin.psi.*;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
|
||||
import static org.jetbrains.kotlin.resolve.DescriptorToSourceUtils.descriptorToDeclaration;
|
||||
|
||||
public final class PsiCodegenPredictor {
|
||||
private PsiCodegenPredictor() {
|
||||
}
|
||||
|
||||
public static boolean checkPredictedNameFromPsi(
|
||||
@NotNull DeclarationDescriptor descriptor,
|
||||
@Nullable Type nameFromDescriptors,
|
||||
@NotNull JvmFileClassesProvider fileClassesManager
|
||||
) {
|
||||
PsiElement element = descriptorToDeclaration(descriptor);
|
||||
if (element instanceof KtDeclaration) {
|
||||
String classNameFromPsi = getPredefinedJvmInternalName((KtDeclaration) element, fileClassesManager);
|
||||
assert classNameFromPsi == null || Type.getObjectType(classNameFromPsi).equals(nameFromDescriptors) :
|
||||
String.format("Invalid algorithm for getting qualified name from psi! Predicted: %s, actual %s\n" +
|
||||
"Element: %s", classNameFromPsi, nameFromDescriptors, element.getText());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null if no prediction can be done.
|
||||
*/
|
||||
@Nullable
|
||||
public static String getPredefinedJvmInternalName(
|
||||
@NotNull KtDeclaration declaration,
|
||||
@NotNull JvmFileClassesProvider fileClassesProvider
|
||||
) {
|
||||
// TODO: Method won't work for declarations inside companion objects
|
||||
// TODO: Method won't give correct class name for traits implementations
|
||||
|
||||
if (declaration instanceof KtPropertyAccessor) {
|
||||
return getPredefinedJvmInternalName(((KtPropertyAccessor) declaration).getProperty(), fileClassesProvider);
|
||||
}
|
||||
KtDeclaration parentDeclaration = KtStubbedPsiUtil.getContainingDeclaration(declaration);
|
||||
|
||||
String parentInternalName;
|
||||
if (parentDeclaration != null) {
|
||||
parentInternalName = getPredefinedJvmInternalName(parentDeclaration, fileClassesProvider);
|
||||
if (parentInternalName == null) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
KtFile containingFile = declaration.getContainingKtFile();
|
||||
|
||||
if (declaration instanceof KtNamedFunction || declaration instanceof KtProperty) {
|
||||
Name name = ((KtNamedDeclaration) declaration).getNameAsName();
|
||||
return name == null ? null : FileClasses.getFileClassInternalName(fileClassesProvider, containingFile) + "$" + name.asString();
|
||||
}
|
||||
|
||||
parentInternalName = AsmUtil.internalNameByFqNameWithoutInnerClasses(containingFile.getPackageFqName());
|
||||
}
|
||||
|
||||
if (!PsiTreeUtil.instanceOf(declaration, KtClass.class, KtObjectDeclaration.class, KtNamedFunction.class, KtProperty.class) ||
|
||||
isEnumEntryWithoutBody(declaration)) {
|
||||
// Other subclasses are not valid for class name prediction.
|
||||
// For example JetFunctionLiteral
|
||||
return null;
|
||||
}
|
||||
|
||||
Name name = ((KtNamedDeclaration) declaration).getNameAsName();
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (declaration instanceof KtNamedFunction) {
|
||||
if (!(parentDeclaration instanceof KtClass || parentDeclaration instanceof KtObjectDeclaration)) {
|
||||
// Can't generate predefined name for internal functions
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: looks like a bug - for class in getter of top level property class name will be $propertyName$ClassName but not
|
||||
// PackageClassName$propertyName$ClassName
|
||||
if (declaration instanceof KtProperty) {
|
||||
return parentInternalName + "$" + name.asString();
|
||||
}
|
||||
|
||||
if (parentInternalName.isEmpty()) {
|
||||
return name.asString();
|
||||
}
|
||||
|
||||
return parentInternalName + (parentDeclaration == null ? "/" : "$") + name.asString();
|
||||
}
|
||||
|
||||
private static boolean isEnumEntryWithoutBody(KtDeclaration declaration) {
|
||||
if (!(declaration instanceof KtEnumEntry)) {
|
||||
return false;
|
||||
}
|
||||
KtClassBody body = ((KtEnumEntry) declaration).getBody();
|
||||
return body == null || body.getDeclarations().size() == 0;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user