Repository: karaf-cellar Updated Branches: refs/heads/master 9ac87b1bc -> c94a79ef6
[KARAF-4909] Prevent NPE in BundleSynchronizer Project: http://git-wip-us.apache.org/repos/asf/karaf-cellar/repo Commit: http://git-wip-us.apache.org/repos/asf/karaf-cellar/commit/c94a79ef Tree: http://git-wip-us.apache.org/repos/asf/karaf-cellar/tree/c94a79ef Diff: http://git-wip-us.apache.org/repos/asf/karaf-cellar/diff/c94a79ef Branch: refs/heads/master Commit: c94a79ef6b28d8175a018f080af80456633717c9 Parents: 9ac87b1 Author: Jean-Baptiste Onofré <[email protected]> Authored: Wed Apr 19 15:30:31 2017 +0200 Committer: Jean-Baptiste Onofré <[email protected]> Committed: Wed Apr 19 15:30:31 2017 +0200 ---------------------------------------------------------------------- assembly/src/main/resources/groups.cfg | 34 ++++++++++---------- .../karaf/cellar/bundle/BundleSynchronizer.java | 4 ++- 2 files changed, 20 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/c94a79ef/assembly/src/main/resources/groups.cfg ---------------------------------------------------------------------- diff --git a/assembly/src/main/resources/groups.cfg b/assembly/src/main/resources/groups.cfg index 7dac669..ae294b0 100644 --- a/assembly/src/main/resources/groups.cfg +++ b/assembly/src/main/resources/groups.cfg @@ -6,22 +6,22 @@ groups = default # # Filtering of the bundles in the default cluster group # -default.bundle.whitelist.inbound = * -default.bundle.whitelist.outbound = * -default.bundle.blacklist.inbound = *.xml -default.bundle.blacklist.outbound = *.xml +default.bundle.whitelist.inbound=* +default.bundle.whitelist.outbound=* +default.bundle.blacklist.inbound=*.xml +default.bundle.blacklist.outbound=*.xml # # Filtering of the configurations in the default cluster group # -default.config.whitelist.inbound = * -default.config.whitelist.outbound = * -default.config.blacklist.inbound = org.apache.felix.fileinstall*, \ +default.config.whitelist.inbound=* +default.config.whitelist.outbound=* +default.config.blacklist.inbound=org.apache.felix.fileinstall*, \ org.apache.karaf.management, \ org.apache.karaf.shell, \ org.ops4j.pax.web, \ org.apache.aries.transaction -default.config.blacklist.outbound = org.apache.felix.fileinstall*, \ +default.config.blacklist.outbound=org.apache.felix.fileinstall*, \ org.apache.karaf.management, \ org.apache.karaf.shell, \ org.ops4j.pax.web, \ @@ -30,10 +30,10 @@ default.config.blacklist.outbound = org.apache.felix.fileinstall*, \ # # Filtering of the features in the default cluster group # -default.feature.whitelist.inbound = * -default.feature.whitelist.outbound = * -default.feature.blacklist.inbound = none -default.feature.blacklist.outbound = none +default.feature.whitelist.inbound=* +default.feature.whitelist.outbound=* +default.feature.blacklist.inbound=none +default.feature.blacklist.outbound=none # # The following properties define the behavior to use when the node joins the cluster (the usage of the bootstrap @@ -49,8 +49,8 @@ default.feature.blacklist.outbound = none # nodeOnly: the node is the "master", the node pushes his state to the cluster group, nothing is pulled from the # cluster group # -default.bundle.sync = cluster -default.config.sync = cluster -default.feature.sync = cluster -default.obr.urls.sync = cluster -default.balanced.servlet.sync = cluster +default.bundle.sync=cluster +default.config.sync=cluster +default.feature.sync=cluster +default.obr.urls.sync=cluster +default.balanced.servlet.sync=cluster http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/c94a79ef/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java ---------------------------------------------------------------------- diff --git a/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java b/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java index 8547ab1..b722076 100644 --- a/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java +++ b/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java @@ -335,7 +335,9 @@ public class BundleSynchronizer extends BundleSupport implements Synchronizer { Dictionary<String, Object> properties = configuration.getProperties(); if (properties != null) { String propertyKey = groupName + Configurations.SEPARATOR + Constants.CATEGORY + Configurations.SEPARATOR + Configurations.SYNC; - return properties.get(propertyKey).toString(); + if (properties.get(propertyKey) != null) { + return properties.get(propertyKey).toString(); + } } } catch (IOException e) { LOGGER.error("CELLAR BUNDLE: error while retrieving the sync policy", e);
