rajith77 / qpid

Mirror of Apache Qpid
0 stars 0 forks source link

using "node:" in address string raises NPE #2

Open pmoravec opened 11 years ago

pmoravec commented 11 years ago

Just run code:

session.createQueue("MyQueue; {create:always, delete:always, node:{type:queue}}");

to get:

java.lang.NullPointerException at org.apache.qpid.address.AddressHelper.getNode(AddressHelper.java:222) at org.apache.qpid.address.DestSyntax.parseAddressString(DestSyntax.java:100) at org.apache.qpid.address.DestSyntax$2.parseAddress(DestSyntax.java:42) at org.apache.qpid.address.Address.parse(Address.java:75) at org.apache.qpid.amqp_0_10.jms.impl.DestinationImpl.(DestinationImpl.java:38) at org.apache.qpid.amqp_0_10.jms.impl.QueueImpl.(QueueImpl.java:33) at org.apache.qpid.amqp_0_10.jms.impl.SessionImpl.createQueue(SessionImpl.java:742)

This has trivial patch:

diff -r qpid-trunk-orig/qpid/java/amqp-0-10-client-jms/src/main/java/org/apache/qpid/address/AddressHelper.java qpid-trunk/qpid/java/amqp-0-10-client-jms/src/main/java/org/apache/qpid/address/AddressHelper.java 232c232

< (Map<String,Object>)xDeclareMap.get(ARGUMENTS),

                        (xDeclareMap==null) ? null : (Map<String,Object>)xDeclareMap.get(ARGUMENTS),