Fixing null check condition in CloudControllerUtil.toJavaUtilProperties() method
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/b6cbba29 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/b6cbba29 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/b6cbba29 Branch: refs/heads/master Commit: b6cbba29a9295976dcb897d70ccd999de5b54e7a Parents: 0497e4c Author: Imesh Gunaratne <[email protected]> Authored: Sat Nov 8 21:08:02 2014 +0530 Committer: Imesh Gunaratne <[email protected]> Committed: Sat Nov 8 21:08:02 2014 +0530 ---------------------------------------------------------------------- .../stratos/cloud/controller/util/CloudControllerUtil.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/b6cbba29/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java index 11d432b..ef37078 100644 --- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java +++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java @@ -336,19 +336,19 @@ public class CloudControllerUtil { */ public static Properties toJavaUtilProperties( org.apache.stratos.common.Properties properties) { - Properties javaProps = new Properties(); + Properties javaUtilsProperties = new Properties(); if (properties != null && properties.getProperties() != null) { for (Property property : properties.getProperties()) { - if(property.getValue() != null){ - javaProps.put(property.getName(), property.getValue()); + if((property != null) && (property.getValue() != null)) { + javaUtilsProperties.put(property.getName(), property.getValue()); } } } - return javaProps; + return javaUtilsProperties; } public static void persistTopology(Topology topology) {
