Commit Graph

37980 Commits

Author SHA1 Message Date
Pavel V. Talanov ee33879031 Light class tests: hidden deprecated affects codegen
Provide fix later
2017-03-27 17:59:05 +03:00
Pavel V. Talanov e822a17c0d Lazy light classes: can't use laziness for classes with supertypes delegates 2017-03-27 17:59:03 +03:00
Pavel V. Talanov 2291d91109 KtLightMethod: isVarArgs() does not trigger exact delegate computation 2017-03-27 17:59:01 +03:00
Pavel V. Talanov c4be805962 Light members: allow to get modifier list without computing delegate 2017-03-27 17:58:59 +03:00
Pavel V. Talanov e84a674504 LazyLightClassDataHolder: rollback optimization on suspected inherited internal visibility
Internal visibility affects member names
2017-03-27 17:58:57 +03:00
Pavel V. Talanov ec895f18f2 Light classes: refactor, move getOrigin to corresponding classes 2017-03-27 17:58:55 +03:00
Pavel V. Talanov a2511232ab Lazy light classes: fix visibility modifier in case of inherited protected visibility 2017-03-27 17:58:53 +03:00
Pavel V. Talanov a81bac0b50 LightClassTest: test corner cases related to inherited visiblity
EA-99155
 #KT-16899 Fixed
2017-03-27 17:58:51 +03:00
Pavel V. Talanov 4b85fd9fbe Refactor light members: introduce KtLightMemberImpl
Holds common code for fields and methods
2017-03-27 17:58:49 +03:00
Pavel V. Talanov a44aa8e112 Introduce KotlinOverridableInternalMembersShortNameIndex
Keeping track of all potentially overridable internal members
To optimize certain scenarios in light classes
2017-03-27 17:58:47 +03:00
Pavel V. Talanov 24303c8b39 Minor, stubs: isTrait -> isInterface 2017-03-27 17:58:45 +03:00
Alexander Udalov 1c7ac2da5a Do not use CoreJavaFileManager in KotlinCliJavaFileManagerImpl
The inheritance is still needed because of the code in intellij-core,
specifically in JavaCoreProjectEnvironment.addSourcesToClasspath and
CoreJavaDirectoryService.getPackage, which assumes that the
JavaFileManager instance in the project is a CoreJavaFileManager
2017-03-27 17:19:25 +03:00
Alexander Udalov c67eb84369 Support nested classes in KotlinCliJavaFileManagerImpl.findClass
findClass(String, GlobalSearchScope) is invoked for example when we're
resolving supertypes of classes in Java libraries. Previously, it never
found nested classes and falled back to CoreJavaFileManager's
implementation, which lacks a fix for the original issue (KT-12664,
which was fixed in JvmDependenciesIndex in 5a533a52 and 164c72e8)

 #KT-16931 Fixed
2017-03-27 17:19:24 +03:00
Alexander Udalov f1a1ebae01 Refactor JvmDependenciesIndex
- Move collectKnownClassNamesInPackage to the only place where it's used
- Fix warnings/inspections and simplify implementation a bit
2017-03-27 17:19:24 +03:00
Alexander Udalov 801a93edbc Refactor KotlinJavaPsiFacade.KotlinPsiElementFinderImpl
Split KotlinPsiElementFinderImpl into two classes: one is used in the
compiler (boolean field isCliFileManager previously handled that), the
other is used in IDE and possibly other non-CLI scenarios.

Also avoid a possible class cast exception in
KotlinJavaPsiFacade.knownClassNamesInPackage
2017-03-27 17:19:24 +03:00
Dmitry Jemerov d8dfad875d Drop pre-1.0 whole-project syntax migration actions 2017-03-27 14:57:44 +02:00
Alexander Udalov d615aba4cf Update KotlinVersion.CURRENT to 1.1.3 2017-03-27 10:48:18 +03:00
Mikhail Zarechenskiy 3f1a43a743 Minor, update test data
See 8466270 for the reason.
 Note that actually we do not report errors on such cases because psiElement is not valid, but in tests for intentions we check all errors
2017-03-27 10:36:10 +03:00
Alexey Sedunov 298ee266c3 Move: Fix conflict checking when switching between similar libraries
#KT-17006 Fixed
2017-03-26 12:56:26 +03:00
Alexey Sedunov 45b8cd29e1 Resolution Facade: Add explicit property for file target platform 2017-03-26 12:56:25 +03:00
Alexey Sedunov 87ea13b307 Move: Fix runtime unconfiguration for multiple modules 2017-03-26 12:56:24 +03:00
Alexey Sedunov 1d0162402e Move: Fix processing of calls and callable references
Fix CCE on callable references to Java methods.
Fix qualification of callable references without receivers.
Fix processing of calls/callable references to object extensions
and extension members.
Do not explicate short companion references

 #KT-16809 Fixed
2017-03-26 12:56:24 +03:00
Alexey Sedunov 58495555dc Move: Perform extension import insertion after reference shortening 2017-03-26 12:56:22 +03:00
Alexey Sedunov b3274acfc0 Refactor KotlinShortenReferencesRefactringHelper
Rename refactoring helper and its infrastructure
Add support for different request types
2017-03-26 12:56:21 +03:00
Alexey Sedunov dc04b200b6 Move: Do not shorten references unaffected by the refactoring 2017-03-26 12:56:20 +03:00
Alexey Sedunov aad11ff0f4 Shorten References: Skip companion receivers on callable references
This is temporary fix due to KT-13934 which prevents resolution
of references like X::foo where foo is a member or extension
of X companion object
2017-03-26 12:56:19 +03:00
Alexey Sedunov d71cefee8a Move: Fix "scanEntireFile" values after the refactoring
#KT-17032 Fixed
2017-03-26 12:56:18 +03:00
Alexey Sedunov b818ef0a51 Kotlin Facet: Detect module platform by 'kotlin'/'kotlin2js' plugin 2017-03-26 12:56:17 +03:00
Alexey Sedunov 0ad28228d7 Kotlin Facet: Fix settings initialization 2017-03-26 12:56:16 +03:00
Ilya Gorbunov d54f11421f Run gradle unit tests with Java 8 2017-03-25 04:14:17 +03:00
Ilya Gorbunov 6dc4056d5f Fix missing kotlin-test dependencies
(previously it was bundled to kotlin-compiler-embeddable)
2017-03-25 04:13:52 +03:00
Vyacheslav Gerasimov 8c41e44b3b Fix MovePropertyToConstructorIntention and broken tests 2017-03-24 21:55:27 +03:00
Dmitry Jemerov efa03e7ad8 Fix project leaks in tests 2017-03-24 19:51:32 +01:00
Yan Zhulanow eda3b08c31 Kapt3: Fix Maven build on CI
'tools_jar_profile' Maven profile is activated only if 'kotlin-annotation-processing-maven-build.txt' exists.
It already works this say for the 'kotlin-annotation-processing' artifact.
2017-03-24 20:02:39 +03:00
Yan Zhulanow e84eadebdc Kapt3: Use 'compilerArgs' safely (KT-16990)
'android-apt' (com.neenbedankt) adds the 'File' instance to 'compilerArgs' (List<String>).
2017-03-24 20:02:38 +03:00
Alexander Udalov 6d69e37fe9 Update to ASM 6-alpha from intellij 171
Will be needed to read module-info files
2017-03-24 19:46:35 +03:00
Alexander Udalov c99b03d6b3 Remove unused library 'intellij-core-analysis' 2017-03-24 19:46:35 +03:00
Ilya Gorbunov c98c2d9931 Remove 'nearly_stateless' category, do not mention statefulness for terminal operations.
#KT-16994
2017-03-24 19:06:06 +03:00
Ilya Gorbunov 4018db680e Sequence operation classification regarding their statefulness and laziness.
#KT-16994 Fixed
2017-03-24 19:06:06 +03:00
Alexey Tsvetkov 0a4c43a5f1 Fallback to ProcessBuilder when native ProcessLauncher fails
#KT-16902 fixed
2017-03-24 19:03:41 +03:00
Alexey Tsvetkov 9d95c841a6 Use connect-and-lease when using daemon in JPS & Gradle
Relates to KT-15562 "Service is dying".

This commit includes multiple changes:
 1. JPS & Gradle daemon clients are refactored to use `connectAndLease` from `KotlinCompilerClient`.
 `connectAndLease` was introduced in previous commits
 2. `withKotlin` was removed because `connectAndLease` already covers retrying on connection error
 3. Gradle flag files creation is changed:
   * client-alive flag file lives as long as Gradle instance lives,
   * session-alive flag file lives until the end of a build.
2017-03-24 19:03:36 +03:00
Alexey Tsvetkov 9819de1abd Improve daemon client debug reports
Before this change a daemon client debug messages were printed
only when the client could not connect and the 'kotlin.daemon.verbose'
system property was set up.

Now messages are printed if the debug logging is enabled and
the 'kotlin.daemon.verbose' is set up.
2017-03-24 19:03:32 +03:00
Alexey Tsvetkov c5324fcc50 Speed up daemon startup when DNS timeouts
#KT-16917 fixed

The daemon code contained the following code:
```
ManagementFactory.getRuntimeMXBean().name
```

As it turns out `RuntimeImpl#getName` calls `VMManagementImpl#getVmId`,
which in turn calls `InetAddress.getLocalHost().getHostName()`.

`InetAddress.getLocalHost()` tries to resolve by making a DNS-request.
In case of a DNS-problem or a network misconfiguration,
resolving localhost can be very slow,
so a daemon client can disconnect
by the timeout (10 seconds) and fallback to the non-daemon compilation.

This change removes the call `getRuntimeMXBean().name`
(it is only used for logs).
2017-03-24 19:03:28 +03:00
Alexey Tsvetkov da24a99b91 Set 'java.rmi.server.hostname' property on client too
The RMI documentation (http://docs.oracle.com/javase/7/docs/technotes/guides/rmi/javarmiproperties.html)
says it is useful to set up a `java.rmi.server.hostname`
system property on a client and a server.
When the property is set up on a client, I saw that "RenewClean" threads
stopped listening to my external IP, so all client and server threads
are now only listening the loopback interface.

I also changed the way the property is set up on the server side:
before the change it was passed in jvmargs at a process launcher.
I moved this code directly to the main method of the daemon,
because it is easy to forget to set up the property,
when running the main for debug purposes.
2017-03-24 19:03:24 +03:00
Alexey Tsvetkov f748dc625c Minor: print errors to stderr when gradle test build
It takes time to find compile errors or exceptions,
when a Gradle test build fails, because a debug log
is very verbose.
This change prints all error messages from Gradle
when a test build fails unexpectedly.
2017-03-24 19:03:19 +03:00
Dmitry Jemerov 961d83fcd4 Bump code cache size (64m is no longer enough under JDK 8) 2017-03-24 16:40:23 +01:00
Dmitry Jemerov 859e3e17b4 Bump code cache size (64m is no longer enough under JDK 8) 2017-03-24 16:37:11 +01:00
Vyacheslav Gerasimov 543f59bf54 Add new quickfix for CanBePrimaryConstructorPropertyInspection
MovePropertyToConstructorIntention is used as quick fix
2017-03-24 17:38:52 +03:00
mglukhikh 4700936f66 DFA: count null comparison as identity comparison #KT-16538 Fixed
+ minor parameter refactoring
2017-03-24 17:33:42 +03:00
Mikhail Glukhikh b5aa529901 Make inspection "lambda->reference" off by default #KT-17002 Fixed 2017-03-24 16:20:07 +03:00