stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lahi...@apache.org
Subject [2/2] stratos git commit: Changing if conditions to check the availability of network partiton filter correctly
Date Wed, 03 Jun 2015 12:40:45 GMT
Changing if conditions to check the availability of network partiton filter correctly


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

Branch: refs/heads/master
Commit: 2c4ec32ab4a77d54e8e8379bcd040d50c33cfd20
Parents: b95bb0a
Author: Lahiru Sandaruwan <lahirus@apache.org>
Authored: Wed Jun 3 18:10:33 2015 +0530
Committer: Lahiru Sandaruwan <lahirus@apache.org>
Committed: Wed Jun 3 18:10:33 2015 +0530

----------------------------------------------------------------------
 .../LoadBalancerCommonTopologyEventReceiver.java        | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/2c4ec32a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
index 3b53da3..ba38967 100644
--- a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
+++ b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
@@ -74,10 +74,8 @@ public class LoadBalancerCommonTopologyEventReceiver extends TopologyEventReceiv
 
                             String networkPartitionIdFilter = System.getProperty(
                                     StratosConstants.TOPOLOGY_NETWORK_PARTITION_FILTER);
-                            if (networkPartitionIdFilter != null) {
-                                networkPartitionIdFilter = networkPartitionIdFilter.trim();
-                            }
-                            if (!networkPartitionIdFilter.equals("")) {
+
+                            if (networkPartitionIdFilter != null && !networkPartitionIdFilter.equals(""))
{
                                 if (member.getNetworkPartitionId().equals(networkPartitionIdFilter))
{
                                     addMember(serviceName, clusterId, memberId);
                                     membersFound = true;
@@ -129,10 +127,8 @@ public class LoadBalancerCommonTopologyEventReceiver extends TopologyEventReceiv
                     TopologyManager.acquireReadLockForCluster(serviceName, clusterId);
                     String networkPartitionIdFilter = System.getProperty(
                             StratosConstants.TOPOLOGY_NETWORK_PARTITION_FILTER);
-                    if (networkPartitionIdFilter != null) {
-                        networkPartitionIdFilter = networkPartitionIdFilter.trim();
-                    }
-                    if (!networkPartitionIdFilter.equals("")) {
+
+                    if (networkPartitionIdFilter != null && !networkPartitionIdFilter.equals(""))
{
                         if (memberActivatedEvent.getNetworkPartitionId().equals(networkPartitionIdFilter))
{
                             addMember(serviceName, clusterId, memberId);
                         }


Mime
View raw message