From: Mathieu Baudier Date: Fri, 14 Apr 2017 12:13:17 +0000 (+0200) Subject: Make OSGi Boot more robust X-Git-Tag: argeo-commons-2.1.69~13 X-Git-Url: https://git.argeo.org/?p=lgpl%2Fargeo-commons.git;a=commitdiff_plain;h=aaa5cb182dcc0e209ddbbb3581787860329b86a5 Make OSGi Boot more robust --- diff --git a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java index f44642d52..34457e669 100644 --- a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java +++ b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java @@ -181,11 +181,16 @@ public class OsgiBoot implements OsgiBootConstants { else if (OsgiBootUtils.debug) OsgiBootUtils.debug( "Installed " + bundle.getSymbolicName() + "-" + bundle.getVersion() + " from " + url); + assert bundle.getSymbolicName() != null; // uninstall previous versions bundles: for (Bundle b : bundleContext.getBundles()) { + if (b.getSymbolicName() == null) + continue bundles; if (bundle.getSymbolicName().equals(b.getSymbolicName())) { Version bundleV = bundle.getVersion(); Version bV = b.getVersion(); + if (bV == null) + continue bundles; if (bundleV.getMajor() == bV.getMajor() && bundleV.getMinor() == bV.getMinor()) { if (bundleV.getMicro() > bV.getMicro()) { // uninstall older bundles