summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2010-06-25 20:22:43 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2010-06-25 20:22:43 +0000
commitb23cfd52bc61710d1feb8125d17bf17a585bd990 (patch)
treee77755e709a9f573cc630e25a4124f376c93e8d7 /qpid/java
parente5c7264eebe042ee3ab62eb350c43ae8ae137aa7 (diff)
downloadqpid-python-b23cfd52bc61710d1feb8125d17bf17a585bd990.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@958102 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java b/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java
index dc7aca7d3e..50757931aa 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java
+++ b/qpid/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