in repository/service/src/main/java/org/apache/karaf/cave/repository/service/bundlerepository/CapabilitySet.java [102:124]
public void removeCapability(Capability cap) {
if (capSet.remove(cap)) {
for (Entry<String, Map<Object, Set<Capability>>> entry : indices.entrySet()) {
Object value = cap.getAttributes().get(entry.getKey());
if (value != null) {
if (value.getClass().isArray()) {
value = convertArrayToList(value);
}
Map<Object, Set<Capability>> index = entry.getValue();
if (value instanceof Collection) {
Collection c = (Collection) value;
for (Object o : c) {
deindexCapability(index, cap, o);
}
} else {
deindexCapability(index, cap, value);
}
}
}
}
}