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

Fix ModuleCapability/ModuleRequirement hashcode/equals according to API #296

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

laeubi
Copy link

@laeubi laeubi commented Feb 22, 2024

The API of Capability/Requirement currently defines the contract to be: This Capability/Requirement is equal to another Capability/Requirement if they have the same namespace, directives and attributes and are declared by the same resource.

But Felix currently implements hashCode/equals in terms of object identity.

This is the counterpart for

The API of Capability/Requirement currently defines the contract to be:
This Capability/Requirement is equal to another Capability/Requirement
if they have the same namespace, directives and attributes and are
declared by the same resource.

But Felix currently implements hashCode/equals in terms of object
identity.
@@ -45,6 +46,7 @@ public class BundleCapabilityImpl implements BundleCapability
private final Map<String, Object> m_attrs;
private final List<String> m_uses;
private final Set<String> m_mandatory;
private transient int hashCode;
Copy link
Contributor

Choose a reason for hiding this comment

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

the formatting may use the same number of tabs as before

@stbischof
Copy link
Contributor

stbischof commented Feb 22, 2024

@tjwatson do we have some ci here?

do we may need an github workflow

@laeubi do we have an osgi-tck test that coverts this behavier?

@tjwatson
Copy link
Member

@tjwatson do we have some ci here?

Not sure what you are asking here. Probably a question for @karlpauls

@laeubi do we have an osgi-tck test that coverts this behavier?

Need caution here as I remember Richard Hall and I designing the resource and resolver APIs such that the framework can use identity equality for capabilities and bundle revisions.

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