- string activatorName = bundles[i][BUNDLE_ACTIVATOR];
- std::replace(activatorName.begin(), activatorName.end(), '.', '/');
- ((BundleInfoInternal *) bundleInfo)->setActivatorName(activatorName);
- ((BundleInfoInternal *) bundleInfo)->setLibraryPath(
- bundles[i][BUNDLE_LIBRARY_PATH]);
- }
+ shared_ptr<BundleInfoInternal> bundleInfo(new BundleInfoInternal);
+ bundleInfo->setPath(bundles[i][BUNDLE_PATH]);
+ bundleInfo->setVersion(bundles[i][BUNDLE_VERSION]);
+ bundleInfo->setID(bundles[i][BUNDLE_ID]);
+ if (!bundles[i][BUNDLE_ACTIVATOR].empty())
+ {
+ string activatorName = bundles[i][BUNDLE_ACTIVATOR];
+ std::replace(activatorName.begin(), activatorName.end(), '.', '/');
+ bundleInfo->setActivatorName(activatorName);
+ bundleInfo->setLibraryPath(bundles[i][BUNDLE_LIBRARY_PATH]);
+ }