Commit Graph

118 Commits

Author SHA1 Message Date
Roman Golyshev 7fb5acc718 KT-18538 Fix inspection to detect unnecessary grand-base class qualifier
- Add separate option to enable/disable this inspection, as it is not
obvious if it should be always enabled or not
  - This option can be used to detect all unnecessary qualifiers in
  tests
- Add possibility to configure inspections via `settings.xml` in the
`AbstractMultiFileLocalInspectionTest.kt`
- ^KT-18538 Fixed
2020-06-01 08:59:37 +00:00
Roman Golyshev 4436142f00 KT-38450 Add functional interface converter to the NJ2K
- Enable custom compiler options for
`AbstractNewJavaToKotlinConverterSingleFileTest`
- ^KT-38450 Fixed
2020-05-25 11:11:24 +03:00
Dmitry Gridin 11a3482970 tests: apply official code style
#KT-38632 Fixed
2020-05-07 12:36:44 +00:00
Ilya Kirillov e4a721d03e New J2K: do not create erroneous conversion from Java accessors to property
#KT-38004 fixed
2020-04-17 15:08:51 +03:00
Harry 27827cd364 New J2K: Convert Number.[type]Value() to Number.to[type]() (#2908)
New J2K: Convert Number.[type]Value() to Number.to[type]()
2020-04-10 14:25:49 +03:00
PetelimovaNadezhda 517de44d20 KT-35897: change type for enum constructor for visibility 2020-04-06 16:42:53 +03:00
Ilya Kirillov bc52281208 New J2K: convert Java method reference to Kotlin one on copy-pasting Java code
#KT-34965 fixed
2020-03-31 19:35:55 +03:00
Ilya Kirillov d6d843aaed New J2K: fix assignment target in ConvertGettersAndSettersToPropertyProcessing
#KT-36190 fixed
2020-03-31 19:35:55 +03:00
Ilya Kirillov b3e728f4fb New J2K: don't allow open modifier on top-level/private declarations 2020-03-31 19:35:55 +03:00
Ilya Kirillov 4d4aa88534 New J2K: handle spaces in array dimensions declaration
#KT-36891 fixed
2020-03-31 19:35:55 +03:00
Ilya Kirillov 353e884c8f New J2K: do not merge methods if there are vararg parameters present 2020-03-31 19:35:55 +03:00
Ilya Kirillov 78d2aaa021 New J2K: handle null Java type 2020-03-31 19:35:54 +03:00
Mikhail Bogdanov 3f87899014 Switch converter test to new directive scheme 2020-03-19 16:45:10 +01:00
Dmitry Gridin 7886cb4c44 i18n: fix tests 2020-03-16 18:40:51 +07:00
Yan Zhulanow 7a40274b71 i18n: Unify string naming in KotlinBundle 2020-03-16 18:40:42 +07:00
Ilya Chernikov 70c89a28e1 Stop subtyping constraint search if equality constraints for...
all not fixed type vars are found
#KT-35626 fixed
2020-03-12 08:02:45 +01:00
Roman Golyshev 1dbb3d7c0f Revert "New J2K: fix testdata"
This reverts commit 285aa123
2020-02-20 17:33:39 +03:00
Roman Golyshev 4042214bb2 Fix tests broken by enhanced RedundantSamConstructor inspection
- The inspection now works in more cases, so the test data had to be
updated accordingly
2020-02-20 17:27:41 +03:00
Roman Golyshev 46ae6136cb Rewrite RedundantSamConstructorInspection to support more cases
- Now inspection does not rely on synthetic descriptors at all, instead
it uses `SamConversionOracle` and `SamConversionResolver` to detect
if the argument type support SAM conversion
- This transparently considers all language features like
`SAM conversions for kotlin functions`, `Functional interfaces` etc.
- In case of multiple SAM arguments, part of them can be converted only
when `SAM conversion per argument` is enabled
- Fix inspection and nj2k tests that were failing because of better
working inspection
- Rewrite automatically fixes multiple bugs that were present
- ^KT-36367 ^KT-36368 ^KT-36296 ^KT-36395 Fixed
2020-02-19 17:16:17 +03:00
Ilya Kirillov 285aa123b7 New J2K: fix testdata 2020-02-19 12:02:32 +03:00
Ilya Kirillov 810966e408 New J2K: call reformat code & shorten references processings only single time 2020-02-19 12:02:30 +03:00
Ilya Kirillov 85be0450ba Fix invalidated element access exception in ObjectLiteralToLambdaIntention
#KT-36149 fixed
#KT-36152 fixed
2020-02-19 12:02:27 +03:00
Ilya Kirillov 6b913da698 New J2K: Fix super call to Kotlin class with implicit constructor
#KT-36159 fixed
2020-02-19 12:02:27 +03:00
Ilya Kirillov 7c586ce736 New J2K: Fix converting recursive types
#KT-36088 fixed
2020-02-19 12:02:26 +03:00
Dmitry Gridin b5d0956a5e Move call-site trailing comma to registry
#KT-34744
2020-02-04 21:34:53 +07:00
Dmitry Gridin c34b417d0c Fix tests after disabling trailing comma
#KT-34744
2020-02-04 21:34:53 +07:00
Dmitry Gridin 96f49d8e3c Remove trailing comma from some tests 2020-01-30 15:32:09 +07:00
Victor Petukhov 437a26684d NI: Prefer nullable lower bound to flexible one when substitution of type variable is performed and remember flexibility of type parameters based on flexibility of its upper bounds
^KT-32435 Fixed
2020-01-17 19:16:09 +03:00
Dmitry Gridin d06787886a Fix tests after implementing trailing comma in formatter
#KT-34744
2020-01-17 21:02:54 +07:00
Pavel Kirpichenkov 69e800c695 Remove dependencies on data flow aware expression type in BindingContext
`BindingContext.getType`'s behaviour on argument expression has been different for OI and NI for some time.
New inference used to rewrite argument's type after smartcast, which led to missing subsequent smartcasts in some cases.
This commit makes retrieval of smartcasted argument type explicit.
2020-01-15 14:39:40 +03:00
Ilya Kirillov 5be80be74d New J2K: fix converting multiline comment with /* inside
#KT-18001 fixed
#KT-35081 fixed
2020-01-13 14:32:47 +03:00
Ilya Kirillov a87de01c74 New J2K: add missing line break between property and getter
#KT-35739 fixed
2020-01-13 14:32:46 +03:00
Ilya Kirillov 7bfad12e6a New J2K: correctly convert compound Java assignment expression
#KT-35476 fixed
2020-01-13 14:32:45 +03:00
Ilya Kirillov 6a8a68a263 New J2K: fix UninitializedPropertyAccessException when calculating type of anonymous class
#KT-35395 fixed
2020-01-13 14:32:44 +03:00
Ilya Kirillov 14a8d3726d New J2K: remove initializer from property without backing field
#KT-33637 fixed
2020-01-13 14:32:43 +03:00
Alex Chmyr 16c82030a3 KT-20120 fixing bug for Java 9 Deprecated
Unconditionally changing it to @Deprecated("") in kotlin
2020-01-10 11:45:17 +03:00
Dmitry Gridin 70185ba2a6 Formatter, NJ2K: fix indent for comments inside function literals
#KT-4194 Fixed
#KT-31881 Fixed
#KT-34673 Fixed
#KT-35152 Fixed
2019-11-29 16:28:59 +07:00
Toshiaki Kameyama 3a576ce14f KT-21811 Convert string concatenation into multiline string (#2772)
New J2K: Convert string concatenation into multiline string

#KT-21811 Fixed
2019-11-28 13:14:48 +03:00
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