Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-305

QName.cachedReference does not share underlying QNameModule

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

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

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: