Commit Graph

23 Commits

Author SHA1 Message Date
Daniil Ovchinnikov
823e985f18 API dumps: re-generate dumps
GitOrigin-RevId: b5cec844cbfe3313723404f7a85b590c25350b41
2024-10-04 21:20:21 +00:00
Daniil Ovchinnikov
81747daafe API dumps: dump experimental APIs into a separate file api-dump-experimental.txt
GitOrigin-RevId: 2073b4ee9a1c8c13742aad0554a4e87b3f9c0fac
2024-10-04 21:20:21 +00:00
Daniil Ovchinnikov
459d924207 API dumps: ability to dump a bunch of signatures to a String
GitOrigin-RevId: 9d099cb094cb2b12e37879dfd00c8c31996b6ec5
2024-10-04 15:42:30 +00:00
Daniil Ovchinnikov
863696088d add diagnostic info to ApiIndex.discoverClass
GitOrigin-RevId: dc237c079933dedd065d61811e9ded4a43fb3c10
2024-09-02 19:10:22 +00:00
Daniil Ovchinnikov
7e3390a939 IJPL-150347 treat @NonExtendable classes as effectively final
GitOrigin-RevId: 273fb2a330cb67183be538890ae5c2c53aa9acf8
2024-07-08 23:18:28 +00:00
Daniil Ovchinnikov
9a260d7a93 ApiCheckTest: discover API of all dependencies before analyzing the module
This allows re-running the test for a particular module.

GitOrigin-RevId: 5336f2ecfc492c11e3a6c5ca387a8aa0fda369c8
2024-05-29 22:28:53 +00:00
Daniil Ovchinnikov
5331a6fa8f API dump: simplify annotate
GitOrigin-RevId: f2fba40f4f6454a0669bc08e9e6a2e6a6c5e3200
2024-05-29 22:28:53 +00:00
Daniil Ovchinnikov
6226776bd0 IJPL-148997 exclude non-abstract toString() from the API dump
GitOrigin-RevId: 6352bbb374532bca296d08131ae50083f69e46c0
2024-05-29 00:05:31 +00:00
Daniil Ovchinnikov
1608c4c92e IJPL-148490 exclude empty file-classes from API
GitOrigin-RevId: d0bdb06e75377c439bb5c83863ffcc596db9e55a
2024-04-30 20:39:38 +00:00
Daniil Ovchinnikov
42acef4890 API dump: bump binary-compatibility-validator dependency
In the new version, synthetic `$EntriesMappings` classes are excluded from the API.

GitOrigin-RevId: d0eb093f6521eaa7d45c5c9e8454a5200d119134
2024-04-10 23:32:18 +00:00
Daniil Ovchinnikov
6aaf1b277d IJPL-797 API dump: generate exposed api lists for modules with existing api-dump.txt
GitOrigin-RevId: 15cf24719be8fa758f5d06659539e19b9dea1a3c
2024-04-08 23:31:05 +00:00
Daniil Ovchinnikov
748008ae87 ApiCheckTest: use api-dump.txt instead of apiDump.txt
GitOrigin-RevId: d195bea932a0a26d192aea94c4f551c166ab3d1f
2024-04-08 16:18:00 +00:00
Daniil Ovchinnikov
5b1112746f API dump: don't inherit a member if signature already exists
GitOrigin-RevId: 0df0fb2e1cd42d8f18d033f167c5b2a039ff0059
2024-04-06 01:43:39 +00:00
Daniil Ovchinnikov
68bb8c0769 API dump: inherit API members of non-API supertypes
Before the change, only static members were inherited.
After the change, all members except constructors are inherited.

GitOrigin-RevId: 11655dae1a9bb8d2fe2f381ebe5d262c0f6f33eb
2024-04-06 01:43:34 +00:00
Daniil Ovchinnikov
deed7db032 API dump: don't inherit protected members from non-API supertypes in final classes
GitOrigin-RevId: b8a5a7d385bd0529430b2c9859a2835a40dacea5
2024-04-06 01:43:29 +00:00
Daniil Ovchinnikov
fe0fcd0409 API dump: don't inherit members from @ApiStatus.Internal supertypes
`@ApiStatus.Internal` acts on members, making them effectively `@ApiStatus.Internal` as well.

GitOrigin-RevId: 3dfd62df44a248460af613f915e8ff88f8ba63fe
2024-04-06 01:43:24 +00:00
Daniil Ovchinnikov
a02102c926 refactoring: replace flatMap with sequence
GitOrigin-RevId: b7197fb427fc0feca7c1d3e6820b1e2fb6d22b4a
2024-04-06 01:43:13 +00:00
Daniil Ovchinnikov
30e72eb070 API dump: include public supertypes of private supertypes
GitOrigin-RevId: 72c733ee53f03b52f84e781b78c502fdaddd07ba
2024-04-06 01:43:03 +00:00
Daniil Ovchinnikov
f9d3ce19d8 API dump: push package-level annotations to classes and class annotations to inner classes
GitOrigin-RevId: 98f060ed18c38394d1e12f0fbdd3660df69d45c2
2024-04-06 01:42:58 +00:00
Daniil Ovchinnikov
57896efa7e API dump: don't include synthetic bridges in the dump
These methods exist to support
- covariant return type overrides;
- generic overrides;
- overrides of `void` methods with methods returning `java/lang/Void` in Kotlin.

Such methods are called only through supertype invocations, and supertypes are already listed in the dump.

The main reason for avoiding these in dumps: Java allows extending a public class `B` from a package-local class `A`.
`B` can override a method of `A` with a covariant return type.
In this case, a synthetic bridge is generated in `B` with the return type from method in `A`.
If the method return type in `A` is also a package-local class `C`, this would mean `C` is leaked by the API surface of `B`.
Instead, we consider such bridges not a part of the API. For a concrete example, see:
`com.intellij.tools.apiDump.testData.inheritFromPackageLocal.JPackageLocalClass.packagePrivateMethodWithPackagePrivateReturnType`.

Another reason has the same root cause: Java allows such class inheritance.
A public class `B` which extends package-local class `A` "opens" up _all_ public/protected methods of `A` to the outer world.
In subsequent commits, this is going to be reflected in the dump by copying the API methods of package-local `A` into public `B`.
We don't want to copy the bridges, which a part of `A` and can be only accessed through supertype of `A`,
to avoid false positive leaking API errors.

GitOrigin-RevId: 2aecf62ad18f4ed6458927ccbd86f8066bea4751
2024-04-06 01:42:47 +00:00
Daniil Ovchinnikov
f5ca12a94b API dump: add more tests for overrides
This change is failing with the following error, which is fixed in the subsequent commits:

```
'intellij.tools.apiDump.testData' Private classes are exposed through API:
com/intellij/tools/apiDump/testData/inheritFromPackageLocal/JPackageLocalClass <- b com/intellij/tools/apiDump/testData/inheritFromPackageLocal/JPublicInheritor#packagePrivateMethodWithPackagePrivateReturnType ()Lcom/intellij/tools/apiDump/testData/inheritFromPackageLocal/JPackageLocalClass;
```

GitOrigin-RevId: fb532eadb637d776185cf58612ed0a6e9299ec45
2024-04-06 01:42:42 +00:00
Daniil Ovchinnikov
e18fcc8d0f IJPL-943 add "Analyze API Usage Count" action
Other changes in this commit:

- `resolveApiElement` added.

- `resolveApiField` and `resolveApiMethod` work on reference level
  => they should not go into base classes because the reference has the exact class name.

- `ApiWatcherBundle` added.

- `ApiElementNodeRenderer` can now render symbolic reference's presentable name.

GitOrigin-RevId: 2d7a694971dc25f2c737d314ed422a2c174a395c
2024-04-02 00:35:18 +00:00
Daniil Ovchinnikov
0c5dae7421 IJPL-943 move intellij.tools.apiDump to community
GitOrigin-RevId: 5858c5d7d4275d1d154d6e9b462eb77030707271
2024-04-02 00:35:09 +00:00