Commit Graph

80 Commits

Author SHA1 Message Date
Toshiaki Kameyama be04912f6f KT-19574 Code with inferred default parameters and parameter vs property name clashes (#2671)
New J2K: add 'this' receiver to default parameter value if needed

#KT-19574 Fixed
2019-11-27 18:55:50 +03:00
Toshiaki Kameyama c72622c6d7 KT-32551 New J2K: Non-canonical modifiers order inspection is not applied during convertion of inner super class (#2806)
New J2K: add SortModifiers inspection to post-processing

#KT-32551 Fixed
2019-11-27 16:08:54 +03:00
Dmitry Gridin b40a888f1d Formatter: fix line break between declarations with annotations
#KT-35093 Fixed
#KT-35106 Fixed
2019-11-26 19:40:51 +07:00
Dmitry Gridin bfd539d5d1 Formatter: fix line break between declarations with comment
#KT-12490 Fixed
#KT-35088 Fixed
2019-11-26 19:40:51 +07:00
Ilya Kirillov f368d9761a Fix for loop conversion when multiple initializers are present
#KT-35074 fixed
2019-11-25 17:01:46 +03:00
Ilya Kirillov 1ec620b753 New J2K: fix SOE in inference processing for star-projection as type argument
#KT-33942 fixed
#KT-33941 fixed
2019-10-12 15:28:03 +03:00
Ilya Kirillov b350515237 New J2K: make post-processing aware of other files which are being converted
Before post-processing was able to handle only one converting file at once
So, some conversions (like (field, getter, setter) to Kotlin property)
was not able to work when converting class hierarchy was split into
multiple files.
Also, inferring nullability for a set of files was broken

#KT-19569 fixed
#KT-34266 fixed
#KT-32518 fixed
2019-10-12 12:50:34 +03:00
Ilya Kirillov 999918d499 New J2K: add multi-file conversion tests from old j2k 2019-10-12 12:50:34 +03:00
Ilya Kirillov d0f0b9e355 New J2K: do not allow field and method declarations to be internal
For internal members new names are generated,
So, references to them from Java will be broken
2019-10-12 12:50:32 +03:00
Toshiaki Kameyama 4da7d11364 KT-30643 J2K: wrong position of TYPE_USE annotation (#2543)
New J2K: fix wrong position of TYPE_USE annotation

#KT-30643 Fixed
2019-10-08 16:21:27 +03:00
Toshiaki Kameyama eda4206428 New J2K: convert Integer.MAX_VALUE to Int.MAX_VALUE
#KT-7940 Fixed
2019-10-06 01:09:33 +03:00
Ilya Kirillov f950a0246c New J2K: handle correctly short names which are imported by default in kotlin (like List or Result)
Kotlin default import inserter was unable to correctly insert such imports

#KT-34165 fixed
2019-10-04 15:17:35 +03:00
Ilya Kirillov 81341e3fd3 New J2K: add hack for incorrect comment parsing in J2K (KT-16845)
#KT-33825 fixed
2019-10-04 15:17:35 +03:00
Ilya Kirillov 043a669812 New J2K: do not print qualified names if corresponding qualifier can unambiguously resolved
This speeds up shortening qualified references phase
2019-09-29 11:39:37 +03:00
Ilya Kirillov 678cc35008 New J2K: reuse already calculated type arguments in inference post-processing 2019-09-29 11:39:36 +03:00
Ilya Kirillov c000f33955 New J2K: make initial generating code formatting better 2019-09-29 11:39:36 +03:00
Ilya Kirillov f3b53a9532 New J2K: rework Java code formatting collecting
#KT-33687 fixed
2019-09-29 11:39:35 +03:00
Alex Chmyr b8cce67d2e KT-19355 fix for "Variable expected" error after J2K for increment/decrement of an object field 2019-09-25 10:08:42 +03:00
Ilya Kirillov 74ba5b210a New J2K: do not analyze code for post-processings in edt thread 2019-09-24 17:21:48 +03:00
Ilya Kirillov e6f2e0041c New J2K: get rid of generalInspectionPostProcessing 2019-09-24 17:21:47 +03:00
Ilya Kirillov 3724e2bb02 New J2K: convert all custom post-processing to applicability based ones 2019-09-24 17:21:46 +03:00
Ilya Kirillov 704b3bd2e6 New J2K: always print real fqNames for static calls
As fqNames of some symbols may change during conversion
E.g, when moving Java static method to Kotlin companion object

#KT-19607 fixed
#KT-32903 fixed
#KT-33743 fixed
#KT-33556 fixed
2019-09-24 17:13:12 +03:00
Ilya Kirillov f9fac0acf5 New J2K: do not save import statements in files as we print fqNames for calls
This may cause conflicts on shortening fq references post-processing step
2019-09-24 17:13:11 +03:00
Ilya Kirillov cfd476ca7e New J2K: correctly convert main method with varargs argument
#KT-33756 fixed
2019-09-17 11:56:06 +03:00
Ilya Kirillov be94eb5405 New J2K: remove extra interfaces in AST structure & split AST definitions to proper files 2019-09-10 14:09:30 +03:00
Ilya Kirillov fd85c2bb43 New J2K: use mutable lists for storing comments 2019-09-10 14:09:30 +03:00
Ilya Kirillov dca0dc1933 New J2K: do not recalculate types for binary & unary expressions and rewrite assignment expressions conversion
#KT-33679 fixed
2019-09-10 14:09:29 +03:00
Ilya Kirillov f61bb5aa39 New J2K: implement mutability inference in post-processing
#KT-24293 fixed
#KT-19603 fixed
2019-09-10 14:09:26 +03:00
Ilya Kirillov c28515be59 New J2K: use nullable type for unknown for public declarations & prepare for mutability inference
#KT-32518 fixed
2019-09-10 14:09:25 +03:00
Mikhail Glukhikh 7eac7d96dc Fix NJ2K test related to KT-30136 2019-09-02 12:57:53 +03:00
Ilya Kirillov 78b0d5750b New J2K: consider literal expressions in data class conversion & fix names conflict
#KT-32253 fixed
2019-08-29 11:31:55 +03:00
Ilya Kirillov ca0cc13097 New J2K: retrieve constructor call return type correctly
#KT-33431 fixed
2019-08-29 11:31:53 +03:00
Ilya Kirillov 982e7fdd86 New J2K: do not shorten class references for some Java primitive class wrappers classes
It may cause unresolved call errors

#KT-33500 fixed
2019-08-29 11:31:53 +03:00
Toshiaki Kameyama a1c52f69f2 New J2K: convert Long.parseLong(s) to s.toLong()
#KT-21504 Fixed
2019-08-13 12:37:16 +03:00
Ilya Kirillov 09ab98a4f8 New J2K: Don't fail on captured types & don't use functional interface with captured types
Note: we have to print captured types for lambda parameters.
It is needed for nullability inference as it requires explicit types specification to work.
Later in post-processing we remove explicit type specifications for lambda parameters which have captured types

#KT-33186 fixed
2019-08-09 16:31:58 +03:00
Toshiaki Kameyama 154cf46f7c New J2K: add ReplaceGuardClause inspection to post-processing
#KT-22412 Fixed
2019-08-09 00:43:28 +03:00
Toshiaki Kameyama f5c0a30c51 Add intention to replace "Map.getOrDefault"
#KT-21503 Fixed
2019-08-07 17:38:15 +03:00
Ilya Kirillov e795e4b73d New J2K: add conversion of binary literals & fix conversion of octal ones
#KT-32835 fixed
2019-07-25 14:34:36 +03:00
Ilya Kirillov 72a09ab59b New J2K: correctly convert number literals with underscores
#KT-32837 fixed
2019-07-25 14:34:35 +03:00
Ilya Kirillov 2bd5a1f196 New J2K: separate nullability inference from common one & nullability bug fixes
It will be needed for structure mutability inference

#KT-21467 fixed
#KT-32609 fixed
#KT-32572 fixed
#KT-24677 fixed
2019-07-25 14:34:35 +03:00
Ilya Kirillov f79b282c60 New J2K: add better support of implicit functional interfaces
#KT-32702 fixed
#KT-19327 fixed
2019-07-25 14:34:34 +03:00
Ilya Kirillov 96ca4712a0 New J2K: consider in-context declarations while performing conversion on copy-paste plain text conversion
#KT-32602 fixed
2019-07-25 14:34:34 +03:00
Ilya Kirillov b7917978b8 New J2K: correctly create AST for Java call of Kotlin data class derived members
#KT-32604 fixed
2019-07-16 11:56:08 +03:00
Ilya Kirillov d29d7fb257 New J2K: do not resolve unary expressions method symbols
As we already have its type and may fail on unresolved declaration

#KT-32603 fixed
2019-07-16 11:55:04 +03:00
Ilya Kirillov f0dd21790a New J2K: add plain text copy-paste conversion test for new J2K 2019-07-10 13:18:36 +03:00
Ilya Kirillov ba3927b580 New J2K: add default null value to property with type parameter type when it is implicit in Java
#KT-32436 fixed
2019-07-10 13:16:53 +03:00
Ilya Kirillov 934425e86a New J2K: rearrange and optimize some post-processings 2019-07-10 13:16:52 +03:00
Ilya Kirillov 3e04bfb156 New J2K: do not print modifiers which are going to be removed in postprocessing 2019-07-10 13:16:52 +03:00
Mikhail Zarechenskiy 60ac2056bd Update diagnostic message in test data
Follow-up of 42a5c488: function `unCapture` is used to render
 diagnostic messages, therefore we have this change now
2019-07-02 14:02:07 +03:00
Ilya Kirillov 0dfaae2bb4 New J2K: add some tests from obsolete issues 2019-06-26 18:36:05 +03:00