[jira] [Commented] (QPID-3769) NPE in client AMQDestination.equals()

2013-04-01 Thread Rajith Attapattu (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-3769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13618814#comment-13618814
 ] 

Rajith Attapattu commented on QPID-3769:


Adjusted the hashcode and equals impl for AMQTopic to take the new 
implementation (in AMQDestination) into account while preserving the old BURL 
based logic.  Addressed concerns regarding the tests.
http://svn.apache.org/r1463158

 NPE in client AMQDestination.equals()
 -

 Key: QPID-3769
 URL: https://issues.apache.org/jira/browse/QPID-3769
 Project: Qpid
  Issue Type: Bug
  Components: Java Client
Affects Versions: 0.12
Reporter: Jan Bareš
Assignee: Rajith Attapattu
  Labels: addressing

 Code of org.apache.qpid.client.AMQDestination.equals(Object) is buggy, it 
 should test for null on _exchangeClass and _exchangeName before dereferencing 
 them, lines 522 and 526.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (QPID-3769) NPE in client AMQDestination.equals()

2013-04-01 Thread Justin Ross (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-3769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13618822#comment-13618822
 ] 

Justin Ross commented on QPID-3769:
---

Reviewed by Robbie.  Approved for 0.22.

 NPE in client AMQDestination.equals()
 -

 Key: QPID-3769
 URL: https://issues.apache.org/jira/browse/QPID-3769
 Project: Qpid
  Issue Type: Bug
  Components: Java Client
Affects Versions: 0.12
Reporter: Jan Bareš
Assignee: Rajith Attapattu
  Labels: addressing

 Code of org.apache.qpid.client.AMQDestination.equals(Object) is buggy, it 
 should test for null on _exchangeClass and _exchangeName before dereferencing 
 them, lines 522 and 526.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (QPID-3769) NPE in client AMQDestination.equals()

2013-04-01 Thread Rajith Attapattu (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-3769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13618955#comment-13618955
 ] 

Rajith Attapattu commented on QPID-3769:


Ported the relevant changes to 0.22 branch.
http://svn.apache.org/r1463215
http://svn.apache.org/r1463216
http://svn.apache.org/r1463217

 NPE in client AMQDestination.equals()
 -

 Key: QPID-3769
 URL: https://issues.apache.org/jira/browse/QPID-3769
 Project: Qpid
  Issue Type: Bug
  Components: Java Client
Affects Versions: 0.12
Reporter: Jan Bareš
Assignee: Rajith Attapattu
  Labels: addressing
 Fix For: 0.22


 Code of org.apache.qpid.client.AMQDestination.equals(Object) is buggy, it 
 should test for null on _exchangeClass and _exchangeName before dereferencing 
 them, lines 522 and 526.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (QPID-3769) NPE in client AMQDestination.equals()

2013-03-27 Thread Rajith Attapattu (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-3769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13615424#comment-13615424
 ] 

Rajith Attapattu commented on QPID-3769:


I was going to request a port, but I should have kept this open until then.

I also agree on the comments about the tests for this.


 NPE in client AMQDestination.equals()
 -

 Key: QPID-3769
 URL: https://issues.apache.org/jira/browse/QPID-3769
 Project: Qpid
  Issue Type: Bug
  Components: Java Client
Affects Versions: 0.12
Reporter: Jan Bareš
Assignee: Rajith Attapattu
  Labels: addressing

 Code of org.apache.qpid.client.AMQDestination.equals(Object) is buggy, it 
 should test for null on _exchangeClass and _exchangeName before dereferencing 
 them, lines 522 and 526.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (QPID-3769) NPE in client AMQDestination.equals()

2013-03-18 Thread Rajith Attapattu (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-3769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13605172#comment-13605172
 ] 

Rajith Attapattu commented on QPID-3769:


I discussed this with Rafi a fair bit before arriving at a solution.

I don't think comparing the subject is the right approach for every situation.
Comparing the subjects might make sense for Topics, but not for Queues. Also at 
the time equals is called we may not know the 'type'. We could look at the 
resolved property to determine this. Otherwise what are we going to do ?

What should we do for exchanges with more complicated routing algorithms like 
Headers or XML exchange where the subject is not a factor at all ? It gets 
complicated real soon when you look beyond the simple cases.

If you look at it from a high level pov, we send messages to either a Queue or 
an Exchange. They are the destinations. So one could argue that if you are 
sending to the same  exchange then you are sending to the same destination. I 
think that has a stronger argument that than what you are suggesting.

How messages are matched onto queues is a function of the exchange. And it's 
something that we should not try to factor into our equals implementation.
 

 NPE in client AMQDestination.equals()
 -

 Key: QPID-3769
 URL: https://issues.apache.org/jira/browse/QPID-3769
 Project: Qpid
  Issue Type: Bug
  Components: Java Client
Affects Versions: 0.12
Reporter: Jan Bareš
Assignee: Rajith Attapattu
  Labels: addressing

 Code of org.apache.qpid.client.AMQDestination.equals(Object) is buggy, it 
 should test for null on _exchangeClass and _exchangeName before dereferencing 
 them, lines 522 and 526.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (QPID-3769) NPE in client AMQDestination.equals()

2013-03-18 Thread Rajith Attapattu (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-3769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13605174#comment-13605174
 ] 

Rajith Attapattu commented on QPID-3769:


Alex I will fix the test cases by using the right class and will prefix with 
BURL for the destination that uses that syntax.

 NPE in client AMQDestination.equals()
 -

 Key: QPID-3769
 URL: https://issues.apache.org/jira/browse/QPID-3769
 Project: Qpid
  Issue Type: Bug
  Components: Java Client
Affects Versions: 0.12
Reporter: Jan Bareš
Assignee: Rajith Attapattu
  Labels: addressing

 Code of org.apache.qpid.client.AMQDestination.equals(Object) is buggy, it 
 should test for null on _exchangeClass and _exchangeName before dereferencing 
 them, lines 522 and 526.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (QPID-3769) NPE in client AMQDestination.equals()

2013-03-13 Thread Alex Rudyy (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-3769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13601411#comment-13601411
 ] 

Alex Rudyy commented on QPID-3769:
--

Hi Rajith,

I believe that topic address based destination should also compare the subject.
For instance the following test fails because really different destinations are 
considered to be the same:

{code:java}
public void testEqualsForTopicDestinationsWithDifferentSubjects() throws 
Exception
{
AMQDestination dest1 = new AMQAnyDestination(ADDR:Foo/subjectOne; 
{node :{type:topic}});
AMQDestination dest2 = new AMQAnyDestination(ADDR:Foo/subjectTwo; 
{node :{type:topic}});

assertFalse(Destination with different subjects cannot be equal, 
dest1.equals(dest2));
}
{code}

Also, I would like to point out that 
AMQDestinationTest#testEqaulsAndHashCodeForAddressBasedDestinations fails if it 
is ran from Eclipse because the client defaults to address based syntax and 
parsing of binding URL as address fails. I would like to suggest to prefix the 
binding destination URL in test with BURL prefix:

BURL:direct://amq.direct/test-route/Foo?routingkey='Foo'

I also noticed that both topic and queue destinations in your test are created 
using AMQQueue class. Should it possibly use AMQTopic or AMQAnyDestination?


 NPE in client AMQDestination.equals()
 -

 Key: QPID-3769
 URL: https://issues.apache.org/jira/browse/QPID-3769
 Project: Qpid
  Issue Type: Bug
  Components: Java Client
Affects Versions: 0.12
Reporter: Jan Bareš
Assignee: Rajith Attapattu
  Labels: addressing

 Code of org.apache.qpid.client.AMQDestination.equals(Object) is buggy, it 
 should test for null on _exchangeClass and _exchangeName before dereferencing 
 them, lines 522 and 526.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (QPID-3769) NPE in client AMQDestination.equals()

2013-03-11 Thread Rajith Attapattu (JIRA)

[ 
https://issues.apache.org/jira/browse/QPID-3769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13599289#comment-13599289
 ] 

Rajith Attapattu commented on QPID-3769:


There are two options for implementing the equals method (and hashcode).

1. Check the type and name to ensure they both point to the same 
destination (which could be a queue or an exchange in pre 1.0 terms).

2. Do a comprehensive check on the internal address data structure to ensure 
that all fields, properties, options are the same.

(Please note that comparing two address strings is not a good idea as there can 
whitespaces).

I prefer option one and have attached a patch for that.
What do others think?

{code}
 final AMQDestination that = (AMQDestination) o;
 
-if (!_exchangeClass.equals(that._exchangeClass))
+if (_destSyntax != that.getDestSyntax())
 {
 return false;
 }
-if (!_exchangeName.equals(that._exchangeName))
+
+if (_destSyntax == DestSyntax.ADDR)
 {
-return false;
+if (_addressType != that.getAddressType())
+{
+return false;
+}
+if (!_name.equals(that.getAddressName()))
+{
+return false;
+}
 }
-if ((_queueName == null  that._queueName != null) ||
-(_queueName != null  !_queueName.equals(that._queueName)))
+else
 {
-return false;
+if (!_exchangeClass.equals(that._exchangeClass))
+{
+return false;
+}
+if (!_exchangeName.equals(that._exchangeName))
+{
+return false;
+}
+if ((_queueName == null  that._queueName != null) ||
+(_queueName != null  !_queueName.equals(that._queueName)))
+{
+return false;
+}
 }
-
 return true;
 }
 
{code}

 NPE in client AMQDestination.equals()
 -

 Key: QPID-3769
 URL: https://issues.apache.org/jira/browse/QPID-3769
 Project: Qpid
  Issue Type: Bug
  Components: Java Client
Affects Versions: 0.12
Reporter: Jan Bareš
  Labels: addressing

 Code of org.apache.qpid.client.AMQDestination.equals(Object) is buggy, it 
 should test for null on _exchangeClass and _exchangeName before dereferencing 
 them, lines 522 and 526.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org