X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.osgi%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fosgi%2FBundlesManager.java;h=e24b7223b7736299125d5aae7f6ddd29b5a4d0f6;hb=44d72c1a645ca69e28ad03d46367cd4a9dde99bd;hp=22d1e4b455b347953b2b38d0806c13cbd7e46f3f;hpb=91ec63b012729bdfa5fb3854bf9e9dd5f6d6ac91;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/BundlesManager.java b/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/BundlesManager.java index 22d1e4b45..e24b7223b 100644 --- a/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/BundlesManager.java +++ b/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/BundlesManager.java @@ -299,16 +299,23 @@ public class BundlesManager implements BundleContextAware, FrameworkListener, Assert.isTrue( osgiBundle.getName().equals(bundle.getSymbolicName()), "symbolic name consistent"); - Assert.isTrue(osgiBundle.getVersion().equals( - bundle.getHeaders().get(Constants.BUNDLE_VERSION)), - "version consistent"); + if (osgiBundle.getVersion() != null) + Assert.isTrue(osgiBundle.getVersion().equals( + bundle.getHeaders().get(Constants.BUNDLE_VERSION)), + "version consistent"); } else { - for (Bundle b : bundleContext.getBundles()) { + bundles: for (Bundle b : bundleContext.getBundles()) { if (b.getSymbolicName().equals(osgiBundle.getName())) { + if (osgiBundle.getVersion() == null) { + bundle = b; + break bundles; + } + if (b.getHeaders().get(Constants.BUNDLE_VERSION).equals( osgiBundle.getVersion())) { bundle = b; osgiBundle.setInternalBundleId(b.getBundleId()); + break bundles; } } }