[YANGTOOLS-305] QName.cachedReference does not share underlying QNameModule Created: 10/Sep/14  Updated: 10/Apr/22  Resolved: 11/Sep/14

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 1793

 Description   

QNameModule was split off with the explicit intent to share namespace/revision objects. While this is possible when we incrementally create things, there are places, where we need to instantiate QNames from strings and use QName.create(String, String, String) method.

Furthermore there is a cachedReference() method, which is intended for sharing object references – this exists in both QName and QNameModule. Unfortunately this is not really useful for users of the mention method, as when they do:

QName barName = QName.cachedReference(QName.create("foo", null, "bar"));
QName bazName = QName.cachedReference(QName.create("foo", null, "baz"));

They end up with non-shared QNameModule("foo", null). Fix QName's cachedReference implementation to also use QNameModule's cache.



 Comments   
Comment by Robert Varga [ 10/Sep/14 ]

https://git.opendaylight.org/gerrit/11010

Generated at Wed Feb 07 20:52:50 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.