|
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.
|