Commit Graph

37961 Commits

Author SHA1 Message Date
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
Mikhail Glukhikh b121990368 Don't suggest 'remove let' when 'it' is used multiple times
So #KT-16857 Fixed
2017-03-24 16:20:00 +03:00
Mikhail Glukhikh 4687a867c3 Anti-KNPE refactoring of RedundantSamConstructorInspection
So EA-84354 fixed
2017-03-24 16:19:47 +03:00
Mikhail Glukhikh 6f4ae2585b Fix "surround with null check": place check correctly for unsafe call
So #KT-16928 Fixed
2017-03-24 16:19:32 +03:00
Mikhail Glukhikh bbdcf19123 Fix "secondary constructor -> primary" in case of implicit super call
So #KT-16903 Fixed
2017-03-24 16:19:18 +03:00
Mikhail Glukhikh 0baae16601 Don't apply "object->lambda" if 'this' is used inside #KT-15250 Fixed 2017-03-24 16:19:04 +03:00
Mikhail Glukhikh ca92ec0b7b Fix "Specify explicit lambda signature" when no parameters exists
So #KT-15075 Fixed
2017-03-24 16:18:56 +03:00
Vyacheslav Gerasimov f60a7ffab0 Add intentions to move property from/to primary constructor
#KT-4578 Fixed
2017-03-24 15:22:50 +03:00
Alexander Udalov fef4c8ccd8 Fix VerifyError on bound function reference on generic property
Also add a test for obsolete KT-14755

 #KT-16929 Fixed
2017-03-24 11:06:15 +03:00
Dmitry Petrov fc38479f48 References to enum entries should be always generated as GET_ENUM 2017-03-24 10:06:10 +03:00
Dmitry Petrov 64013171e8 KT-16905 Wrong IR for call to inner class constructor through typealias 2017-03-24 10:06:10 +03:00
Dmitry Petrov d05de88e3e KT-16904 Wrong IR when applying some operators to superclass properties in constructor
Use property accessors for assignment generation for inherited properties in constructor.
2017-03-24 10:06:10 +03:00
Nikolay Krasko 5405c81106 Minor: remove warnings in KotlinDebuggerTestBase 2017-03-23 21:01:42 +03:00
Nikolay Krasko dfd7b0f388 Delegate step into command to kotlin command provider first 2017-03-23 21:01:42 +03:00
Nikolay Krasko 2c4f702d50 Remove stored contexts in tests to avoid leaks 2017-03-23 21:01:42 +03:00
Nikolay Krasko 2aa1b19ec9 Replace CompilingEvaluatorUtils methods with ClassLoadingUtils 2017-03-23 21:01:42 +03:00
Ilya Chernikov 3b60d56c0b minor: fixing maven plugin tests 2017-03-23 18:11:40 +01:00
Ilya Chernikov 4d7e64614a Make daemon tests more stable
Probably due to switching to the JDK8, the daemon tests became more flaky.
Making it less reliable on the log file closing. And try to close log files
on the daemon side.
Also improving diagnostics on many tests.

Also weaken parallel daemon start test a bit since it seems it is failing
on the RMI timeouts now.
2017-03-23 18:11:39 +01:00
Ilya Chernikov c034a73d72 Extract and reuse JarFS-related IO fallback configurator function
Partly fixes #KT-16927
2017-03-23 18:11:38 +01:00
Ilya Chernikov e59f6741c4 Move GradleScriptTemplatesProvider to the optional gradle part of "plugin.xml"
Fixes #KT-16649
2017-03-23 18:11:37 +01:00