diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2010-06-25 20:22:43 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2010-06-25 20:22:43 +0000 |
| commit | cea2762f31747d337e8ccd06a8bfdcf0be9bccc7 (patch) | |
| tree | 2301f6b686d6b87096b10a8e0ac362abd41e2482 /java/client/src | |
| parent | 7a3e2ae5fcd83bcbd46563485029334814199748 (diff) | |
| download | qpid-python-cea2762f31747d337e8ccd06a8bfdcf0be9bccc7.tar.gz | |
Added null checks in fillInCommonNodeArgs() and when trying to parse capacities in getLink()
Also fixed an error when parsing the qpid queue policy type.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@958102 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/src')
| -rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java b/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java index dc7aca7d3e..50757931aa 100644 --- a/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java +++ b/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java @@ -129,7 +129,7 @@ public class AddressHelper options.setMaxSize(args.getInt(QpidQueueOptions.QPID_MAX_SIZE)); } - if (args.getInt(QpidQueueOptions.QPID_POLICY_TYPE) != null) + if (args.getString(QpidQueueOptions.QPID_POLICY_TYPE) != null) { options.setPolicyType(args.getString(QpidQueueOptions.QPID_POLICY_TYPE)); } @@ -278,7 +278,10 @@ public class AddressHelper private void fillInCommonNodeArgs(Node node,Map parent,MapAccessor argsMap) { - node.setDurable(nodeProps.getBoolean(DURABLE) == null? false : nodeProps.getBoolean(DURABLE)); + if (nodeProps != null) + { + node.setDurable(nodeProps.getBoolean(DURABLE) == null? false : nodeProps.getBoolean(DURABLE)); + } node.setAutoDelete(argsMap.getBoolean(AUTO_DELETE) == null? false : argsMap.getBoolean(AUTO_DELETE)); node.setAlternateExchange(argsMap.getString(ALT_EXCHANGE)); node.setBindings(getBindings(parent)); @@ -318,13 +321,16 @@ public class AddressHelper { MapAccessor capacityProps = new MapAccessor( (Map)((Map)address.getOptions().get(LINK)).get(CAPACITY)); - link.setConsumerCapacity(capacityProps.getInt(CAPACITY_SOURCE)); - link.setProducerCapacity(capacityProps.getInt(CAPACITY_TARGET)); + link.setConsumerCapacity(capacityProps.getInt(CAPACITY_SOURCE) == null ? + 0 : capacityProps.getInt(CAPACITY_SOURCE)); + link.setProducerCapacity(capacityProps.getInt(CAPACITY_TARGET) == null ? + 0 : capacityProps.getInt(CAPACITY_TARGET)); } else { - link.setConsumerCapacity(linkProps.getInt(CAPACITY)); - link.setProducerCapacity(linkProps.getInt(CAPACITY)); + int cap = linkProps.getInt(CAPACITY) == null ? 0 : linkProps.getInt(CAPACITY); + link.setConsumerCapacity(cap); + link.setProducerCapacity(cap); } link.setFilter(linkProps.getString(FILTER)); // so far filter type not used |
