Skip to content
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

[APITools] Various minor and local code clean-ups and simplifications #1199

Merged
merged 1 commit into from Mar 16, 2024

Conversation

HannesWell
Copy link
Member

No description provided.

Copy link

github-actions bot commented Mar 15, 2024

Test Results

   291 files  ±0     291 suites  ±0   53m 8s ⏱️ - 10m 8s
 3 526 tests ±0   3 468 ✅ ±0   58 💤 ±0  0 ❌ ±0 
10 875 runs  ±0  10 698 ✅ ±0  177 💤 ±0  0 ❌ ±0 

Results for commit dc26614. ± Comparison against base commit 0849af2.

♻️ This comment has been updated with latest results.

@HannesWell HannesWell changed the title Clean/simplify up API use-scan code and BundleComponent [APITools] Clean-ip/simplify use-scans, preferences and BundleComponent Mar 15, 2024
@HannesWell HannesWell force-pushed the cleanup_use-scan branch 2 times, most recently from ded6e8e to 1cc0893 Compare March 16, 2024 11:00
@HannesWell HannesWell changed the title [APITools] Clean-ip/simplify use-scans, preferences and BundleComponent [APITools] Various minor and local code clean-ups and simplifications Mar 16, 2024
@HannesWell HannesWell force-pushed the cleanup_use-scan branch 2 times, most recently from 4317c5f to 4060e6b Compare March 16, 2024 11:55
@HannesWell HannesWell merged commit 0d546e9 into eclipse-pde:master Mar 16, 2024
17 checks passed
@HannesWell HannesWell deleted the cleanup_use-scan branch March 16, 2024 13:19
/**
* The mapping of filters for this store.
*/
protected HashMap<String, Set<IApiProblemFilter>> fFilterMap = null;
protected Map<String, Set<IApiProblemFilter>> fFilterMap = null;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laeubi it looks like changing the type of this field breaks the tycho-apitools-plugin:verify verify mojo.
I saw executions that fail with

Caused by: java.lang.NoSuchFieldError: fFilterMap
    at org.eclipse.tycho.apitools.ApiAnalysis$3.initializeApiFilters (ApiAnalysis.java:470)
    at org.eclipse.pde.api.tools.internal.FilterStore.isFiltered (FilterStore.java:181)

Maybe I understand something wrong, but does Tycho really use internals of API-Tools and at the same time loads the classes from a current I-builds repo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #1203 to restore the field of the internal class for now.
But on the long run there should be a more robust solution.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I understand something wrong, but does Tycho really use internals of API-Tools and at the same time loads the classes from a current I-builds repo?

Tycho loads the api-tools bundles and then runs an embedded framework where it calls the code like a regular bundle, as API Tools have literally no API it must call the (exported) internal API. As it compiles against the latest release there is some chance of incompatibility if one mixes a newer/older API tools Tycho is not build against.

In this case it extends FilterStore in org.eclipse.tycho.apitools.ApiAnalysis.getApiFilterStore(BundleComponent) to intercept the loading as otherwhise there is no way to influence where the store loads the file from, you can provide a constructor that allows to supply a file (or path) then we can use that one from the next release on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants