8 weeks agoIDEA-248474: Debug Window Unavailable via Run > Attach Debugger to Android Process 203.2986
Andrei Kuznetsov [Thu, 27 Aug 2020 22:02:51 +0000 (01:02 +0300)]
IDEA-248474: Debug Window Unavailable via Run > Attach Debugger to Android Process

`ProgramRunnerUtil.executeConfiguration[Async]` should be invoked on EDT with IW lock, because it will open debug toolwindow. ToolwindowManager needs EDT to perform manipulations with toolwindows.

Also make sure that `ExecutorService#execute` is used instead of `ExecutorService#submit` when possible, because `execute` will log exceptions, `submit` will not (client should  handle future result be it some value or an exception).

GitOrigin-RevId: 7c993cb587db00aab1ada1003dbaf2c3e102496f

8 weeks agoAdd LICENSE.txt to android-plugin repository (Apache License version 2.0)
Andrei Kuznetsov [Thu, 27 Aug 2020 19:26:11 +0000 (22:26 +0300)]
Add LICENSE.txt to android-plugin repository (Apache License version 2.0)

The code has already been distributed under Apache 2.0 license. With the explicit LICENSE.txt this fact is made more evident.

GitOrigin-RevId: 913a6c5a0294bf6b21f13a33bfcd4e144a1aead5

8 weeks agoIDEA-248934: Android: missing 'Resource Manager' toolwindow
Andrei Kuznetsov [Thu, 27 Aug 2020 11:47:12 +0000 (14:47 +0300)]
IDEA-248934: Android: missing 'Resource Manager' toolwindow

Convert 'Resource Manager' toolwindow to facet-dependent toolwindow to make it available when android facet is added (`shouldBeAvailable` invoked only once during ToolwindowManager initialization)

Also fix warning in plugin descriptor: Plugins developed as a part of IntelliJ IDEA project shouldn't specify generic plugin url

GitOrigin-RevId: 5f2a752070a95bb9567bdd8eab0cfd70f9222e68

8 weeks ago[jps build] i18n: internationalize messages in module (IDEA-240279)
Nikolay Chashnikov [Wed, 26 Aug 2020 15:05:55 +0000 (18:05 +0300)]
[jps build] i18n: internationalize messages in module (IDEA-240279)

GitOrigin-RevId: 37b71c9cd58add722c1aab9895d34facd3065088

8 weeks ago[i18n] idea-ui - remove nls annotations from overridden methods
Nikita Eshkeev [Tue, 25 Aug 2020 19:36:22 +0000 (22:36 +0300)]
[i18n] idea-ui - remove nls annotations from overridden methods

This patch removes the nls related annotations from overridden methods that were automatically generated as per the code review.

Signed-off-by: Nikita Eshkeev <>
GitOrigin-RevId: 9afd924260b791548698fdb917e7a383f385a03a

2 months ago[i18n] idea-ui
Nikita Eshkeev [Mon, 24 Aug 2020 16:01:23 +0000 (19:01 +0300)]
[i18n] idea-ui

This patch fixes the notes from the review for ProjectLayoutPanel, it replaces the string concatenations in the NLS context with proper properties.

Signed-off-by: Nikita Eshkeev <>
GitOrigin-RevId: e1781eb13a60bfcacc1cd35c5c61bb74d213fd71

2 months ago[Workspace Model] Add bomb for facet test
Alex Plate [Mon, 24 Aug 2020 10:07:12 +0000 (13:07 +0300)]
[Workspace Model] Add bomb for facet test

GitOrigin-RevId: 6d6e5bf77bf9558d4892a19b237a6281dd5f1fa0

2 months agoIDEA-244848: delete duplicated groups
Anastasia Ivanova [Fri, 21 Aug 2020 17:30:18 +0000 (19:30 +0200)]
IDEA-244848: delete duplicated groups

GitOrigin-RevId: a1db38429fb67e4991bc24efd8fec04a1e6bd138

2 months agomark notnull array elements to diagnose EA-235908 - IAE: GenericsHighlightUtil.$...
Alexey Kudravtsev [Fri, 21 Aug 2020 21:52:06 +0000 (00:52 +0300)]
mark notnull array elements to diagnose EA-235908 - IAE: GenericsHighlightUtil.$$$reportNull$$$

GitOrigin-RevId: a5e3768e6d0a99a0bd0ee1296c131a4877bc5968

2 months agocleanup: wildcardize functional interface usages for more exact types in platform
Alexey Kudravtsev [Wed, 19 Aug 2020 18:30:06 +0000 (21:30 +0300)]
cleanup: wildcardize functional interface usages for more exact types in platform

GitOrigin-RevId: 3af0bb041f43c386bf0b79f3549f5f8881bb85d0

2 months agoWEB-46940 I18n: introduce PresentableEnum and cleanup some of code style settings...
Piotr Tomiak [Fri, 21 Aug 2020 12:00:36 +0000 (14:00 +0200)]
WEB-46940 I18n: introduce PresentableEnum and cleanup some of code style settings rendering.

GitOrigin-RevId: 2ea3d77ea1a415082f0693acfd2b86631d8bd23a

2 months agojps-javac-extension project extracted
Eugene Zhuravlev [Fri, 21 Aug 2020 12:39:59 +0000 (14:39 +0200)]
jps-javac-extension project extracted

GitOrigin-RevId: e88bcbe562fa67445996dc5e59d535293e7969db

2 months agoIDEA-248591 I18n: XML plugins
Piotr Tomiak [Thu, 20 Aug 2020 18:34:03 +0000 (20:34 +0200)]
IDEA-248591 I18n: XML plugins

GitOrigin-RevId: c3bbd04c0b1f9cee1cb21a8689a758d0c2dfe91c

2 months agoIDEA-248591 I18n: cleanup key names in XML Analysis Bundle
Piotr Tomiak [Thu, 20 Aug 2020 10:58:40 +0000 (12:58 +0200)]
IDEA-248591 I18n: cleanup key names in XML Analysis Bundle

GitOrigin-RevId: 29e900def0246774f13b493966f52cc246a49b0f

2 months ago[java] i18n
Tagir Valeev [Thu, 20 Aug 2020 07:36:58 +0000 (14:36 +0700)]
[java] i18n

GitOrigin-RevId: a192ba05b86da2fb7fe64f08ac30f5d4e18a229a

2 months ago[android] use read action to access ProjectJdkTable (IDEA-222480)
Nikolay Chashnikov [Wed, 19 Aug 2020 11:27:11 +0000 (14:27 +0300)]
[android] use read action to access ProjectJdkTable (IDEA-222480)

ProjectJdkTable is a service, and it invokes runReadAction in his loadState. Since state is loaded under lock on the service class, it leads to deadlock if one thread tries to get instance of the service under write action, and another under no lock at all.

Anyway ProjectJdkTable::getSdksOfType should be called under read action to avoid concurrency problems.

GitOrigin-RevId: c2000f5fb8d5519805852abba0745e6b82fb7874

2 months agoIJ-CR-2748: [android] use 1.7 language level to compile classes used inside Gradle...
Vladislav.Soroka [Tue, 18 Aug 2020 12:07:37 +0000 (15:07 +0300)]
IJ-CR-2748: [android] use 1.7 language level to compile classes used inside Gradle process IDEA-248251

(cherry picked from commit 15d79ee85b4d78eeb03f857a4545ca1313854723)

GitOrigin-RevId: d8e82276d7e8d51e4a30696c71ce30650171d5a5

2 months agoIDEA-244848 get rid of notificationAllowlist
Anastasia Ivanova [Tue, 11 Aug 2020 15:01:50 +0000 (17:01 +0200)]
IDEA-244848 get rid of notificationAllowlist

GitOrigin-RevId: b867ba1c960df3d667fa262b6a95c82a6163e65e

2 months agoRevert "IDEA-CR-65973: IDEA-244848 add missing isLogByDefault flags"
Dmitriy.Panov [Fri, 14 Aug 2020 22:02:43 +0000 (01:02 +0300)]
Revert "IDEA-CR-65973: IDEA-244848 add missing isLogByDefault flags"

This reverts commit 00bd951f

Revert "IDEA-CR-65973: IDEA-244848 store notificationIds only for jb plugins, clean notificationIds"

This reverts commit d41ad479

Revert "IDEA-CR-65973: IDEA-244848 add NotNull and buildAndNotify in NotificationBuilder"

This reverts commit 0adf7682

Revert "IDEA-CR-65973: IDEA-244848 support NotificationGroupEP in devkit"

This reverts commit f9fddec5

Revert "IDEA-CR-65973: IDEA-244848 deprecate and notification.parentGroup"

This reverts commit 4220a37a

Revert "IDEA-CR-65973: IDEA-244848 get rid of notificationAllowlist"

This reverts commit e46fe5f0

Revert "IDEA-CR-65973: IDEA-244848 Register notification groups in plugin.xml"

This reverts commit d6f195d4

GitOrigin-RevId: f96347a5e55ab8c3c7ada9bd97b7b97cfa77bdd7

2 months agoIDEA-246198 Adjusted platform usages and implementations of FormattingModelBuilder
Alexandr Evstigneev [Tue, 21 Jul 2020 04:53:50 +0000 (07:53 +0300)]
IDEA-246198 Adjusted platform usages and implementations of FormattingModelBuilder


GitOrigin-RevId: d06605b0187959f9e36150054a1a5c043a816338

2 months agoIDEA-CR-65973: IDEA-244848 get rid of notificationAllowlist
Anastasia Ivanova [Tue, 11 Aug 2020 15:01:50 +0000 (17:01 +0200)]
IDEA-CR-65973: IDEA-244848 get rid of notificationAllowlist

GitOrigin-RevId: e46fe5f0e6c6729c4d5ae854f4a5b6cfd6b6af08

2 months ago[i18n] idea-ui
Nikita Eshkeev [Thu, 13 Aug 2020 23:52:46 +0000 (02:52 +0300)]
[i18n] idea-ui

This patch replaces hard coded strings with i18n properties in idea-ui and in some other modules that implement interfaces and extend classes from the idea-ui module

Signed-off-by: Nikita Eshkeev <>
GitOrigin-RevId: 6b280b485e30b5d47b8803205b0ebbafe4319daf

2 months ago[android] migrate to Java 11: update equalsverifier library to 3.4.1
Nikolay Chashnikov [Tue, 11 Aug 2020 11:37:17 +0000 (14:37 +0300)]
[android] migrate to Java 11: update equalsverifier library to 3.4.1

The old version doesn't fully support Java 11 so e.g. SimpleIncludeValueTest failed while loading nested classes compiled by Javac 11.

GitOrigin-RevId: 5a6d273fc31f5a97e01c3878e68b4e8972c4dd1a

2 months ago[IntelliJ project configuration] migration to Java 11: explicitly set Java 8 language...
Nikolay Chashnikov [Tue, 11 Aug 2020 10:23:09 +0000 (13:23 +0300)]
[IntelliJ project configuration] migration to Java 11: explicitly set Java 8 language level for

This module is added to classpath of JPS build process so it should stay on Java 8 (see IDEA-243693) after we migrate IDE modules to Java 11 (IDEA-241075). Currently this module depends on modules available inside IDE process only (see IDEA-247946) so we need to ignore these dependencies in JavaVersionInIntelliJModulesTest.

GitOrigin-RevId: 6e0bf06e233ff3e903a403aefaf2d7d2ceef2c7e

2 months ago[android] migration to Java 11: remove @Override annotations from some methods in...
Nikolay Chashnikov [Tue, 16 Jun 2020 12:14:13 +0000 (15:14 +0300)]
[android] migration to Java 11: remove @Override annotations from some methods in RenderSecurityManager

These methods doesn't override method from super-class so we need to remove annotations to make code compilable under JKD 11 (IDEA-241075).

GitOrigin-RevId: 3672a576e9fdc89b03bdffc00564efb2c544457b

2 months ago[platform] migration to Java 11: adapt code to changes in Swing API (IDEA-241075)
Nikolay Chashnikov [Tue, 16 Jun 2020 12:12:21 +0000 (15:12 +0300)]
[platform] migration to Java 11: adapt code to changes in Swing API (IDEA-241075)

GitOrigin-RevId: 6ce8f5e200f5dc8f00344d909d1a85721de98a98

2 months ago[android] migration to java 11: add explicit dependency on javax.activation library
Nikolay Chashnikov [Mon, 10 Aug 2020 16:25:59 +0000 (19:25 +0300)]
[android] migration to java 11: add explicit dependency on javax.activation library

AndroidBuildProcessParametersProvider refers to javax.activation.DataSource class which isn't included into JDK 11, so we need to add dependency on javax.activation library (it's included into the IDE distribution anyway).

GitOrigin-RevId: 47bce60d59fa6ed7e4e4cbd7293404a6e23e73ed

2 months agoproguard/r8 scope enlarger should not produce affect search scope if no proguard...
Dmitry Batkovich [Mon, 10 Aug 2020 07:20:56 +0000 (10:20 +0300)]
proguard/r8 scope enlarger should not produce affect search scope if no proguard/r8 files present in project

GitOrigin-RevId: 0c760119eeaf3a1073434ea029f5cd02ec00d383

2 months agoIDEA-239645 i18n: android - "Download location"
Dmitry.Krasilschikov [Sun, 9 Aug 2020 18:20:17 +0000 (21:20 +0300)]
IDEA-239645 i18n: android - "Download location"

GitOrigin-RevId: 442042b43df972229ae91111f6f4a0abd1f6f02d

2 months ago[workspace model] IDEA-246697 Fix OOM at external build system project import
Mikhail Mazurkevich [Thu, 30 Jul 2020 16:27:43 +0000 (19:27 +0300)]
[workspace model] IDEA-246697 Fix OOM at external build system project import

The precondition, the project should be opened based on this storage already be filled with project data.
The first problem that during reimport we create a lot of modifiable models with copied storage instead
of reusing one storage build in all modifiable models. To fix it `IdeModifiableModelsProviderImpI` was
rewritten and now, if the new project model enabled it creates modifiable models with a single instance
of the storage builder passed as a parameter.
The second problem of the huge memory consumption was related to the `VersionedEntityStorageOnBuilder`
which creates and caches a copy of the store if any changes were there. Thus we get `ValuesCache` the
full of storages of the different versions (e.g during regular execution of
`ModifiableRootModelBridgeImpl.addModuleOrderEntry` on the same modifiable model). To fix it
`DummyVersionedEntityStorage` was introduced which cache nothing and now modifiable model contains a
boolean flag which tells us if the data in the model should be cached.

GitOrigin-RevId: e54ceec0ec4f3b3fb18b68137580dbd4b070e744

2 months ago[i18n] idea-ui
Nikita Eshkeev [Thu, 6 Aug 2020 19:57:26 +0000 (22:57 +0300)]
[i18n] idea-ui

This patch replaces hard coded strings with i18n properties in idea-ui

Signed-off-by: Nikita Eshkeev <>
GitOrigin-RevId: f481ab904b8648a9f0d68d4de91e1f31c01be49f

2 months ago[android] Fixing compilation for Kotlin 1.4.0
Nicolay Mitropolsky [Tue, 4 Aug 2020 10:20:23 +0000 (13:20 +0300)]
[android] Fixing compilation for Kotlin 1.4.0

GitOrigin-RevId: 2ab2b5a9770d38d4da546f473671d8893420e0fc

2 months agoadd assertion for confusing empty path for allowRootAccess()
Alexey Kudravtsev [Wed, 5 Aug 2020 15:09:16 +0000 (18:09 +0300)]
add assertion for confusing empty path for allowRootAccess()

GitOrigin-RevId: 5b3733ef3b5c27f3a876a469516a08f01460b389

2 months agoAndroid: allow remote repositories in tests with gradle in IDEA (but not in Android...
Andrei Kuznetsov [Tue, 4 Aug 2020 17:03:55 +0000 (20:03 +0300)]
Android: allow remote repositories in tests with gradle in IDEA (but not in Android Studio)

This should simplify environment setup. In particular, this will help us not to re-build ZIP with offline m2 repositories when we update kotlin plugin.

GitOrigin-RevId: d0f709feb1ef183450926cabb4cb683a9e1c2a70

2 months agowelcome screen: update New Project icons, use General.Add for other places
Nadya Zabrodina [Mon, 27 Jul 2020 11:25:27 +0000 (14:25 +0300)]
welcome screen: update New Project icons, use General.Add for other places

GitOrigin-RevId: 866d7cfb0926259fd705db426c242bdd3ce4132b

2 months agoIDEA-247128: cleanup: `extends AnAction implements DumbAware` = `extends DumbAwareAction`
Andrei Kuznetsov [Mon, 3 Aug 2020 15:26:55 +0000 (18:26 +0300)]
IDEA-247128: cleanup: `extends AnAction implements DumbAware` = `extends DumbAwareAction`

GitOrigin-RevId: 91fdc67d5b5125dfa86b098719851a5631e5bb14

2 months agoIDEA-246840: Android: Fix missing toolbar in Android NavEditor
Andrei Kuznetsov [Sun, 2 Aug 2020 22:45:45 +0000 (01:45 +0300)]
IDEA-246840: Android: Fix missing toolbar in Android NavEditor

GitOrigin-RevId: 95e5aa7a478fc7fd15cce45da04cd2734156bfe0

2 months agoIDEA-247128: Android: Fix missing icons and tooltips in Android Layout editor
Andrei Kuznetsov [Sun, 2 Aug 2020 21:07:55 +0000 (00:07 +0300)]
IDEA-247128: Android: Fix missing icons and tooltips in Android Layout editor

GitOrigin-RevId: 4f498166d9b8362676af180e4e5d821cf46bf238

2 months agoIDEA-247241: Android Layout Editor: let dumb aware actions implement DumbAware, not...
Andrei Kuznetsov [Sun, 2 Aug 2020 21:03:11 +0000 (00:03 +0300)]
IDEA-247241: Android Layout Editor: let dumb aware actions implement DumbAware, not simply Presentation.setEnabled(true)

This commit partially reverts this one: "Always enable hide/gear actions in tool windows.  Independent of dumb mode.  Bug: 145309578 Test: Unit test added. Change-Id: Ief3523742740b98cdda2d620ef41fed7195497b4  GitOrigin-RevId: c598d570a566739e84a62adf2a4aa7b1770f46a8". It reverts prod code, but keeps tests.

All the actions manipulating with the workbench layout were made DumbAware, so not only they are enabled, but also they work as intended. So user does not see weird notification like "'Hide' is not available while IDEA is updating indices"

GitOrigin-RevId: b3a2ad62c96175eabe16032dc70b7e0e80a3ffb6

2 months agoIDEA-246929: AndroidBuildProcessParametersProvider should not throw NPE if some class...
Andrei Kuznetsov [Fri, 31 Jul 2020 22:32:26 +0000 (01:32 +0300)]
IDEA-246929: AndroidBuildProcessParametersProvider should not throw NPE if some class is available via "jrt://..." url

i.e. when some class is provided by the JVM. Note that in some situations ignoring missing JARs may lead to undesired consequences. E.g. if IDEA runs on Java 11 EA version (and javaee-related classes are available via  jrt://), but JPS process runs on Java 11 stable version (and javaee-related classes should be added from some external jar). Currently we consider this situation to be rare. NPE is bad thing anyway. Replace it with a warning in prod (and throw an error in unit test mode), since we cannot do anything helpful anyway. If jar is missing, but needed then ClassNotFound will be thrown, if it is not even needed (e.g. project does not have android modules) error will not happen at all.

GitOrigin-RevId: 2616c9c898d22d397e97082b269f2a6b39b437af

2 months agoRUBY-26840: Android: NPE in AndroidFileChangeListener: `null` is legal value for...
Andrei Kuznetsov [Fri, 31 Jul 2020 16:12:37 +0000 (19:12 +0300)]
RUBY-26840: Android: NPE in AndroidFileChangeListener: `null` is legal value for `VirtualFile.getParent()`

In Ruby's IRB Console `LightVirtualFile` is created and used to interact with a user. It is common that `LightVirtualFile`s report `null` as their parent. Fix `` to be more LightVirtualFile friendly.

GitOrigin-RevId: f3dd41e95e00488308cef3bad1e677c402468f5c

2 months agocleanup
Vladimir Krivosheev [Fri, 31 Jul 2020 16:33:30 +0000 (18:33 +0200)]

GitOrigin-RevId: 19cd9cd57f8ccf9b8b29b6734e1ecd618227c06c

2 months agouse file.isCaseSensitive() instead of some VirtualFileSystem.isCaseSensitive()/System...
Alexey Kudravtsev [Fri, 31 Jul 2020 15:24:57 +0000 (18:24 +0300)]
use file.isCaseSensitive() instead of some VirtualFileSystem.isCaseSensitive()/SystemInfo.isCaseSensitive to support per-directory case sensitivity

GitOrigin-RevId: d7e7ecbba51a13c13935001238825b3740888458

2 months agoCleanup (deprecated `StreamUtil` usages)
Roman Shevchenko [Thu, 30 Jul 2020 21:35:42 +0000 (23:35 +0200)]
Cleanup (deprecated `StreamUtil` usages)

GitOrigin-RevId: 0657baa69d7828818e638edb989baa6bc38172ab

2 months agoIDEA-246976 prefer Path
Vladimir Krivosheev [Thu, 30 Jul 2020 15:55:17 +0000 (17:55 +0200)]
IDEA-246976 prefer Path

GitOrigin-RevId: 3e19c4cf7f906b248bfda0f4ffbabe614bbbde36

2 months agoremove duplicated code - showOkCancelDialog, showYesNoDialog, prefer MessageDialogBui...
Vladimir Krivosheev [Wed, 29 Jul 2020 11:57:10 +0000 (13:57 +0200)]
remove duplicated code - showOkCancelDialog, showYesNoDialog, prefer MessageDialogBuilder instead of showYesNoDialog (simple variant only for now), use power of named parameters to simplify code and make it more readable

GitOrigin-RevId: 9fe62de62cbaee7d445e6bd941b8cf48a6fb3235

2 months agoavoid loading test-only classes in production — extract TestDialogManager service
Vladimir Krivosheev [Wed, 29 Jul 2020 13:40:38 +0000 (15:40 +0200)]
avoid loading test-only classes in production — extract TestDialogManager service

GitOrigin-RevId: 170ea8aeebc77f9ff64cecdb16e3bf4639ff5b9e

2 months agourl classloader — avoid dependency on 3rd-party collection lib
Vladimir Krivosheev [Tue, 28 Jul 2020 16:35:52 +0000 (18:35 +0200)]
url classloader — avoid dependency on 3rd-party collection lib

do not export dependency on url class loader module

GitOrigin-RevId: 42c12d0f1b0cdd2c30881aa5f1f83ef693834af6

2 months agoAndroid: update test data (fix failing tests after THashMap->HashMap migration) 203.1774 pycharm/203.1774.6
Andrei Kuznetsov [Tue, 28 Jul 2020 18:09:47 +0000 (21:09 +0300)]
Android: update test data (fix failing tests after THashMap->HashMap migration)

Note that default code style in IDEA does not specify order on `xmlns:` attributes. It only says that the order does not change during formatting, and it should be placed before any other attribute.

GitOrigin-RevId: cf03b356eb391bb89104b30168792fd70aa9a67a

2 months agoIDEA-231267: Android: use Project JDK as Gradle JVM, and keep JDK in range [8..11]
Andrei Kuznetsov [Mon, 27 Jul 2020 21:52:15 +0000 (00:52 +0300)]
IDEA-231267: Android: use Project JDK as Gradle JVM, and keep JDK in range [8..11]

Don't explicitly specify Gradle JVM when creating project - leave default value (project JDK) and set desired JDK as project JDK. Desired JDK is obtained from IdeSdks.getJdk which provides surely compatible JDK (or null if no such JDK in the project table).

IdeSdks.isJdkCompatible now does not return JDK newer than 11, because Android projects use Gradle 6.1.1 which is not compatible with JDK 14, and the largest LTS supported JDK which works fine with android tools is 11 (newer versions are not heavily tested as of now).

GitOrigin-RevId: a40a83cf923a7a7f7109615d78c79f7024c9f40e

2 months agoIDEA-231267: Android: Deduplicate code (Jdks.isApplicableJdk/IdeSdks.isJdkCompatible...
Andrei Kuznetsov [Mon, 27 Jul 2020 12:59:17 +0000 (15:59 +0300)]
IDEA-231267: Android: Deduplicate code (Jdks.isApplicableJdk/IdeSdks.isJdkCompatible). Prefer IdeSdks.isJdkCompatible

`Jdks.isApplicableJdk` and `IdeSdks.isJdkCompatible` are doing the same thing. Just keep one of them - `IdeSdks.isJdkCompatible`.
Note that LangualeLevel in `Jdks.isApplicableJdk(Sdk, LangualeLevel)` was only used to compare it with `Sdk.getJavaSdkVersion.getMaxLanguageLevel`, so it is safe to replace it with `JavaSdkVersion` (JDK of version X supports some language levels up to X inclusive).

Additional efforts might be needed to not suggest SDKs which minLanguageLevel is larger than required LanguageLevel Y. The following commit will partially fix this by limiting upper JDK version.

GitOrigin-RevId: d74d0d82874938d68315ca687a109bf53cc4cb05

2 months agoIDEA-231267: Android: Deduplicate code (`Jdks.chooseOrCreateJavaSdk`/`IdeSdks.getJdk...
Andrei Kuznetsov [Sun, 26 Jul 2020 21:32:57 +0000 (00:32 +0300)]
IDEA-231267: Android: Deduplicate code (`Jdks.chooseOrCreateJavaSdk`/`IdeSdks.getJdk()`). Prefer IdeSdks.getJdk()

`Jdks.chooseOrCreateJavaSdk` and `IdeSdks.getJdk()` are doing the same thing. Just keep one of them - `IdeSdks.getJdk()`.
Note that it is not possible to pass instance of IdeSdks to AndroidSdks constructor, because instance of AndroidSdks should be passed to IdeSdks constructor. Break the cycle: AndroidSdks will invoke IdeSdks.getInstance().getJdk() as needed

GitOrigin-RevId: b59ad7e09e255604f955beb84c00da689736b4dd

2 months agoIDEA-231267: Android: Deduplicate code (`getJdk`/`getJdkPath` methods behavior made...
Andrei Kuznetsov [Sat, 25 Jul 2020 21:50:10 +0000 (00:50 +0300)]
IDEA-231267: Android: Deduplicate code (`getJdk`/`getJdkPath` methods behavior made more aligned with each other)

Extract code which supposed to do the same things from `getJdk` and `getJdkPath` into new methods: `getExistingJdk` and `createNewJdk`. Now invariant `getJdk().getHomePath() == getJdkPath()` should hold in all the cases, except the situation when `getJdk().getHomePath() == null` for any reason, or `STUDIO_GRADLE_JDK` env variable is set (`getJdk()` does not handle `STUDIO_GRADLE_JDK`, only `getJdkPath()` is aware about this variable).

GitOrigin-RevId: 95d97d16a83979043ab93469b6f26836c95d2919

2 months ago[android tests] don't register Android SDK twice in AndroidManifestDomTest
Nikolay Chashnikov [Tue, 28 Jul 2020 17:49:57 +0000 (20:49 +0300)]
[android tests] don't register Android SDK twice in AndroidManifestDomTest

Android SDK is registered in Sdks.createLatestAndroidSdk, and if we register it in the test we'll get two identical instances in ProjectJdkTable. And during tearDown when removeJdk was called for a first time, it disposed ProjectJdkImpl instance and fired jdkRemoved event, and RootIndex tries to rebuild itself and accessed content of disposed ProjectJdkImpl instance (because the second instance is still present in ProjectJdkTable).

GitOrigin-RevId: bfe741569dfaa2a54c6d6680f93c268d39d2c264

2 months agofix test data
Vladimir Krivosheev [Sat, 25 Jul 2020 15:47:57 +0000 (17:47 +0200)]
fix test data

GitOrigin-RevId: 59f93e623e7b61aaaa8500838cecd4d3d2f18479

3 months agoi18n in Kotlin: kotlin parameter nls context annotations
Dmitry.Krasilschikov [Thu, 23 Jul 2020 16:51:51 +0000 (19:51 +0300)]
i18n in Kotlin: kotlin parameter nls context annotations

Mostly needed "Hard Coded String" inspection to work for kotlin API annotation in java

GitOrigin-RevId: ccd6b67eb5a72b4366a46bb0acbebc690c166bc5

3 months agoprefer jdk collections (ArrayDeque)
Vladimir Krivosheev [Thu, 23 Jul 2020 08:47:05 +0000 (10:47 +0200)]
prefer jdk collections (ArrayDeque)

GitOrigin-RevId: 34712845c5a5fd7c16e8e22c3ef0463cf6c03485

3 months agoIDEA-246228: Gradle JVM setting is ignored in a project with Android modules
Andrei Kuznetsov [Wed, 22 Jul 2020 20:47:07 +0000 (23:47 +0300)]
IDEA-246228: Gradle JVM setting is ignored in a project with Android modules

There is no need to invoke `operation.setJavaHome` explicitly. It is set in `org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.prepare(...)` few lines above

GitOrigin-RevId: 2995001785a981686f6323507da3bcbd1ddbe03f

3 months agoarchive file systems: cleanup disk access with checkCanceled, use it for content...
Peter Gromov [Wed, 22 Jul 2020 15:00:15 +0000 (17:00 +0200)]
archive file systems: cleanup disk access with checkCanceled, use it for content loading as well (EA-216314, EA-230422)

GitOrigin-RevId: 19f9906ee03c4d91952c6baad2a72470ca4130e7

3 months agoIDEA-246228: Gradle JVM setting is ignored in a project with Android modules
Andrei Kuznetsov [Tue, 21 Jul 2020 22:29:28 +0000 (01:29 +0300)]
IDEA-246228: Gradle JVM setting is ignored in a project with Android modules

GitOrigin-RevId: 165dcf62502ed181b67869d12a09615df12fcbb6

3 months agomark not null parameters @NotNull to fix yellow code
Alexey Kudravtsev [Thu, 16 Jul 2020 15:16:11 +0000 (18:16 +0300)]
mark not null parameters @NotNull to fix yellow code

GitOrigin-RevId: fe7b53cfa26ab7cc3a9fa4928680a08c1e57bf44

3 months agoavoid passing null argument to the @NotNull parameter
Alexey Kudravtsev [Thu, 16 Jul 2020 15:11:50 +0000 (18:11 +0300)]
avoid passing null argument to the @NotNull parameter

GitOrigin-RevId: bc585519d113bcafb3cc99ea7678dc5cde521d51

3 months agoDialogSaver - accept Path in addition to VirtualFile
Vladimir Krivosheev [Sun, 19 Jul 2020 10:44:07 +0000 (12:44 +0200)]
DialogSaver - accept Path in addition to VirtualFile

GitOrigin-RevId: 399d7997fee98e76062142b2984e1b3e963d84e2

3 months agoremove usages of isMacOSLion / isMacOSMountainLion because IJ Platform requires at...
Vladimir Krivosheev [Fri, 17 Jul 2020 07:52:53 +0000 (09:52 +0200)]
remove usages of isMacOSLion / isMacOSMountainLion because IJ Platform requires at least macOS 10.13

GitOrigin-RevId: c3d148fb6b0c0130a3220ffbc720de3f01d295d5

3 months agoBomb slow muted failing tests in IDEA to speed up test suite
Andrei Kuznetsov [Fri, 17 Jul 2020 08:29:44 +0000 (11:29 +0300)]
Bomb slow muted failing tests in IDEA to speed up test suite

This commit is to experiment with Android test suite performance. Most like it will not speed up anything. Gradle test cases are slow because of indexing. But in fact, sync tests do not need any indexes to complete. Mechanics is as follows: test case imports project from gradle. During import new modules are created. When a module is committed, it triggers "roots changed" event. This triggers indexing. Normally indexing is happening in parallel background thread, but there is a check in `com.intellij.openapi.project.DumbServiceImpl.isSynchronousTaskExecution` which detects unit-test mode, and starts execution in EDT. So test case have to wait few more minutes. Subsequent runs are much faster when indexes are warmed up.

GitOrigin-RevId: 0d183a3cc65b3e2583d440483e89f73e060af56c

3 months agoAnnotate bundle methods as Nls
Tagir Valeev [Fri, 17 Jul 2020 07:44:54 +0000 (14:44 +0700)]
Annotate bundle methods as Nls

GitOrigin-RevId: db851b498d99f538e1f747faa4fb4d954848982f

3 months agoMaintenanceActivity should be dumb-aware activity
Vladimir Krivosheev [Thu, 16 Jul 2020 17:03:14 +0000 (19:03 +0200)]
MaintenanceActivity should be dumb-aware activity

GitOrigin-RevId: 919dc1f8ff16743f522ce594e5853215b9173690

3 months agoAvoid using StdFileTypes
Tagir Valeev [Fri, 17 Jul 2020 03:35:55 +0000 (10:35 +0700)]
Avoid using StdFileTypes

GitOrigin-RevId: 1e9ad9fd34c5cc06d145e061da515fb7a29a07a7

3 months agodon't use createLazyKey for JavaPsiFacade
Vladimir Krivosheev [Tue, 14 Jul 2020 12:54:05 +0000 (14:54 +0200)]
don't use createLazyKey for JavaPsiFacade

GitOrigin-RevId: bc282038ba5264b228904fa98c7727a733ee2502

3 months agoIDEA-245480: Safe fix for "Can't start Java application in debug using gradle" when...
Andrei Kuznetsov [Tue, 14 Jul 2020 12:58:40 +0000 (15:58 +0300)]
IDEA-245480: Safe fix for "Can't start Java application in debug using gradle" when android module added to the project

GitOrigin-RevId: 7b4fb57442b8985d66f99b24ad9b41d0972bae9a

3 months agoFix failing StudioHelpManagerImplTest, and make some of these tests useful in IDEA...
Andrei Kuznetsov [Mon, 13 Jul 2020 18:18:10 +0000 (21:18 +0300)]
Fix failing StudioHelpManagerImplTest, and make some of these tests useful in IDEA (not only in Studio)

GitOrigin-RevId: f78427243319030520e114953bbfc4da88099259

3 months agoHeavyPlatformTestCase - do not create project file explicitly
Vladimir Krivosheev [Mon, 6 Jul 2020 13:41:08 +0000 (15:41 +0200)]
HeavyPlatformTestCase - do not create project file explicitly

GitOrigin-RevId: ff63aa57752fdf5303122ca5c6355a0eff722d70

3 months agoRe-use android-studio help topics is IDEA
Andrei Kuznetsov [Mon, 13 Jul 2020 16:01:48 +0000 (19:01 +0300)]
Re-use android-studio help topics is IDEA

From now on F1 in android tool-windows in IDEA will land a user to website, just like it happens in AndroidStudio.

GitOrigin-RevId: 3d8b0ef4f0cd71824d656664793e287c49757c8a

3 months agorefactor IdentifierHighlighterPassFactory.doWithHighlightingEnabled to prepare moving...
Alexey Kudravtsev [Sat, 11 Jul 2020 16:56:13 +0000 (19:56 +0300)]
refactor IdentifierHighlighterPassFactory.doWithHighlightingEnabled to prepare moving identifier highlighting out of a highlighting pass

GitOrigin-RevId: fee9ed0e4cf10d4ade320358c58ebd1ad3d8e403

3 months agoIDEA-243771: Android project tooltip in the New Project wizard is too long. Make...
Andrei Kuznetsov [Fri, 10 Jul 2020 21:11:13 +0000 (00:11 +0300)]
IDEA-243771: Android project tooltip in the New Project wizard is too long. Make it multiline.

GitOrigin-RevId: 46d6478f374548e004b075b492724cc06d0a0736

3 months agoAndroid: don't move actions programmatically. Use declarative approach.
Andrei Kuznetsov [Fri, 10 Jul 2020 18:08:58 +0000 (21:08 +0300)]
Android: don't move actions programmatically. Use declarative approach.

This will help IDE to initialize components (e.g. actions) lazily => improve startup time.

GitOrigin-RevId: 5dbc9283ca68fe57f8396285c68a41c7c31fde5b

3 months agoIDEA-245623: restore missing Android action group (AndroidToolsGroup)
Andrei Kuznetsov [Fri, 10 Jul 2020 17:39:54 +0000 (20:39 +0300)]
IDEA-245623: restore missing Android action group (AndroidToolsGroup)

LintBundle accidentally overrides AndroidBundle. Android's plugin.xml includes android-plugin.xml and lint-plugin.xml. Both declare `<resource-bundle>`, but inclusion of lint-plugin.xml appears later in the text, so LintBundle wins, and warning is displayed in IDEA logs. As a result, some messages were not found, action groups didn't have titles. Action groups with no title didn't appear in UI therefore AVD Manager action completely disappears from IDEA.

GitOrigin-RevId: 75ec2f9428580121e9f7cb5930631098a1f847b9

3 months agoIDEA-245510: Android: default values are not valid in New Project/Module wizard ...
Andrei Kuznetsov [Thu, 9 Jul 2020 10:40:22 +0000 (13:40 +0300)]
IDEA-245510: Android: default values are not valid in New Project/Module wizard (Chinese Simplified)

Don't translate module names into Chinese. The result is that package (application ID) contains non-ascii characters, which do not pass validation.

GitOrigin-RevId: 10ed0323a7322040b00e0eff2051ef7be3c5d062

3 months agoPsiModificationTrackerImpl.incCounter: require write access for IDEA-245099, deprecat...
Peter Gromov [Tue, 7 Jul 2020 09:48:53 +0000 (11:48 +0200)]
PsiModificationTrackerImpl.incCounter: require write access for IDEA-245099, deprecate, migrate usages to dropPsiCaches

GitOrigin-RevId: 4c300f05fd3b314fefa48f8244a74f28398c7dec

3 months ago[project model] mark Module::getModuleFile and related methods as internal and get...
Nikolay Chashnikov [Tue, 7 Jul 2020 09:02:26 +0000 (12:02 +0300)]
[project model] mark Module::getModuleFile and related methods as internal and get rid of some of their usages

This also introduces ModuleUtil.suggestBaseDirectory method which may be used instead of Module::getModuleFile in many cases.

GitOrigin-RevId: f5cbedece34ca7185383a24905385fc13ba809b0

3 months agoIDEA-170707: Android: lint running on java file in JAR module does not properly recog...
Andrei Kuznetsov [Mon, 6 Jul 2020 21:10:22 +0000 (00:10 +0300)]
IDEA-170707: Android: lint running on java file in JAR module does not properly recognize desugaring option of the main project

Which results in false positive on Java API (e.g. streams) when `coreLibraryDesugaringEnabled=true`

GitOrigin-RevId: be72d914e648b8b72a364e9b88d3756f2e98e208

3 months agoFix Android Plugin description
Andrei Kuznetsov [Mon, 6 Jul 2020 21:05:06 +0000 (00:05 +0300)]
Fix Android Plugin description

Which appears in plugin manager as "IDE support for running Android Lint..." (from lint-plugin.xml) instead of "Supports the development of Android applications..." (from plugin.xml), because plugin.xml includes lint-plugin.xml which has <description> tag.

GitOrigin-RevId: 4ca6452e40007f121e1305f5f04e520da723b9ec

3 months agoIDEA-245273: Remove hard-coded product name from Android Gradle proxy settings dialog
Andrei Kuznetsov [Mon, 6 Jul 2020 18:20:16 +0000 (21:20 +0300)]
IDEA-245273: Remove hard-coded product name from Android Gradle proxy settings dialog

GitOrigin-RevId: 6f8b900a6154c134cff4f02b5ec1f199af13dd66

3 months agoAndroid: Perf: don't iterate all modules to find a module with android facet
Andrei Kuznetsov [Fri, 3 Jul 2020 19:53:27 +0000 (22:53 +0300)]
Android: Perf: don't iterate all modules to find a module with android facet

GitOrigin-RevId: 12ad4589b39f76d7526198fc926b62ff4e3763f8

3 months agoIDEA-242843: Android XML code style should not be applied to non-android projects
Andrei Kuznetsov [Thu, 2 Jul 2020 22:23:30 +0000 (01:23 +0300)]
IDEA-242843: Android XML code style should not be applied to non-android projects

Originally Android XML formatter (AndroidXmlFormattingModelBuilder) was checking the presence of AndroidFacet. Due to some race conditions between the formatting of generated files and gradle-import (Bug: http://b/37631553) this check was removed on 18.05.2017 (Change-Id: Id7730f17567b2e3749933ef9db4040fe9c6a244d). Currently IDEA 2020.2 neither 2020.3 do not show any race conditions: AndroidFacet is timely added, formatting works as expected, and gradle build file does not show any popup suggesting to re-sync the project.

This commit restores check for presence of AndroidFacet in AndroidXmlFormattingModelBuilder.

GitOrigin-RevId: e7d68f404cd1543c8b96acaaa9cf6b86d0c68b6d

3 months agoIDEA-223524 BatchUpdateListener - only for project- and module- level components
Vladimir Krivosheev [Mon, 6 Jul 2020 13:03:33 +0000 (15:03 +0200)]
IDEA-223524 BatchUpdateListener - only for project- and module- level components

GitOrigin-RevId: 780def210128417892c842ff971a7acd808fb490

3 months agoIDEA-239645 i18n for Android DeviceFileExplorerConfigurable
Dmitry.Krasilschikov [Wed, 1 Jul 2020 16:23:50 +0000 (19:23 +0300)]
IDEA-239645 i18n for Android DeviceFileExplorerConfigurable

GitOrigin-RevId: 0e964529f8dc155f6a22ecccaf767c4fe4981496

3 months agocleanup - use AppExecutorUtil.getAppExecutorService() directly
Vladimir Krivosheev [Sat, 4 Jul 2020 15:34:33 +0000 (17:34 +0200)]
cleanup - use AppExecutorUtil.getAppExecutorService() directly

GitOrigin-RevId: f327995c44a5fed451c9f1dfde971a3eabfaa481

3 months agoIDEA-223524 don't preload project converters, create only if needed, remove outdated...
Vladimir Krivosheev [Sat, 4 Jul 2020 12:03:27 +0000 (14:03 +0200)]
IDEA-223524 don't preload project converters, create only if needed, remove outdated converters (8 years is enough to convert old projects)

GitOrigin-RevId: 3d133efd059574d4b27ee68b9b2bec6d08a456fc

3 months agoIDEA-223524 read project file content only if needed on conversion check, remove...
Vladimir Krivosheev [Thu, 2 Jul 2020 17:27:13 +0000 (19:27 +0200)]
IDEA-223524 read project file content only if needed on conversion check, remove AndroidProguardOptionsConverterProvider — 7 years is enough time to convert old projects

GitOrigin-RevId: ed28e66716ed5c89ed0d5fe965e6f59ec7a4d64f

3 months agostate storage manager macro value as path instead of string
Vladimir Krivosheev [Wed, 1 Jul 2020 12:37:56 +0000 (14:37 +0200)]
state storage manager macro value as path instead of string

GitOrigin-RevId: 6ab1192ec2cc53ff8db64e9fd1b9001a0141c39a

3 months agopass toolWindowManager to toolWindowsRegistered
Vladimir Krivosheev [Mon, 29 Jun 2020 13:46:20 +0000 (15:46 +0200)]
pass toolWindowManager to toolWindowsRegistered

GitOrigin-RevId: bd58d53655be253dfc87b79fcc2fae64a599eea4

3 months agoUsefulTestCase: Replace invokeTestRunnable() with runTestRunnable()
Eldar Abusalimov [Thu, 2 Jul 2020 02:37:29 +0000 (05:37 +0300)]
UsefulTestCase: Replace invokeTestRunnable() with runTestRunnable()

GitOrigin-RevId: 0900f73aa838cbf3c4b5c577cab97285ea4cea3c

3 months agoUsefulTestCase: Make invokeTestRunnable() take ThrowableRunnable
Eldar Abusalimov [Thu, 2 Jul 2020 02:00:03 +0000 (05:00 +0300)]
UsefulTestCase: Make invokeTestRunnable() take ThrowableRunnable

GitOrigin-RevId: f929b8cc7d7b10e60f627c67731ea9c627f0bbb4

3 months agoRemove @Before/@After annotations from JUnit3 setUp()/tearDown()
Eldar Abusalimov [Wed, 1 Jul 2020 14:24:23 +0000 (17:24 +0300)]
Remove @Before/@After annotations from JUnit3 setUp()/tearDown()

Also rename genuine JUnit4 setUp()/tearDown() annotated with
@Before/@After to before()/after() to avoid confusion.

GitOrigin-RevId: fb1b058a19e3bef910554c60b80211d48e33b8c1

3 months agoHeavyPlatformTestCase: Reuse our JUnit4 getRunBareTestRule()
Eldar Abusalimov [Wed, 1 Jul 2020 13:05:33 +0000 (16:05 +0300)]
HeavyPlatformTestCase: Reuse our JUnit4 getRunBareTestRule()

All its inheritors are now JUnit4-compatible.

GitOrigin-RevId: 8327de3af57b0cd63804326e45e54e5a69ec94e4

3 months agoEdtTestUtil: Properly declare exception thrown by runInEdtXxx() methods
Eldar Abusalimov [Tue, 30 Jun 2020 01:39:41 +0000 (04:39 +0300)]
EdtTestUtil: Properly declare exception thrown by runInEdtXxx() methods

GitOrigin-RevId: e0cd075cbc80ffbb1456ac480ce35d4113dc711f

3 months agoEdtTestUtil: Replace usages of ThrowableRunnable with { ... } lambdas
Eldar Abusalimov [Mon, 29 Jun 2020 19:49:32 +0000 (22:49 +0300)]
EdtTestUtil: Replace usages of ThrowableRunnable with { ... } lambdas

GitOrigin-RevId: 7fefb1c0302b3eec8e9396b3000fe2d21fa03cd8

3 months agoPlatformTestUtil: Make dispatchAllEventsInIdeEventQueue() throw unchecked
Eldar Abusalimov [Mon, 29 Jun 2020 16:28:09 +0000 (19:28 +0300)]
PlatformTestUtil: Make dispatchAllEventsInIdeEventQueue() throw unchecked

GitOrigin-RevId: 91d3845da156926be8255c9bf139ecf91dfb2165

3 months agoIDEA-243103: Android: Fix "Cannot create Project ... because container is already...
Andrei Kuznetsov [Tue, 30 Jun 2020 21:01:16 +0000 (00:01 +0300)]
IDEA-243103: Android: Fix "Cannot create Project ... because container is already disposed" at .AndroidProjectViewPane

Project might have been disposed while the task was waiting for execution

Allow `isProcessingChanges.set(false)` to execute (which might accidentally fire in light tests where the project is shared, and can "undispose" between tests)

GitOrigin-RevId: c3ea8280c53f286f90587d48c1b91922739b7e29