protected static AbstractBundle createBundle(BundleData bundledata, Framework framework, boolean setBundle) throws BundleException {
AbstractBundle result;
if ((bundledata.getType() & BundleData.TYPE_FRAGMENT) > 0)
result = new BundleFragment(bundledata, framework);
else if ((bundledata.getType() & BundleData.TYPE_COMPOSITEBUNDLE) > 0)
result = new CompositeImpl(bundledata, framework);
else if ((bundledata.getType() & BundleData.TYPE_SURROGATEBUNDLE) > 0)
result = new SurrogateImpl(bundledata, framework);
else
result = new BundleHost(bundledata, framework);
if (setBundle)