Simplyfied isPublisherEnabled() logic
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f3a809b7 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f3a809b7 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f3a809b7 Branch: refs/heads/stratos-4.1.x Commit: f3a809b768cb4275e30d0223b2cd5c374a76f02e Parents: 65aee8a Author: Thanuja <[email protected]> Authored: Mon Nov 23 12:31:03 2015 +0530 Committer: Thanuja <[email protected]> Committed: Mon Nov 23 12:31:03 2015 +0530 ---------------------------------------------------------------------- .../statistics/publisher/ThriftStatisticsPublisher.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/f3a809b7/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java index 16dba16..4552f92 100644 --- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java +++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java @@ -63,14 +63,12 @@ public class ThriftStatisticsPublisher implements StatisticsPublisher { } private boolean isPublisherEnabled() { - boolean publisherEnabled = false; for (ThriftClientInfo thriftClientInfo : thriftClientInfoList) { - publisherEnabled = thriftClientInfo.isStatsPublisherEnabled(); - if (publisherEnabled) { - break; + if (thriftClientInfo.isStatsPublisherEnabled()) { + return true; } } - return publisherEnabled; + return false; } private void init() {
