// If the class comes from bundle class loader, then return
// associated bundle if it is from this framework instance.
if (clazz.getClassLoader() instanceof BundleReference)
{
// Only return the bundle if it is from this framework.
BundleReference br = (BundleReference) clazz.getClassLoader();
return ((br.getBundle() instanceof BundleImpl)
&& (((BundleImpl) br.getBundle()).getFramework() == this))
? br.getBundle() : null;
}
// Otherwise check if the class conceptually comes from the
// system bundle. Ignore implicit boot delegation.
if (!clazz.getName().startsWith("java."))
{