// Verify whether all source bundles are available in the target package or absent...
BundleInfoImpl[] bundleInfos = source.getBundleInfoImpls();
for (int i = 0; i < bundleInfos.length; i++) {
String symbolicName = bundleInfos[i].getSymbolicName();
Version version = bundleInfos[i].getVersion();
DeploymentPackage targetPackage = getDeploymentPackageContainingBundleWithSymbolicName(symbolicName);
// If found, it should match the given target DP; not found is also ok...
if ((targetPackage != null) && !targetPackage.equals(target)) {
m_log.log(LogService.LOG_ERROR, "Bundle '" + symbolicName + "/" + version + " already present in other deployment packages!");
throw new DeploymentException(CODE_BUNDLE_SHARING_VIOLATION, "Bundle '" + symbolicName + "/" + version + " already present in other deployment packages!");
}
if (targetPackage == null) {
// Maybe the bundle is installed without deployment admin...
for (int j = 0; j < foreignBundles.length; j++) {
if (symbolicName.equals(foreignBundles[j].getSymbolicName()) && version.equals(foreignBundles[j].getVersion())) {
m_log.log(LogService.LOG_ERROR, "Bundle '" + symbolicName + "/" + version + " already present!");
throw new DeploymentException(CODE_BUNDLE_SHARING_VIOLATION, "Bundle '" + symbolicName + "/" + version + " already present!");
}
}
}