idea/android.git
45 min agoAndroid: fix getComponent->getService (BindingClassFinder) master
Andrei Kuznetsov [Thu, 28 May 2020 14:17:49 +0000 (17:17 +0300)]
Android: fix getComponent->getService (BindingClassFinder)

GitOrigin-RevId: 87929651962eff2e99cb33d309f4fc57336e4452

45 min agoAndroid: minor code cleanup (diamonds, formatting, copyright, etc)
Andrei Kuznetsov [Thu, 28 May 2020 13:28:42 +0000 (16:28 +0300)]
Android: minor code cleanup (diamonds, formatting, copyright, etc)

GitOrigin-RevId: d7ed286b0abe4e29c117fa1f138dc377156416e2

45 min agoIDEA-241625: [Perf] Android: do not iterate all the AndroidFacets, iterate binding...
Andrei Kuznetsov [Tue, 26 May 2020 23:19:40 +0000 (02:19 +0300)]
IDEA-241625: [Perf] Android: do not iterate all the AndroidFacets, iterate binding-enabled AndroidFacets only

GitOrigin-RevId: 712b902fe3877b0eb525fb0403baa293d06297c3

45 min agoIDEA-240365: Bump android-tools-base libs to version JB/26.6.0.3 (AOSP/26.6.0-final)
Andrei Kuznetsov [Tue, 19 May 2020 21:52:54 +0000 (00:52 +0300)]
IDEA-240365: Bump android-tools-base libs to version JB/26.6.0.3 (AOSP/26.6.0-final)

Some artifacts from JB/26.6.0.2 still correspond to AOSP/26.6.0-rc01 (by mistake)

GitOrigin-RevId: 427647187d2005fb835f29a2f03499249e979b78

16 hours agodo not directly use IdIndex by clients
Dmitry Batkovich [Fri, 29 May 2020 05:25:25 +0000 (08:25 +0300)]
do not directly use IdIndex by clients

GitOrigin-RevId: 4a056dbd91c049d5ba82f5ed49a6de9d8eda4ce0

26 hours ago[android tests] don't add several project-level libraries with the same name
Nikolay Chashnikov [Thu, 28 May 2020 20:04:04 +0000 (23:04 +0300)]
[android tests] don't add several project-level libraries with the same name

Such configuration aren't supported properly in the old project model and lead to exceptions in the new project model implementation.

GitOrigin-RevId: f378d54bbf59d40f89f41f524b6b817769112a4d

35 hours agocleanup: replace implementations of deprecated method LibraryTable.Listener::afterLib...
Nikolay Chashnikov [Thu, 28 May 2020 10:36:35 +0000 (13:36 +0300)]
cleanup: replace implementations of deprecated method LibraryTable.Listener::afterLibraryRenamed

GitOrigin-RevId: b8cf45e8702cade65d8968a2f9b8c4d644e2c430

37 hours agoTest data fix after correct template formatting
Rustam Vishnyakov [Thu, 28 May 2020 09:13:36 +0000 (12:13 +0300)]
Test data fix after correct template formatting

GitOrigin-RevId: 8df06751520b9523c49716f9bff92e8a5e26ffdb

42 hours agoStdFileTypes replaced where possible
Tagir Valeev [Thu, 28 May 2020 04:07:24 +0000 (11:07 +0700)]
StdFileTypes replaced where possible

GitOrigin-RevId: 0f3f69aac045905c2bf18dfcdccd5db693f2c802

2 days agotoo many toArrays spoil the broth
Alexey Kudravtsev [Sun, 24 May 2020 22:45:35 +0000 (01:45 +0300)]
too many toArrays spoil the broth

GitOrigin-RevId: 075bd1fd85768cf39c4bed711f99e4a7acbc316d

3 days ago[platform] split KeyboardLayoutUtil in two parts: awt/non-awt
Alexander Zolotov [Tue, 26 May 2020 17:15:23 +0000 (20:15 +0300)]
[platform] split KeyboardLayoutUtil in two parts: awt/non-awt

moved non-awt part to util module and reverted nasty changes with passing char-conversion function to matchers

GitOrigin-RevId: 95ecac61932ee7ca5bf29295c899b835367fa7d8

3 days ago[all] cleanup: replace ExtensionPointName::getPoint(null) calls by getPoint()
Nikolay Chashnikov [Tue, 26 May 2020 18:18:59 +0000 (21:18 +0300)]
[all] cleanup: replace ExtensionPointName::getPoint(null) calls by getPoint()

...to simplify code and get rid of usages of deprecated method.

GitOrigin-RevId: 9a287f20b0c23ba612d516ef45191ab9593a1cc6

6 days ago[platform] extract util modules to share with non-intellij non-awt projects
Alexander Zolotov [Tue, 19 May 2020 12:02:49 +0000 (15:02 +0300)]
[platform] extract util modules to share with non-intellij non-awt projects

- move part. see the next commit for more changes

GitOrigin-RevId: 6a271db083b19f201a73c8a43ac8733664d602eb

7 days agoIDEA-241443 added sdk lookup for project/module sdks that suggested for gradle projects
Sergei Vorobyov [Fri, 22 May 2020 17:29:45 +0000 (20:29 +0300)]
IDEA-241443 added sdk lookup for project/module sdks that suggested for gradle projects

GitOrigin-RevId: 1369e7190d9617aa1a5afbdb160570114961195c

8 days agoget rid of ObjectLinkedOpenHashSet, LinkedMultiMap and MultiMap.createSmart — not...
Vladimir Krivosheev [Tue, 19 May 2020 09:07:12 +0000 (11:07 +0200)]
get rid of ObjectLinkedOpenHashSet, LinkedMultiMap and MultiMap.createSmart — not needed anymore since fastutil supports nullable keys

Using fastutil for non type specific maps doesn't bring benefits and even can make performance worse.

 * Memory usage becomes performance issue only for map size >= 10M https://collection-libs-comparison.develar.org/?tab=linkedMap  For 100K diff 1MB, for 1M diff 20MB, for 10M diff 200MB
 * Entry set is iterated very often, so, in any case often entry set will be created. Fast iterator concept can help to overcome it, but every client should use it then. Also, benefits are not clear because JVM is highly optimized nowadays (see https://github.com/vigna/fastutil/pull/155#issuecomment-631507850)
 * `replaceAll`, `computeIfAbsent` and other such methods are not implemented in an efficient manner in fastutil for Object2Object, only for type-specific maps. Such methods are not only syntax sugar and in most cases client is expected or wanted to use it.

 So, MultiMap doesn't use fastutil collections by default, only if custom hash strategy is needed. Nothing changed — `HashMap` is continued to be used by default.

What's changed:

 * `BidirectionalMultiMap` and `BidirectionalMultiMap` uses `HashMap` instead of `THashMap` by default. Custom map may be passed via constructor, if custom hash strategy is needed or reduced memory usage is important. As stated above, memory usage difference is significant only for >= 10M entries.
 * `MultiMap` under the hood uses `computeIfAbsent` to create and add collection if not yet added, that's why special implementation for concurrent multi-map is not  required anymore. It also small performance improvement as `computeIfAbsent` implemented in `HashMap` in an efficient way.
 * Method `freezeValues` added to MultiMap. Used only in two places for now, but maybe later will be found another places to migrate (not done as this commit to reduce scope of changes).
 * All custom implementations of MultiMap marked as deprecated because only MultiMap should be used and special implementations created via factory methods. Not everything is migrated and marked to reduce scope of changes.

GitOrigin-RevId: 21f7adbae7283a12a2875be3c9a46cac5ac82934

8 days agoIDEA-240572 ExternalDocumentationProvider needs a variant that lets the implementatio...
Dmitry Batrak [Thu, 21 May 2020 10:23:47 +0000 (13:23 +0300)]
IDEA-240572 ExternalDocumentationProvider needs a variant that lets the implementation know it has been invoked for onHover

GitOrigin-RevId: bf17dc9be2e893e4e9a2d6232e63b3a7c678bcff

8 days agomove index storage implementations to separate package
Dmitry Batkovich [Thu, 21 May 2020 07:56:51 +0000 (10:56 +0300)]
move index storage implementations to separate package

GitOrigin-RevId: 2f3ee6240e4a0eb5836fce73fb833aa074feeb5a

10 days agoRevert "maven - android plugin extension made dynamic"
Alexander Bubenchikov [Tue, 19 May 2020 14:20:19 +0000 (17:20 +0300)]
Revert "maven - android plugin extension made dynamic"

This reverts commit d8748248

GitOrigin-RevId: 0b153e0a5a8c5324abc32a7d6390719398403efc

10 days agomaven - android plugin extension made dynamic
Alexander Bubenchikov [Tue, 19 May 2020 08:53:51 +0000 (11:53 +0300)]
maven - android plugin extension made dynamic

GitOrigin-RevId: d87482481fb5bf8fd691a8de880da816e6428b61

10 days ago[IntelliJ project configuration tests] explicitly set language level to 1.8 for modul...
Nikolay Chashnikov [Mon, 18 May 2020 20:42:15 +0000 (23:42 +0300)]
[IntelliJ project configuration tests] explicitly set language level to 1.8 for modules which are used from external processes

This is needed to ensure that these modules will be still compatible with Java 8 when we raise default language level to 11 (IDEA-241075).

GitOrigin-RevId: 56c671ae077393204d040780fb2badd2d17774a0

10 days agoTextRange.substring used
Tagir Valeev [Tue, 19 May 2020 04:52:05 +0000 (11:52 +0700)]
TextRange.substring used

GitOrigin-RevId: ff233e4da7cc3a532c7d7c6c9073a54ebfd700e5

11 days ago[Perf] Android transforms to dynamic plugin: get rid of non-dynamic referenceProvider...
Andrei Kuznetsov [Mon, 18 May 2020 16:53:59 +0000 (19:53 +0300)]
[Perf] Android transforms to dynamic plugin: get rid of non-dynamic referenceProvider (replace with referenceContributor)

GitOrigin-RevId: 3095f60dd5678cf6e3da04d7cacd2a11ed2f6f8e

11 days ago[Perf] Android transforms to dynamic plugin: delete app-component AndroidSdkUpdaterPlugin
Andrei Kuznetsov [Mon, 18 May 2020 11:01:50 +0000 (14:01 +0300)]
[Perf] Android transforms to dynamic plugin: delete app-component AndroidSdkUpdaterPlugin

Authentication moved to StudioSettingsController. StudioSettingsController is initialized by StudioDownloader when needed.

GitOrigin-RevId: ebf8cbd5e0dcd875f2cca717aae09ea57370d157

11 days ago[Perf] Android transforms to dynamic plugin: convert ExternalComponentSource into...
Andrei Kuznetsov [Mon, 18 May 2020 10:20:43 +0000 (13:20 +0300)]
[Perf] Android transforms to dynamic plugin: convert ExternalComponentSource into extension point

GitOrigin-RevId: 63631ca33cdc504ed2c58521cacd7b688b7d93b2

11 days agoRemove offline repo remainders from Update Sites.
Andrii Dehtiarov [Tue, 3 Dec 2019 14:50:13 +0000 (14:50 +0000)]
Remove offline repo remainders from Update Sites.

We removed support repository from SDK manager with
ag/7088748, as Google Maven is the only source of truth now.
However, that CL did not remove it from the update sites
- this CL follows up on that.

Test: N/A
Bug: 145351869
Change-Id: Ieb70d642506c7d57d453079b77c2b8f7e1f90fa3

GitOrigin-RevId: 09f7f33e0374be8a21594fe7447a031b4e9164d3
(cherry picked from commit 0deb7a6e8cff368d35a61a240351a7d00dd549ee)

11 days ago[Perf] Android transforms to dynamic plugin: convert designer/NlXmlEditors into service
Andrei Kuznetsov [Fri, 15 May 2020 20:10:27 +0000 (23:10 +0300)]
[Perf] Android transforms to dynamic plugin: convert designer/NlXmlEditors into service

GitOrigin-RevId: e7497b15252ece92046de690eb1f3fb2388f5a6d

11 days ago[Perf] Android transforms to dynamic plugin: convert designer/NlPropertyEditors into...
Andrei Kuznetsov [Fri, 15 May 2020 20:04:00 +0000 (23:04 +0300)]
[Perf] Android transforms to dynamic plugin: convert designer/NlPropertyEditors into service

GitOrigin-RevId: cdf2edaaaf755630e0a175f77a07e5dd0dbbb44f

11 days agoanother fix for android - avoid trove dependency (compilation is ok but highlighting...
Vladimir Krivosheev [Mon, 18 May 2020 15:55:38 +0000 (17:55 +0200)]
another fix for android - avoid trove dependency (compilation is ok but highlighting failed)

Part of this commit from uncommited changes, that's why number of introduced mehtods not used yet

GitOrigin-RevId: b72a85171e5115c4c72ca09888f6d5a9b1ba0781

11 days agoandroid.transport - fix unresolved trove usage (migrate to fastutil)
Vladimir Krivosheev [Mon, 18 May 2020 08:28:09 +0000 (10:28 +0200)]
android.transport - fix unresolved trove usage (migrate to fastutil)

GitOrigin-RevId: 68cc2f51548afb56809f22cc7ecbff5e924e791d

11 days agofix highlighting error (ResourceValueMap -> ResourceNameKeyedMap -> THashMap)
Vladimir Krivosheev [Mon, 18 May 2020 05:30:31 +0000 (07:30 +0200)]
fix highlighting error (ResourceValueMap -> ResourceNameKeyedMap -> THashMap)

GitOrigin-RevId: bf2d9149706ea5bc661de0534e7883555f779b24

11 days agouse fastutil instead of deprecated trove-based ObjectIntHashMap
Vladimir Krivosheev [Mon, 18 May 2020 05:25:50 +0000 (07:25 +0200)]
use fastutil instead of deprecated trove-based ObjectIntHashMap

fastutil has concept of default values — patch not required anymore

GitOrigin-RevId: 3972d9ffffaf7e4b7c01f8d5ec5b2e6b0ad1417f

12 days agofix red code
Vladimir Krivosheev [Sun, 17 May 2020 07:29:21 +0000 (09:29 +0200)]
fix red code

GitOrigin-RevId: 19dd051b05268a69e5bccce2e779af0604cde85e

13 days agomark "newDisposable" pure to avoid using it as a statement and mark debugName notnull...
Alexey Kudravtsev [Sat, 16 May 2020 20:50:14 +0000 (23:50 +0300)]
mark "newDisposable" pure to avoid using it as a statement and mark debugName notnull because nullable has no sense

GitOrigin-RevId: c4a8798ee70126657934853e781691b286fefbf7

13 days agodo not export trove from util module
Vladimir Krivosheev [Sat, 16 May 2020 14:28:02 +0000 (16:28 +0200)]
do not export trove from util module

GitOrigin-RevId: 666bf5e1fc45045bb9b1c391b7ec5a2ac4b65dde

13 days agocleanup
Vladimir Krivosheev [Thu, 14 May 2020 11:08:45 +0000 (13:08 +0200)]
cleanup

GitOrigin-RevId: 8edcbb87c482c4d73925aa9f3f9211368b29b2d2

2 weeks agoAndroid: fix reference layout data for Java 11
Andrei Kuznetsov [Fri, 15 May 2020 11:51:01 +0000 (14:51 +0300)]
Android: fix reference layout data for Java 11

In Java8 and Java11 `measureText()` returns different results (different width) for the same text/ Adjust test for Java11

GitOrigin-RevId: 4a37205b916bb853a8e2eca60943cc8c3a817e8d

2 weeks agoAndroid: fix projects leaking in tests through Mockito internals
Andrei Kuznetsov [Thu, 14 May 2020 22:40:31 +0000 (01:40 +0300)]
Android: fix projects leaking in tests through Mockito internals

GitOrigin-RevId: 4961d0737c798526fcab030f5aec265830d1ea7f

2 weeks agoAndroid: fix & enable most of the com.android.tools.idea.uibuilder.* tests in IDEA
Andrei Kuznetsov [Thu, 14 May 2020 17:56:52 +0000 (20:56 +0300)]
Android: fix & enable most of the com.android.tools.idea.uibuilder.* tests in IDEA

GitOrigin-RevId: 6534d87fe53f97e378333e87da497000207eb81f

2 weeks agoCleanup (pointless extension)
Roman Shevchenko [Thu, 14 May 2020 20:10:43 +0000 (22:10 +0200)]
Cleanup (pointless extension)

GitOrigin-RevId: 77155bb45b37b31b8ea21f08a442762063905caa

2 weeks agoAndroid: introduce SwitchingMockMaker, which prefers fast ByteBuddyMockMaker for...
Andrei Kuznetsov [Thu, 14 May 2020 15:57:59 +0000 (18:57 +0300)]
Android: introduce SwitchingMockMaker, which prefers fast ByteBuddyMockMaker for mocking

... and falls back to InlineByteBuddyMockMaker if ByteBuddyMockMaker reports that it cannot mock the type. This significantly reduces usages of slow inline mocks in test.

Due to difference in Inline/NonInline versions, WorkBenchTestCase now needs MockitoThreadLocalsCleaner to clean projects leaking via mockito "answers". WorkBenchTestCase belongs to adt-ui, which may not depend on android.testFramework. Make a copy of MockitoThreadLocalsCleaner for now. Dependency between adt-ui and testFramework should probably be inverted (i.e. adt-ui should depend on testFramework, not the opposite)

GitOrigin-RevId: efa2f55fb7077d238e33433c7ac2cac3c52a2b79

2 weeks ago[Perf] Android transforms to dynamic plugin: convert designer/NlPreviewManager into...
Andrei Kuznetsov [Wed, 13 May 2020 16:06:24 +0000 (19:06 +0300)]
[Perf] Android transforms to dynamic plugin: convert designer/NlPreviewManager into service

GitOrigin-RevId: d5aa444feb4995b968a4b65189a713f7cca82004

2 weeks ago[Perf] Android transforms to dynamic plugin: convert designer/VisualizationManager...
Andrei Kuznetsov [Wed, 13 May 2020 14:30:42 +0000 (17:30 +0300)]
[Perf] Android transforms to dynamic plugin: convert designer/VisualizationManager into service

GitOrigin-RevId: 362b2fd39362ef75e2ceff8a5479a651f2bcc9c1

2 weeks agoAndroid: remove duplicate plugin.xml and add ij.android.sdkUpdates.tests to ultimate...
Andrei Kuznetsov [Tue, 12 May 2020 21:36:28 +0000 (00:36 +0300)]
Android: remove duplicate plugin.xml and add ij.android.sdkUpdates.tests to ultimate.tests.android

GitOrigin-RevId: 9761f26b13d22b8a82fa4637825691d39da0c5ee

2 weeks agoregen parsers
Gregory.Shrago [Fri, 8 May 2020 19:50:25 +0000 (22:50 +0300)]
regen parsers

GitOrigin-RevId: d700d17b9077c085c9c4e2865a217fd11e29e5ea

2 weeks agoJdkOrderEntry - add @Nullable annotations to getJdk() and getJdkName() methods, updat...
Eugene Petrenko [Wed, 13 May 2020 09:54:36 +0000 (11:54 +0200)]
JdkOrderEntry - add @Nullable annotations to getJdk() and getJdkName() methods, update usages

GitOrigin-RevId: a6c0a0bc7064ed17457ffe414b86042d325fcaae

2 weeks ago[codeInsight] Cleanup redundant toString calls
Nikita Eshkeev [Tue, 12 May 2020 21:16:29 +0000 (00:16 +0300)]
[codeInsight] Cleanup redundant toString calls

Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>
GitOrigin-RevId: 89f6755422c441c8f6701bf8294c4c52bbb097dc

2 weeks agoAndroid: improve Render tests performance (Thread#join timeout)
Andrei Kuznetsov [Tue, 12 May 2020 20:02:04 +0000 (23:02 +0300)]
Android: improve Render tests performance (Thread#join timeout)

Don't join threads belonging to `ThreadPoolExecutor`. Threads may remain IDLE for some time after the last submitted task completed. `Thread#join` will block test execution for much longer than needed to drain the task queue.

GitOrigin-RevId: 52313616e9bd41c35d76fc64da4f591342253219

2 weeks ago[Perf] Android transforms to dynamic plugin: convert component into service / designer
Andrei Kuznetsov [Tue, 12 May 2020 19:51:21 +0000 (22:51 +0300)]
[Perf] Android transforms to dynamic plugin: convert component into service / designer

GitOrigin-RevId: 30baf31ed9618e7d3ad1ccd36ca2369746ffe5aa

2 weeks agoDumbModeTask - replace deprecated usages
Eugene Petrenko [Tue, 12 May 2020 17:13:46 +0000 (19:13 +0200)]
DumbModeTask - replace deprecated usages

GitOrigin-RevId: 9071e5f2e3f5fe5e4d4e1131633045220b9d65d8

2 weeks ago[Perf] Android transforms to dynamic plugin: convert component into service / android...
Andrei Kuznetsov [Tue, 12 May 2020 14:43:39 +0000 (17:43 +0300)]
[Perf] Android transforms to dynamic plugin: convert component into service / android-database-support

GitOrigin-RevId: 9e69d921269e6d2a2c677e93c6145cecebf0ea55

2 weeks ago[Perf] Android transforms to dynamic plugin: convert component into service / naveditor
Andrei Kuznetsov [Tue, 12 May 2020 11:58:40 +0000 (14:58 +0300)]
[Perf] Android transforms to dynamic plugin: convert component into service / naveditor

GitOrigin-RevId: 370a590148357a160c694a1ef847eb1c54a2014b

2 weeks agoIDEA-240331: Android: AE: Please don't register startup activities for the default...
Andrei Kuznetsov [Tue, 12 May 2020 09:45:21 +0000 (12:45 +0300)]
IDEA-240331: Android: AE: Please don't register startup activities for the default project: they won't ever be run

GitOrigin-RevId: 976f8154c934552b3aa10e529bf0fc5ba4a5bd52

2 weeks agoAndroid: don't iterate all the project modules to find android facets (performance)
Andrei Kuznetsov [Tue, 12 May 2020 09:42:05 +0000 (12:42 +0300)]
Android: don't iterate all the project modules to find android facets (performance)

GitOrigin-RevId: 52b98ba3a5701b6d29a56be91f3ce507f205dd82

2 weeks agoAndroid: fix test com.android.tools.idea.naveditor.structure.DestinationListTest...
Andrei Kuznetsov [Fri, 8 May 2020 21:26:02 +0000 (00:26 +0300)]
Android: fix test com.android.tools.idea.naveditor.structure.DestinationListTest.testRightClickActivity

It is not valid to expect that `NavActionManager#getPopupMenuActions` will be called on the mocked object, because this method is only called from `NavActionManager#showPopup` (i.e. the mock should call the method itself). Test was working only because the mock was partial (because `showPopup` is final method). With InlineByteBuddy mock creator the mock is not partial anymore, and the test fails.

GitOrigin-RevId: d99cf0fa225e5397e512c157fa95746532c0aac8

2 weeks agoAndroid: ignore tests failing due to the missing input data
Andrei Kuznetsov [Fri, 8 May 2020 16:32:48 +0000 (19:32 +0300)]
Android: ignore tests failing due to the missing input data

GitOrigin-RevId: 9c50759112391dea9161bd5fc8191df194c99013

2 weeks agoAndroid: fix `NavPropertiesPanelTest.testRefresh`: allow `MergingUpdateQueue` to...
Andrei Kuznetsov [Fri, 8 May 2020 16:23:47 +0000 (19:23 +0300)]
Android: fix `NavPropertiesPanelTest.testRefresh`: allow `MergingUpdateQueue` to pump events before checking results

GitOrigin-RevId: 419046962f38a5ee611bd6f74adad87d69881bb1

2 weeks agoAndroid: adjust mouse events simulation in tests to work with Java11
Andrei Kuznetsov [Fri, 8 May 2020 15:07:49 +0000 (18:07 +0300)]
Android: adjust mouse events simulation in tests to work with Java11

Android: adjust mouse events simulation in tests to work with Java11

GitOrigin-RevId: a3659538e8a89c7e3d42ed10fc1e2d2c93fa565e

2 weeks agoAndroid: add explicit mock behavior for Mockito's `thenCallRealMethod` in tests
Andrei Kuznetsov [Fri, 8 May 2020 00:22:28 +0000 (03:22 +0300)]
Android: add explicit mock behavior for Mockito's `thenCallRealMethod` in tests

There is a difference in Mockito behavior when `intellij.android.core.tests` module presents in classpath. `intellij.android.core.tests` provides mockito-extension `org.mockito.plugins.MockMaker` with value `mock-maker-inline`. ByteBuddy[Inline/NonInline] mock makers show different behavior of `thenCallRealMethod`: NonInline maker makes the mock's method + all the methods it invoked as "CallRealMethod". Inline version only makes mocked method to pass the invocation to the real method. All the other methods returns default values (e.g. null). For example, consider the statement ``when`(component.getActionForKeyStroke(...).thenCallRealMethod()`. In NonInline version two methods `getActionForKeyStroke` and `getInputMap` will be mocked as "CallRealMethod" (because `getActionForKeyStroke` internally invokes `getInputMap`). In the Inline version `getActionForKeyStroke` will be mocked as "CallRealMethod", `getInputMap` will return default value (null).

Another difference is that Inline variant can mock final methods (=> if they are not mocked, they return default values, e.g. null). NonInline cannot mock final methods, and they always behave as "CallRealMethod".

This commit makes test setup more robust by explicitly defining mock behavior in such a cases.

GitOrigin-RevId: 107ee28cdcd50933fe9932e0d73d2034465fef93

2 weeks agoAndroid: Fix leaking MergingUpdateQueue in NlModel; fix & enable most of naveditor...
Andrei Kuznetsov [Thu, 7 May 2020 17:21:21 +0000 (20:21 +0300)]
Android: Fix leaking MergingUpdateQueue in NlModel; fix & enable most of naveditor tests

Also (temporarily) exclude tests from `com.android.tools.idea.uibuilder.*` which haven't run prior to this commit, because corresponding classes were missing in test class path.

GitOrigin-RevId: c641396509340db3a23bd4df14521b82a0030f14

2 weeks agoAndroid: `dispose()` should not instantiate lazy objects
Andrei Kuznetsov [Thu, 7 May 2020 17:19:14 +0000 (20:19 +0300)]
Android: `dispose()` should not instantiate lazy objects

Direct invocation of `getLayers().foreach(::dispose)` or `setToolContext(null)` during dispose results in lazy objects (which has not ben created yet: layers and PropertiesManager.getPropertiesPanel) to be created only for the purpose to dispose them (or set null into some field).

GitOrigin-RevId: 8f6b8ac09cdbbac54aa31698986d7eb4de92369e

2 weeks agoAndroid: fix component->service registration
Andrei Kuznetsov [Thu, 7 May 2020 17:12:04 +0000 (20:12 +0300)]
Android: fix component->service registration

GitOrigin-RevId: dae1193152df3fa08c8462c65c55d47671742682

2 weeks agoAndroid: log suppressed exceptions properly during tests shutdown
Andrei Kuznetsov [Thu, 7 May 2020 17:03:28 +0000 (20:03 +0300)]
Android: log suppressed exceptions properly during tests shutdown

GitOrigin-RevId: 399c5a7e660992ac4ba21277de8b082a5b19fc1e

2 weeks agoprefer fastutil IntArrayList
Vladimir Krivosheev [Sat, 9 May 2020 08:49:26 +0000 (10:49 +0200)]
prefer fastutil IntArrayList

GitOrigin-RevId: f57a2f34a522a21fac3dbe5e10ccdbe3ef9c702a

3 weeks agocleanup
Vladimir Krivosheev [Thu, 7 May 2020 17:30:53 +0000 (19:30 +0200)]
cleanup

GitOrigin-RevId: aec9ee6faddcbe70b86643cf126d5981ff295a7f

3 weeks agoAndroid: fix reference data for AndroidGradleProjectViewSnapshotComparisonTest.testSi...
Andrei Kuznetsov [Thu, 7 May 2020 14:43:37 +0000 (17:43 +0300)]
Android: fix reference data for AndroidGradleProjectViewSnapshotComparisonTest.testSimpleApplication (icon with tooltip)

GitOrigin-RevId: c0efc3b119e1420c7a07f621e58e4ac74c232165

3 weeks agoAndroid: delete duplicate plugin.xml in test sources, and use real plugin.xml for...
Andrei Kuznetsov [Thu, 7 May 2020 10:50:57 +0000 (13:50 +0300)]
Android: delete duplicate plugin.xml in test sources, and use real plugin.xml for android plugin

+ fix easy-to-fix test failures in new tests (new classes in runtime test classpath).
+ add excludes to testGroups.properties (tests that have never been executed in TeamCity because they never appeared on test classpath)

`ij.android.testFramework` now has runtime dependency on `ij.android.plugin` module to obtain real plugin.xml. All the local plugin.xml in test modules were deleted, as they can now use the xml from `ij.android.plugin`. Most of the deleted plugin.xml contained `<xi:include href="/META-INF/android-plugin.xml" ... />` anyway. But these test modules could not co-exist in a single test classpath (same optional file, e.g. `<depends optional="true" config-file="layoutlib-native.xml">`, may not be included into two different plugin descriptors, declared by two different test modules).

Being able to put all the test modules into a single classpath is a prerequisite for running all the android-plugin tests in IJ.

Note that this commit extends runtime classpath of all the test modules: all the modules from `ij.android.plugin` are now available as runtime dependencies for each test module as a transitive dependency of `ij.android.testFramework`.

GitOrigin-RevId: 86e82963060ace0f67f52894bcc8faec758fb525

3 weeks agoAndroid: workaround for IDEA-240279: DynamicBundle is not supported in JPS build...
Andrei Kuznetsov [Thu, 7 May 2020 09:49:22 +0000 (12:49 +0300)]
Android: workaround for IDEA-240279: DynamicBundle is not supported in JPS build process

When running from distributive, it is available from platform-api.jar (the jar itself probably should not be available on the classpath though).
When running from sources, `ClassNotFoundException` is thrown in the build process.

GitOrigin-RevId: a0943239d25e26fd077b23bd192c044343561881

3 weeks agoInitial support for icon description tooltips (IDEA-237109)
Dmitry Jemerov [Tue, 5 May 2020 16:38:53 +0000 (18:38 +0200)]
Initial support for icon description tooltips (IDEA-237109)

GitOrigin-RevId: 137eb5c9b12d890b4f446b106523207f1b54e96a

3 weeks agoRemove some unused registry keys
Dmitry Jemerov [Tue, 5 May 2020 13:34:23 +0000 (15:34 +0200)]
Remove some unused registry keys

GitOrigin-RevId: db990b97f2fdc45ac9e188f48691e4d8ab76d7f0

3 weeks agoavoid removing connection on disconnect from list on each disconnect because removing...
Vladimir Krivosheev [Mon, 4 May 2020 09:54:29 +0000 (11:54 +0200)]
avoid removing connection on disconnect from list on each disconnect because removing is a linear operation

GitOrigin-RevId: df90d83f66ae2ab2876a9d11223b1ae5c8fa81eb

3 weeks agocleanup
Vladimir Krivosheev [Mon, 4 May 2020 09:13:55 +0000 (11:13 +0200)]
cleanup

GitOrigin-RevId: 09e062d39c060ca8996abd9b6bfaab58d39c7d96

4 weeks agoAndroid: move android-studio only action to dedicated xml file (designer-androidstudi...
Andrei Kuznetsov [Wed, 29 Apr 2020 21:09:40 +0000 (00:09 +0300)]
Android: move android-studio only action to dedicated xml file (designer-androidstudio.xml)

GitOrigin-RevId: 49e777b36ae9090f2707cd044d54f99b7b3199d8

4 weeks agoreduce broadcasting - broadcasting is not cheap, better to avoid it if not needed
Vladimir Krivosheev [Wed, 29 Apr 2020 15:44:25 +0000 (17:44 +0200)]
reduce broadcasting - broadcasting is not cheap, better to avoid it if not needed

GitOrigin-RevId: 573686e23beac133c427be8b64e9bdd2b01d59b3

4 weeks agoIDEA-238800: Add an extension point to define a configurable group
Sergey Malenkov [Tue, 28 Apr 2020 17:44:05 +0000 (20:44 +0300)]
IDEA-238800: Add an extension point to define a configurable group

GitOrigin-RevId: ad91af170a829fdf34826ed4bc81db2ed964db6c

4 weeks agoIDEA-133793,IDEA-159120,IDEA-232414: Android SQLite data source dialog unable to...
Andrei Kuznetsov [Tue, 28 Apr 2020 16:24:19 +0000 (19:24 +0300)]
IDEA-133793,IDEA-159120,IDEA-232414: Android SQLite data source dialog unable to show the device's database list

Use com.android.tools.idea.explorer.adbimpl.AdbDeviceFileSystemService, which is also used by Device Explorer, to list files on remote devices.

GitOrigin-RevId: 802be4bac3a99e7620ee4e1610fb6234210abb89

4 weeks agoIDEA-232311: physical Android device name is not shown in Android SQLite data source
Andrei Kuznetsov [Tue, 28 Apr 2020 15:40:30 +0000 (18:40 +0300)]
IDEA-232311: physical Android device name is not shown in Android SQLite data source

Caused by DeviceRenderer.DeviceComboBoxRenderer, which needs DeviceNameProperties to populate combobox items. But DeviceNameProperties were never up-to-date, and contained null values only.

GitOrigin-RevId: caf2697d86ba0c1984db7682b7d4d548885a38e7

4 weeks agoIDEA-159120: Android datasource: package selector does not honor applicationId overri...
Andrei Kuznetsov [Tue, 28 Apr 2020 09:50:37 +0000 (12:50 +0300)]
IDEA-159120: Android datasource: package selector does not honor applicationId overrides/suffixes from build variants

GitOrigin-RevId: 5fe7d2164878f34784efada83be6d87887e29fbb

4 weeks agoDefaultJdkConfigurator is not component anymore
Tagir Valeev [Tue, 28 Apr 2020 05:02:42 +0000 (12:02 +0700)]
DefaultJdkConfigurator is not component anymore

It's necessary to configure JDK before creating a new project on the new project wizard, so we just trigger this configuration in ProjectSdksModel#reset via ProjectJdkTable#preconfigure. A DefaultJdkConfigurator service now used to detect the best JDK on current system. We could omit this service, but Android Studio wants to disable this.

GitOrigin-RevId: 1ac74ec06d17a571abece70cb4de1ac9bacd940b

4 weeks agoRevert "DefaultJdkConfigurator is not component anymore"
Tagir Valeev [Tue, 28 Apr 2020 06:12:51 +0000 (13:12 +0700)]
Revert "DefaultJdkConfigurator is not component anymore"

This reverts commit a0e14ca9

GitOrigin-RevId: 8b6fe456eb0d9b2cdeaf7ebad2fe10a73180b002

4 weeks agoDefaultJdkConfigurator is not component anymore
Tagir Valeev [Tue, 28 Apr 2020 05:02:42 +0000 (12:02 +0700)]
DefaultJdkConfigurator is not component anymore

It's necessary to configure JDK before creating a new project on the new project wizard, so we just trigger this configuration in ProjectSdksModel#reset via ProjectJdkTable#preconfigure. A DefaultJdkConfigurator service now used to detect the best JDK on current system. We could omit this service, but Android Studio wants to disable this.

GitOrigin-RevId: a0e14ca9760eba0f0f30c5cd186683a9118377a0

4 weeks agoFix intellij.android.ultimate.iml referencing `resources` dir which has been deleted...
Andrei Kuznetsov [Mon, 27 Apr 2020 10:06:57 +0000 (13:06 +0300)]
Fix intellij.android.ultimate.iml referencing `resources` dir which has been deleted earlier

GitOrigin-RevId: 45c4a9a908616ac09c29dc246aa0377b47b47356

4 weeks agoTrack CodeStyleSettings for dynamic plugin unload by default (old API), clean depreca...
Rustam Vishnyakov [Fri, 24 Apr 2020 16:36:33 +0000 (19:36 +0300)]
Track CodeStyleSettings for dynamic plugin unload by default (old API), clean deprecated API usages (IDEA-234660)

the former is to avoid unnecessary referencing, especially in tests.

GitOrigin-RevId: 0392f5c9ae28cee50b220aa879b76d49a185e4b9

4 weeks agoremove deprecated method
Alexey Kudravtsev [Sat, 25 Apr 2020 16:46:43 +0000 (19:46 +0300)]
remove deprecated method

GitOrigin-RevId: d511b6b7294542cab6b859b6dbc4a6e223a2348f

4 weeks agoRevert "DefaultJdkConfigurator as a service"
Tagir Valeev [Mon, 27 Apr 2020 09:43:22 +0000 (16:43 +0700)]
Revert "DefaultJdkConfigurator as a service"

This reverts commit 7a950aaf

GitOrigin-RevId: 01beacca2383ac9c4445a7a0b404b6b8b8fac592

4 weeks agoDefaultJdkConfigurator as a service
Tagir Valeev [Mon, 27 Apr 2020 08:30:35 +0000 (15:30 +0700)]
DefaultJdkConfigurator as a service

GitOrigin-RevId: 7a950aaf22e26838b671a96afc756cb787825e45

5 weeks agoIDEA-179033,IDEA-166366,IDEA-237650: Fix Android + Database Editor integration (conne...
Andrei Kuznetsov [Fri, 24 Apr 2020 18:20:09 +0000 (21:20 +0300)]
IDEA-179033,IDEA-166366,IDEA-237650: Fix Android + Database Editor integration (connect to SQLite on emulator/device)

android.database had its own implementation supporting communication with device/emulator (e.g. download/upload files). This implementation is outdated. Remove it and replace with com.android.tools.idea.explorer.adbimpl.AdbDeviceFileSystemService, which is also used by Device Explorer, and maintained by AOSP team.

GitOrigin-RevId: cdfa26df2c22a41bb2a77100c88bb393dcba7578

5 weeks agoAndroid: fix leaking javax.swing.event.ChangeListener in ColumnTreeUI
Andrei Kuznetsov [Fri, 24 Apr 2020 16:23:26 +0000 (19:23 +0300)]
Android: fix leaking javax.swing.event.ChangeListener in ColumnTreeUI

User sees the leak as NPE at com.android.tools.adtui.common.ColumnTreeBuilder.setTreeOffset(ColumnTreeBuilder.java:286)

GitOrigin-RevId: 81259c754136197e72b80a7153acebc3a1061bb1

5 weeks agoFix failing Android tests (Application == null) / com.android.tools.idea.explorer...
Andrei Kuznetsov [Thu, 23 Apr 2020 18:49:00 +0000 (21:49 +0300)]
Fix failing Android tests (Application == null) / com.android.tools.idea.explorer.adbimpl.AdbDeviceFileSystemTest

GitOrigin-RevId: c7c56aa9ef518a205264d8a988038cf3c5cd99af

5 weeks ago[Gradle] wip: make Gradle plugin dynamic, ES notification EP IDEA-238179
Vladislav.Soroka [Fri, 24 Apr 2020 11:40:33 +0000 (14:40 +0300)]
[Gradle] wip: make Gradle plugin dynamic, ES notification EP IDEA-238179

GitOrigin-RevId: 62b0dce20beae19534ce9fa10a8765a2c6f9e9a2

5 weeks agoclear cache before notify listeners to ensure that listeners don't get outdated data
Vladimir Krivosheev [Thu, 23 Apr 2020 18:15:09 +0000 (20:15 +0200)]
clear cache before notify listeners to ensure that listeners don't get outdated data

GitOrigin-RevId: c98fd042cfacf7ebfd0a438485eb5a3cc5a2d4d5

5 weeks ago[test framework] clean instance fields of a test class in UsefulTestCase::tearDown
Nikolay Chashnikov [Thu, 23 Apr 2020 15:14:53 +0000 (18:14 +0300)]
[test framework] clean instance fields of a test class in UsefulTestCase::tearDown

_LastInSuiteTest.testDynamicExtensions checks that there are no references to extension objects, so setting instance fields to null is needed to avoid failures if some test indirectly refers to an extension via its field. This may also allow GC to do its work while running tests.

GitOrigin-RevId: 78a34f6f5a322a8fb13fe7a8d948f419c814f964

5 weeks agoIDEA-237650: Android Device Explorer can't download files in IDEA
Andrei Kuznetsov [Thu, 23 Apr 2020 18:13:49 +0000 (21:13 +0300)]
IDEA-237650: Android Device Explorer can't download files in IDEA

FutureCallbackExecutor assumes that Guava's futures are unwrapping UndeclaredThrowableException, therefore any `ThrowingFunction` can be replaced with non-throwing `Function` by wrapping it with `try-catch(unchecked){throw UndeclaredThrowableException(unchecked)}`. Assumption is supported by the statement "See {@link Futures.AbstractChainingFuture#run}". AbstractChainingFuture existed in Guava 19, bun does not exist in Guava 20. In Guava 21 (used by Android Studio) this assumption still valid in some cases. In Guava 29.0 (used by Idea) this assumption is not valid. As a result, `AdbDeviceDirectFileEntry.downloadFile` is broken in Idea, because it expects to receive checked `SyncException`, and applies fallback logic if exception happened. With Guava 29 `downloadFile` receives `UndeclaredThrowable(caused by: SyncException)`, so fallback is never applied. User sees "Remote object does not exist" error.

GitOrigin-RevId: ddacbe18fe113abfa62fb3dfee126bd1a63bf132

5 weeks ago[Perf] Android transforms to dynamic plugin: convert component into service / DataBin...
Andrei Kuznetsov [Wed, 22 Apr 2020 23:24:14 +0000 (02:24 +0300)]
[Perf] Android transforms to dynamic plugin: convert component into service / DataBindingModuleComponent

GitOrigin-RevId: 9a9fbaf1d92e92a6e33789ded2c5099c7e5091c0

5 weeks ago[Perf] Android transforms to dynamic plugin: convert component into service / Android...
Andrei Kuznetsov [Wed, 22 Apr 2020 20:27:51 +0000 (23:27 +0300)]
[Perf] Android transforms to dynamic plugin: convert component into service / AndroidProjectComponent

GitOrigin-RevId: 3467f0548b407012a4c80b6eb4f5c1e8b492f62f

5 weeks ago[Perf] Android transforms to dynamic plugin: convert component into service / Android...
Andrei Kuznetsov [Wed, 22 Apr 2020 20:24:48 +0000 (23:24 +0300)]
[Perf] Android transforms to dynamic plugin: convert component into service / AndroidPropertyFilesUpdater

GitOrigin-RevId: 776ea632ab39faf353dd0b38d6a20c3eae2f5f3f

5 weeks ago[Perf] Android transforms to dynamic plugin: convert component into service / PsiProj...
Andrei Kuznetsov [Wed, 22 Apr 2020 18:49:52 +0000 (21:49 +0300)]
[Perf] Android transforms to dynamic plugin: convert component into service / PsiProjectListener

Changes to `LazyFileListenerSubscriber` were partially picked from (not-merged-yet) commit "kunshen* 17.10.2019, 23:27 Add MergedManifest modification listener". MergedManifestRefreshListener was adapted to these changes.

PsiProjectListener is converted to service, which is eagerly subscribes for events in a dedicated startup activity `PsiProjectListener$SubscribeOnStartupActivity` which is equivalent to registration in constructor prior to this commit. Most likely, eager registration should be dropped.

Subscriber services now implement Disposable to avoid memory leaks: projects should never be used as parent disposables.

GitOrigin-RevId: a2d89d303f0301325c4282aea77469fa727e7ace

5 weeks agoDeprecate direct CodeStyleSettings creation in tests, replace with CodeStyle.createTe...
Rustam Vishnyakov [Wed, 22 Apr 2020 14:21:53 +0000 (17:21 +0300)]
Deprecate direct CodeStyleSettings creation in tests, replace with CodeStyle.createTestSettings()

GitOrigin-RevId: b88804f5f19f4dcd3297e26ed007711e3de1dc37

5 weeks agoAndroid: drop useless <depends>org.jetbrains.plugins.terminal</depends> with no ...
Andrei Kuznetsov [Wed, 22 Apr 2020 11:54:37 +0000 (14:54 +0300)]
Android: drop useless <depends>org.jetbrains.plugins.terminal</depends> with no 'config-file' attribute

GitOrigin-RevId: e9094c7637eaefd02235a83f3ea3351dccd7f697

5 weeks ago[Perf] Android: drop obsolete dependency on TestNG-J
Andrei Kuznetsov [Wed, 22 Apr 2020 11:53:05 +0000 (14:53 +0300)]
[Perf] Android: drop obsolete dependency on TestNG-J

GitOrigin-RevId: 89dc53100b583cfa0902b9ae55258be51bbd269f

5 weeks ago[Perf] Android transforms to dynamic plugin: convert component into service / LayoutB...
Andrei Kuznetsov [Wed, 22 Apr 2020 11:48:45 +0000 (14:48 +0300)]
[Perf] Android transforms to dynamic plugin: convert component into service / LayoutBindingProjectComponent

GitOrigin-RevId: 58246b2aee123d328fc31aca7e23f141e58cbd14