-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API tooling reports 300 false positive errors on SWT #1093
Merged
Merged
Conversation
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
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
That sounds awesome! 🥇 |
Test Results 290 files + 97 290 suites +97 1h 6m 43s ⏱️ + 34m 21s For more details on these failures, see this check. Results for commit 841b522. ± Comparison against base commit f26df87. |
Unrelated maven warning
|
good job, thanks for fixing long standing bug |
This was referenced Apr 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before the change ApiBaseline.resolveSystemLibrary() did following:
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:
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:
Fixes #1073