You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2014/12/05 05:05:09 UTC

stratos git commit: avoiding an NPE risk in VMClusterContext

Repository: stratos
Updated Branches:
  refs/heads/master 22315f65e -> 3405862ec


avoiding an NPE risk in VMClusterContext


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/3405862e
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/3405862e
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/3405862e

Branch: refs/heads/master
Commit: 3405862ece56a3f2fdb8749a8094999f0a976f69
Parents: 22315f6
Author: R-Rajkumar <rr...@gmail.com>
Authored: Fri Dec 5 09:34:16 2014 +0530
Committer: R-Rajkumar <rr...@gmail.com>
Committed: Fri Dec 5 09:34:16 2014 +0530

----------------------------------------------------------------------
 .../autoscaler/context/cluster/VMClusterContext.java        | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/3405862e/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/VMClusterContext.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/VMClusterContext.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/VMClusterContext.java
index 42639bd..2f83178 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/VMClusterContext.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/VMClusterContext.java
@@ -172,15 +172,16 @@ public class VMClusterContext extends AbstractClusterContext {
             ChildPolicy childPolicy,
             ClusterLevelNetworkPartitionContext clusterLevelNetworkPartitionContext)
             throws PolicyValidationException, PartitionValidationException {
-        if (log.isDebugEnabled()) {
-            log.debug("Deployment policy name: " + childPolicy.getId());
-        }
 
         if (childPolicy == null) {
-            String msg = "Deployment policy is null: [policy-name] " + childPolicy.getId();
+            String msg = "Deployment policy is null";
             log.error(msg);
             throw new PolicyValidationException(msg);
         }
+        
+        if (log.isDebugEnabled()) {
+            log.debug("Deployment policy name: " + childPolicy.getId());
+        }
 
         ChildLevelPartition[] childLevelPartitions = childPolicy.
                 getChildLevelNetworkPartition(