Bug 784970 - When creating an Address using a toString() of another address object, "None" is used as the subject when it should be Null
Summary: When creating an Address using a toString() of another address object, "None"...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-java
Version: Development
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: 2.1.2
: ---
Assignee: Rajith Attapattu
QA Contact: MRG Quality Engineering
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-26 19:43 UTC by Rajith Attapattu
Modified: 2012-12-07 17:45 UTC (History)
3 users (show)

Fixed In Version: qpid-jca-0.14-6
Doc Type: Bug Fix
Doc Text:
Cause: 'None' is used instead of an empty subject for the toString() output of an addres. Consequence: If the toString() is used to create another address, the new address will interpret 'None' as the subject. Fix: The code will treat 'None' as empty when creating an address from a string. Result: You could now create an address correctly using the toString() of another address.
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)

Description Rajith Attapattu 2012-01-26 19:43:56 UTC
Description of problem:

This issue was identified due to a TCK failure.
When the TCK was comparing the toString() of the original destination to the one it used in a QueueBrowser, the test failed. Upon closer inspection a subtle change was noted.

Original destination toString()
'MY_QUEUE'/None; {
  'create': 'always'
} 

The destination created by using the toString()
'MY_QUEUE'/'None'; {
  'create': 'always'
}

Notice the None is quoted in the second string. The code prints None in place of a Null subject to make an address string more readable. Therefore if a new destination is created from a toString() of a destination, the code needs to identify the 'None' in the subject field as null.

Version-Release number of selected component (if applicable):
All release java rpms which supports addressing

How reproducible:
Always

Steps to Reproduce:
Address addr = Address.parse("MY_QUEUE; {create : always}");
System.out.println("Addr1 : " + addr);
		
Address addr2 = Address.parse(addr.toString());
System.out.println("Addr2 : " + addr2);
  
Actual results:
'MY_QUEUE'/'None'; {
  'create': 'always'
}

Expected results:
'MY_QUEUE'/None; {
  'create': 'always'
}

Additional info:
Note the missing quotes around "None" in the expected results when comparing with actual results.

Comment 1 Rajith Attapattu 2012-01-26 19:46:26 UTC
This is covered in upstream via QPID-3783
A fix has been committed at http://svn.apache.org/viewvc?view=rev&rev=1236196

Comment 2 Jiri Pechanec 2012-02-24 07:42:11 UTC
Verified in 0.14-8

Comment 3 Rajith Attapattu 2012-03-12 15:23:28 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: 'None' is used instead of an empty subject for the toString() output of an addres.

Consequence:  If the toString() is used to create another address, the new address will interpret 'None' as the subject.

Fix:  The code will treat 'None' as empty when creating an address from a string.

Result: You could now create an address correctly using the toString() of another address.


Note You need to log in before you can comment on or make changes to this bug.