Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-14007

BaseObject should generate unique id only when needed

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.4.4
    • Fix Version/s: 9.1-rc-1, 8.4.5
    • Component/s: Old Core
    • Labels:
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      Right now BaseObject#guid get initialized in BaseObject constructor no matter what. That means that everytime you load an object from the database the guid is initialized and then overwritten with the one from the database...

      UUID.randomUUID() being quite expensive sometimes it would be better to generate the guid only in getGuid() if it's null.

        Attachments

          Activity

            People

            • Assignee:
              tmortagne Thomas Mortagne
              Reporter:
              tmortagne Thomas Mortagne
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: