return getLocation().equals(that.getLocation());
}
@Override
public List<Capability> getCapabilities(String namespace) {
SubsystemManifest manifest = getSubsystemManifest();
List<Capability> result = manifest.toCapabilities(this);
if (namespace != null)
for (Iterator<Capability> i = result.iterator(); i.hasNext();)
if (!i.next().getNamespace().equals(namespace))
i.remove();
// TODO Somehow, exposing the capabilities of content resources of a
// feature is causing an infinite regression of feature2 installations
// in FeatureTest.testSharedContent() under certain conditions.
if (isScoped() || IdentityNamespace.IDENTITY_NAMESPACE.equals(namespace))
return result;
SubsystemContentHeader header = manifest.getSubsystemContentHeader();
for (Resource constituent : getConstituents())
if (header.contains(constituent))
for (Capability capability : constituent.getCapabilities(namespace))
result.add(new BasicCapability(capability, this));
return result;