55 Commits

Author SHA1 Message Date
Kirill Rakhman ac203591e5 [FE, Java resolve] Support inheritors of sealed Java type without permits clause
This fixes a false negative NO_ELSE_IN_WHEN in K2 and incidentally
also fixes a false positive NO_ELSE_IN_WHEN in K1 since the fix is in
the common code.

#KT-62491 Fixed
2023-10-31 13:41:56 +00:00
Roman Golyshev d4cffb8a5a [213] Switch to 213 platform
KTI-1114
2023-04-21 13:19:04 +00:00
Marco Pennekamp 567abd2a1c KT-57207 Implement JavaClassFinder.findClasses
- This change is a prerequisite for allowing combined Java symbol
  providers (in LL FIR) to correctly disambiguate classpath order after
  getting classes with a combined scope, as the index access of the
  combined Java symbol provider is not guaranteed to return the class
  that should be first based on the original dependency order. To be
  able to disambiguate, a combined Java symbol provider needs access to
  all class candidates the index can find.
2023-04-17 11:07:47 +00:00
Marco Pennekamp 288606868e [FIR] KT-57207 Avoid FirJavaFacade.knownClassNamesInPackage in the IDE
- `FirJavaFacade.knownClassNamesInPackage` cannot be computed in the IDE
  using the current strategy because there are multiple finders and
  there is no `CliFinder`. However, the cache was still used, which
  caused it to be filled with `null` values and additionally caused
  worse performance in `JavaSymbolProvider` due to hash map accesses via
  `hasTopLevelClassOf`.
- Rewriting the strategy is non-trivial as additional indices are needed
  on the IDE side. See KTIJ-24642.
2023-04-17 11:07:46 +00:00
Dmitriy Novozhilov 1f2f6f4067 Reformat treeBasedTypes.kt 2022-08-11 15:22:35 +03:00
Dmitriy Novozhilov 26df9d74e8 [FE] Add flag to java model to distinguish source java classes from binaries 2022-06-07 14:12:23 +00:00
Dmitriy Novozhilov 09ff6303cc Reformat TreeBasedAnnotation.kt 2022-06-07 14:12:22 +00:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Ivan Kochurkin c13822a2c5 Optimize containsKey -> get pattern 2021-10-25 21:21:44 +03:00
Vyacheslav Gerasimov ab146bd6d4 Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
2021-09-26 18:28:44 +03:00
Denis.Zharkov 38fa900e56 FIR: Optimize case with no annotations on package 2021-09-23 16:58:26 +03:00
Alexander Udalov adfa8c788c Light classes: use JVM target from the module
Using "JVM_1_8" always resulted in incorrect mapping of Kotlin
annotation targets to Java element types.

The change in AbstractKotlinRenderLogTest is needed because while
CliTraceHolder.module is technically a descriptor leak, it was never
detected by this test accidentally, because of the depth cutoff equal to
10, which started to not be enough after the minor refactoring of
replacing `Delegates.notNull` with `lateinit`.
2021-02-01 11:54:05 +01:00
Victor Petukhov b0debbe4c9 Add forced mark "isDeprecated" as false for missing types among javac types 2020-12-18 19:32:04 +03:00
Dmitriy Novozhilov bdfb71b149 [FE] Add sealed classes related properties to java model 2020-12-09 22:54:28 +03:00
Denis.Zharkov 513f7177ca Support loading Java records
^KT-43677 In Progress
2020-12-09 16:29:03 +03:00
Igor Yakovlev 4b8f1bb362 [ULC] Add LanguageVersionSettings to CliLightClassGenerationSupport
+ refactoring
2020-09-11 12:49:04 +03:00
Dmitriy Novozhilov b81c0e91d5 Replace DescriptorVisibility with Visibility in Java model classes 2020-09-04 11:42:51 +03:00
Dmitriy Novozhilov d1fd1da56f Rename Visibility to DescriptorVisibility 2020-09-04 11:07:42 +03:00
Kevin Bierhoff 7448761dfd only stub default constructor when compiling against .java source files 2020-04-07 17:48:39 +02:00
Alexander Udalov 4156a9c80b Extract javac-wrapper into a separate module
It was actually a separate module before the grand build refactoring in
61dfb75e0e.
2020-03-28 21:30:03 +01:00
Mikhail Glukhikh 393047883e JavacWrapper: add Kotlin classes to classpath only in APT mode 2019-11-21 14:25:13 +03:00
Mikhail Glukhikh 89a582b694 JavacWrapper: perform makeOutputDirectoryClasses hack only in non-APT mode
For some reason, working without APT requires this call in JavacWrapper.
From the other hand, working without APT does not require
Kotlin class files to be in javac classpath.
2019-11-21 14:25:08 +03:00
Mikhail Glukhikh 87e2f9d96b Add CLI test for K/javac project with K/J interdependency
Yet this test fails if JavacWrapper does not add Kotlin output dir to classpath
2019-10-18 12:02:04 +03:00
Mikhail Glukhikh 9f3d834b2a JavacWrapper: optimize building of tree-based stuff 2019-10-18 11:56:18 +03:00
Mikhail Glukhikh 39ff04e043 JavacWrapper: optimize toJavacList away 2019-10-18 11:55:59 +03:00
Mikhail Glukhikh f74b3e6ece SymbolBasedClassifierType: fix exception in case with not found class
This can arise with non-transitive dependencies
#KT-33932 Fixed
2019-10-03 11:16:25 +03:00
Mikhail Glukhikh 6b8f4b4b4e SymbolBasedClass: cleanup code 2019-10-03 11:16:25 +03:00
Mikhail Glukhikh ac1b957f8d Symbol based types: cleanup code 2019-10-03 11:16:25 +03:00
Mikhail Glukhikh 4bb5fbaa4d JavacWrapper: add output directory to classpath to see Kotlin files
Without this commit, Java cannot see Kotlin in some cases

Controversial: probably javac should be able to find Kotlin files
inside its existing tabs without this directory in classpath
2019-10-03 11:16:24 +03:00
Mikhail Glukhikh b75e630932 JavacWrapper: minor renames to make code clearer 2019-10-03 11:16:24 +03:00
Mikhail Glukhikh 0c662a5a34 JavacWrapper: remove code duplication around getVisibility 2019-10-03 11:16:24 +03:00
Mikhail Glukhikh bbd8fb8b23 JavacWrapper: add support for JvmPackageName annotation
This fixes previously added testWithStdLib/streams.kt test
2019-10-03 11:16:24 +03:00
Mikhail Glukhikh f6ff580852 Cleanup code: JavacWrapper 2019-10-03 11:16:23 +03:00
Mikhail Glukhikh 2bec60a3dd Fix potential NPE in JavacWrapper 2019-10-03 11:16:23 +03:00
Mikhail Glukhikh fb788dc4c0 Fix null Java type argument problem & add relevant test 2019-03-14 17:56:23 +03:00
Alexander Udalov 8ab9226805 Fix loading default Java annotation values in actual typealias from binary classes
#KT-22704 Fixed
2018-12-28 13:02:15 +01:00
Denis Zharkov f153d97f40 Avoid multiple subsequent reading of the same class-file in front-end
^KT-23466 Fixed
2018-12-13 20:38:24 +03:00
Alexander Udalov 899002b681 Refactor JavaEnumValueAnnotationArgument and implementations
Only require implementations to be able to compute the enum class name
and the corresponding entry name. Only this should be necessary to
correctly resolve the argument; the resolvers will find the
corresponding class descriptor if necessary
2018-01-18 12:49:38 +01:00
Alexander Podkhalyuzin 3f8170d369 Clean idea files generated on the gradle import, add them to .gitignore 2017-09-19 23:58:27 +02:00
baratynskiy 67fdd9f76e javac-wrapper: fixes after rebase and review 2017-08-29 18:01:36 +03:00
baratynskiy 2dc0c55e76 javac-wrapper: get rid of TreePath because it is slow 2017-08-29 18:01:36 +03:00
baratynskiy 1b0d7ff5be javac-wrapper: constant evaluator 2017-08-29 18:01:36 +03:00
baratynskiy 4f180e1292 javac-wrapper: identifier resolver 2017-08-29 18:01:36 +03:00
baratynskiy 01883a41cb javac-wrapper: refactoring, fixes and tests 2017-08-29 18:01:36 +03:00
baratynskiy 8494e54608 javac-wrapper: -Xuse-javac -> -Xuse-javac and -Xcompile-java 2017-08-29 18:01:36 +03:00
Denis Zharkov f8f0c0b6d7 Load enum/array annotation arguments for not found classes
It's necessary to load type qualifier related annotations
without JSR305 annotations being in the classpath

 #KT-19419 In Progress
2017-08-11 10:18:41 +07:00
Mikhail Glukhikh dfe2c16bc7 More cleanup: lift return / assignment out 2017-07-10 12:59:58 +03:00
Denis Zharkov 79e14f88e4 Support package level annotations in Java
#KT-10942 In Progress
2017-07-03 17:55:37 +03:00
Mikhail Glukhikh 840847e47c Code cleanup: several inspections applied 2017-06-29 16:25:57 +03:00
Alexander Udalov 7febd846e8 Export 'intellij-core' in module 'frontend'
Remove intellij-core from dependencies of modules which already depend
on frontend or any module that exports frontend (such as frontend.java)
2017-06-06 14:29:26 +03:00