{
if (caps != null)
{
for (Capability cap : caps)
{
<BUG>if (cap.getNamespace().equals(Capability.MODULE_NAMESPACE))
{
m_modCapSet.removeCapability(cap);

}
else if (cap.getNamespace().equals(Capability.PACKAGE_NAMESPACE))
{
m_pkgCapSet.removeCapability(cap);</BUG>
}

{
if (isSingleton(module))
{
List<Module> modules = m_singletons.get(module.getSymbolicName());
Module current = ((modules != null) && !modules.isEmpty()) ? modules.get(0) : null;
for (int i = 0; (modules != null) && (i < modules.size()); i++)
{
if (modules.get(i).isResolved())
{
current = modules.get(i);
