You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ga...@apache.org on 2015/01/13 11:17:22 UTC

stratos git commit: Fixing the string comparison. Trim the string before comparing

Repository: stratos
Updated Branches:
  refs/heads/master 637e44a6d -> ebe197ff3


Fixing the string comparison. Trim the string before comparing


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

Branch: refs/heads/master
Commit: ebe197ff3ee3a09b7576d80c62d66c20983b3b86
Parents: 637e44a
Author: gayan <ga...@puppet.gayan.org>
Authored: Tue Jan 13 15:38:39 2015 +0530
Committer: gayan <ga...@puppet.gayan.org>
Committed: Tue Jan 13 15:39:23 2015 +0530

----------------------------------------------------------------------
 .../autoscaler/applications/dependency/DependencyBuilder.java    | 4 ++--
 .../dependency/context/ApplicationChildContextFactory.java       | 4 ++--
 samples/group-scaling/mock/artifacts/group1.json                 | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/ebe197ff/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java
index 241c840..f577339 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java
@@ -180,10 +180,10 @@ public class DependencyBuilder {
             for (ScalingDependentList dependentList : component.getDependencyOrder().getScalingDependents()) {
                 List<String> scalingDependencies = new ArrayList<String>();
                 for (String string : dependentList.getScalingDependentListComponents()) {
-                    if (string.startsWith(Constants.GROUP + ".")) {
+                    if (string.trim().startsWith(Constants.GROUP + ".")) {
                         //getting the group alias
                         scalingDependencies.add(getGroupFromStartupOrder(string));
-                    } else if (string.startsWith(Constants.CARTRIDGE + ".")) {
+                    } else if (string.trim().startsWith(Constants.CARTRIDGE + ".")) {
                         //getting the cluster alias
                         String id = getClusterFromStartupOrder(string);
                         //getting the cluster-id from cluster alias

http://git-wip-us.apache.org/repos/asf/stratos/blob/ebe197ff/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/context/ApplicationChildContextFactory.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/context/ApplicationChildContextFactory.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/context/ApplicationChildContextFactory.java
index fc5caac..bb535f7 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/context/ApplicationChildContextFactory.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/context/ApplicationChildContextFactory.java
@@ -45,11 +45,11 @@ public class ApplicationChildContextFactory {
         String id;
         ApplicationChildContext applicationContext = null;
         boolean hasDependents = tree.isTerminateDependent() || tree.isTerminateAll();
-        if (order.startsWith(Constants.GROUP + ".")) {
+        if (order.trim().startsWith(Constants.GROUP + ".")) {
             //getting the group alias
             id = getGroupFromStartupOrder(order);
             applicationContext = getGroupChildContext(id, hasDependents);
-        } else if (order.startsWith(Constants.CARTRIDGE + ".")) {
+        } else if (order.trim().startsWith(Constants.CARTRIDGE + ".")) {
             //getting the cartridge type
             id = getClusterFromStartupOrder(order);
             //getting the cluster-id from cluster alias

http://git-wip-us.apache.org/repos/asf/stratos/blob/ebe197ff/samples/group-scaling/mock/artifacts/group1.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling/mock/artifacts/group1.json b/samples/group-scaling/mock/artifacts/group1.json
index 31a9dcd..c5681cf 100644
--- a/samples/group-scaling/mock/artifacts/group1.json
+++ b/samples/group-scaling/mock/artifacts/group1.json
@@ -24,7 +24,7 @@
     ],
     "dependencies": {
         "startupOrders": [
-            "cartridge.c1, group.group2"
+            "cartridge.c1,group.group2"
         ],
         "scalingDependants": [
             "cartridge.c1, group.group2"