Replace APIs using equinox VersionRange and PluginRegistry.PluginFilter #1163
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.
Modernize the PDE API that contains the antiquated
org.eclipse.osgi.service.resolver.VersionRange
by providing alternatives using theorg.osgi.framework.VersionRange
and deprecating the existing methods for removal.In conjunction with that also mark
PluginRegistry.PluginFilter
as deprecated for removal since it is effectively aPredicate<IPluginModelBase>
and just use the latter in the new methods.This is currently an early draft to discuss the overall direction. Since the intention is to focus on the API callers of the now deprecated methods are not replaced in this PR. I'll do that in a follow-up.
About the API I'm also contemplating to further modernize the methods in
PluginRegistry
that now return a List to return a Stream instead. Then we could also save the filter arguments since callers can just filter the returned stream if desired.Furthermore I would also like to replace the integer and string constants in
IMatchRules
by a corresponding EnumVersionMatchRules
(or similar) that also provides method to obtain a predicate for a reference version that implements the literals matching rule or to obtain a correspondingVersionRange
from a reference version (which ever is needed).Part of #1069