forked from eclipse-pde/eclipse.pde
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API tooling reports 300 false positive errors on SWT
Before the change ApiBaseline.resolveSystemLibrary() did following: 1) Collected all JVM installs matching all given execution environments id's 2) Iterated over all found installs **in random order** 3) For every JVM install ApiBaseline tried to initialize itself from that install 4) The condition used to stop the loop (almost) never worked as it always compared either null or previously initialized JVM with the current one, so for all **different** JVM's ApiBaseline initialized itself from that JVM - and that in random order. 5) The **last** iterated JVM install defined the maximal "supported" execution environment. In case of installed Java 1.8, 11, 17, 21 it could be **any one** if the target platform contained bundles required different execution environments. With that, SWT bundle (that requires 17 environment) from saved API baseline was not resolved with given baseline if any of lower environments "won the race" in resolveSystemLibrary(). Because SWT bundle was not resolved, none of SWT classes were found in the baseline and so not considered "API" in ApiComparator.internalCompare(). Because there were no API classes in the baseline, ALL public API types from workspace SWT project were considered as new API and "missing @SInCE tags" errors were created. With the change ApiBaseline.resolveSystemLibrary() does following: 1) Collects all JVM installs matching all given execution environments id's 2) Sorts them by their Java version, with highest version first 3) Iterates over all found installs **in descending order** 4) The first (highest Java version) matching JVM install will be used to initialize ApiBaseline 5) The loop continues only if the API baseline fails to initialize from given JVM With that, the **highest supported** JVM install that is required by given execution environments defines the maximal "supported" execution environment for the baseline. Additional changes: 1) ApiBaselineManager.readBaselineComponents() will sort bundles to get more stable behavior of the API tooling. 2) ApiBaseline.rebindVM() will use same ApiBaselineManagerRule that is used by ApiBaselineManager to dispose baselines. This will prevent that API analysis jobs may run in parallel with JVM re-initialization of the baseline or baseline JVM update will interfere with baseline disposal. Fixes eclipse-pde#1073
- Loading branch information
1 parent
69eb1b7
commit 9e70658
Showing
4 changed files
with
152 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters