You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/09/30 23:52:21 UTC
[22/31] git commit: updated refs/heads/ui-restyle to ef74127
Default null value in ConfigKey results in NPE on second start
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2e29c89b
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2e29c89b
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2e29c89b
Branch: refs/heads/ui-restyle
Commit: 2e29c89b841f6c00e30ea8fdc02510c2dbb41d39
Parents: 13e7a73
Author: Darren Shepherd <da...@gmail.com>
Authored: Mon Sep 30 08:54:02 2013 -0700
Committer: Darren Shepherd <da...@gmail.com>
Committed: Mon Sep 30 08:54:02 2013 -0700
----------------------------------------------------------------------
.../cloudstack/framework/config/impl/ConfigDepotImpl.java | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e29c89b/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
----------------------------------------------------------------------
diff --git a/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java b/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
index b516596..97430ef 100644
--- a/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
+++ b/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
@@ -25,13 +25,13 @@ import javax.annotation.PostConstruct;
import javax.inject.Inject;
import org.apache.log4j.Logger;
-
import org.apache.cloudstack.framework.config.ConfigDepot;
import org.apache.cloudstack.framework.config.ConfigDepotAdmin;
import org.apache.cloudstack.framework.config.ConfigKey;
import org.apache.cloudstack.framework.config.Configurable;
import org.apache.cloudstack.framework.config.ScopedConfigStorage;
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.commons.lang.ObjectUtils;
import com.cloud.utils.Pair;
import com.cloud.utils.component.SystemIntegrityChecker;
@@ -97,10 +97,8 @@ public class ConfigDepotImpl implements ConfigDepot, ConfigDepotAdmin, SystemInt
_configDao.persist(vo);
} else {
if (vo.isDynamic() != key.isDynamic() ||
- !vo.getDescription().equals(key.description()) ||
- ((vo.getDefaultValue() != null && key.defaultValue() == null) ||
- (vo.getDefaultValue() == null && key.defaultValue() != null) ||
- !vo.getDefaultValue().equals(key.defaultValue()))) {
+ !ObjectUtils.equals(vo.getDescription(), vo.getDescription()) ||
+ !ObjectUtils.equals(vo.getDefaultValue(), key.defaultValue())) {
vo.setDynamic(key.isDynamic());
vo.setDescription(key.description());
vo.setDefaultValue(key.defaultValue());