if (capList != null)
{
capList.remove(caps[i]);</BUG>
}
<BUG>capList = (List) m_resolvedPkgIndex.get(pkgName);
if (capList != null)
{
capList.remove(caps[i]);</BUG>
}
<BUG>}
}
m_resolvedCapMap.remove(host);</BUG>
try

{
Requirement hostReq = getFragmentHostRequirement(fragment);
List matchingHosts = new ArrayList();
SecurityManager sm = System.getSecurityManager();
if (sm != null)
{
if (!((BundleProtectionDomain) fragment.getSecurityContext()).impliesDirect(new BundlePermission(
fragment.getSymbolicName(), BundlePermission.FRAGMENT)))
{
return matchingHosts;
