You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2014/03/20 14:03:21 UTC

git commit: stub sends null even if back-end sends empty array, hence removing null check and let pojoPopulator send an empty list if it is null

Repository: incubator-stratos
Updated Branches:
  refs/heads/master ed3bf7e00 -> e99851c45


stub sends null even if back-end sends empty array, hence removing null check and let pojoPopulator send an empty list if it is null


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

Branch: refs/heads/master
Commit: e99851c45ac80efa4813a68e4069d58be988d490
Parents: ed3bf7e
Author: Nirmal Fernando <ni...@apache.org>
Authored: Thu Mar 20 18:32:41 2014 +0530
Committer: Nirmal Fernando <ni...@apache.org>
Committed: Thu Mar 20 18:32:41 2014 +0530

----------------------------------------------------------------------
 .../rest/endpoint/services/ServiceUtils.java        | 16 ----------------
 1 file changed, 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/e99851c4/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
index 34f39e4..82e1e8e 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
@@ -369,11 +369,6 @@ public class ServiceUtils {
         if (autoscalerServiceClient != null) {
             try {
                 autoscalePolicies = autoscalerServiceClient.getAutoScalePolicies();
-                if(autoscalePolicies == null || autoscalePolicies.length == 0) {
-                    String errorMsg = "Cannot find any auto-scaling policy.";
-                    log.error(errorMsg);
-                    throw new RestAPIException(errorMsg);
-                }
 
             } catch (RemoteException e) {
                 String errorMsg = "Error while getting available autoscaling policies. Cause : " + e.getMessage();
@@ -400,12 +395,6 @@ public class ServiceUtils {
             }
         }
 
-        if(autoscalePolicy == null) {
-        	String errorMsg = "Cannot find a matching auto-scaling policy for [id] "+autoscalePolicyId;
-            log.error(errorMsg);
-            throw new RestAPIException(errorMsg);
-        }
-        
         return PojoConverter.populateAutoscalePojo(autoscalePolicy);
     }
 
@@ -417,11 +406,6 @@ public class ServiceUtils {
         if (autoscalerServiceClient != null) {
             try {
                 deploymentPolicies = autoscalerServiceClient.getDeploymentPolicies();
-                if(deploymentPolicies == null || deploymentPolicies.length == 0) {
-                    String errorMsg = "Cannot find any deployment policy.";
-                    log.error(errorMsg);
-                    throw new RestAPIException(errorMsg);
-                }
             } catch (RemoteException e) {
                 String errorMsg = "Error getting available deployment policies. Cause : " + e.getMessage();
                 log.error(errorMsg, e);