diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2011-12-21 01:44:11 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2011-12-21 01:44:11 +0000 |
commit | cc71e037752ec4c36c2b02172a5720d2719f79b8 (patch) | |
tree | 86c5a8251bbd21980647baeac5db5379846bd5ed /java/client | |
parent | bfe76b026d5daf5a8c1a9fecf0144c30eecd91ac (diff) | |
download | qpid-python-cc71e037752ec4c36c2b02172a5720d2719f79b8.tar.gz |
QPID-3659 The previous if statement for processing boolean props looks a bit convoluted. Changed it to a more simple and easily readable statement.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1221557 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client')
-rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java b/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java index d6589bacdf..b343820d80 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java @@ -271,14 +271,18 @@ public class AMQBrokerDetails implements BrokerDetails { if (_options.containsKey(propName)) { - if (defaultValue) - { - return !_options.get(propName).equalsIgnoreCase("false"); - } - else - { - return Boolean.parseBoolean(_options.get(propName)); - } + if (_options.get(propName).equalsIgnoreCase("false")) + { + return false; + } + else if (_options.get(propName).equalsIgnoreCase("true")) + { + return true; + } + else + { + return defaultValue; + } } else { |