Skip to content

Add a final check for references of unused packages#1882

Merged
laeubi merged 1 commit intoeclipse-pde:masterfrom
laeubi:search_for_source_references
Jul 19, 2025
Merged

Add a final check for references of unused packages#1882
laeubi merged 1 commit intoeclipse-pde:masterfrom
laeubi:search_for_source_references

Conversation

@laeubi
Copy link
Copy Markdown
Contributor

@laeubi laeubi commented Jul 19, 2025

Currently there is one category of usages that are now no longer detected since we use bndlib to find referenced packages that is if something is only needed at compiletime because the compiler otherwise inline the value.

This now restores the previous java search but only for these packages that are selected to be removed. This is faster as we do not need to query all packages and discovers cases where an import is only needed for a compile time constant.

Currently there is one category of usages that are now no longer
detected since we use bndlib to find referenced packages that is if
something is only needed at compiletime because the compiler otherwise
inline the value.

This now restores the previous java search but only for these packages
that are selected to be removed. This is faster as we do not need to
query all packages and discovers cases where an import is only needed
for a compile time constant.
@github-actions
Copy link
Copy Markdown

Test Results

   765 files  ±0     765 suites  ±0   50m 38s ⏱️ + 3m 46s
 3 611 tests ±0   3 557 ✅ ±0   54 💤 ±0  0 ❌ ±0 
10 834 runs  ±0  10 671 ✅ ±0  163 💤 ±0  0 ❌ ±0 

Results for commit 5ef795a. ± Comparison against base commit 92fa880.

@laeubi laeubi merged commit a3ce017 into eclipse-pde:master Jul 19, 2025
19 checks passed
@HannesWell
Copy link
Copy Markdown
Member

This now restores the previous java search but only for these packages that are selected to be removed. This is faster as we do not need to query all packages and discovers cases where an import is only needed for a compile time constant.

Also when looking at #1862, I was wondering if search provided by JDT should be enhanced somehow in order to be faster in general?

@laeubi
Copy link
Copy Markdown
Contributor Author

laeubi commented Jul 19, 2025

One problem is that currently we also gather all searches where we would be happy with one match... in any case performance is not that important than correctness, so if it work reliable I'm all happy with that at a first step. Also it might be good to cache the searchscope and such kind of optimization.

@HannesWell
Copy link
Copy Markdown
Member

One problem is that currently we also gather all searches where we would be happy with one match... in any case performance is not that important than correctness, so if it work reliable I'm all happy with that at a first step.

Yes absolutely, correctness is the number one priority but speed is also good to have. But before this functionality lacked both.
So a general thanks for working on both.

Also it might be good to cache the searchscope and such kind of optimization.

Yes I was thinking about something like this as well.

@merks
Copy link
Copy Markdown
Contributor

merks commented Jul 19, 2025

Yes, great work!

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.

3 participants