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

Calling PropertyClass#setNumber might have unattended side effects

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 17.7.0
    • Old Core
    • None
    • Unknown

    Description

      It might be tempting to call com.xpn.xwiki.objects.classes.PropertyClass#setNumber to reorder properties in a class, but this is likely to create inconsistencies as the fields are stored in a LinkedHashMap which is not reordered when calling this method.
      What's more, nothing prevents someone from calling setNumber with the same number for several properties in a class.

      This method should probably be updated to allow this usage, or a new api to reorder fields should probably be introduced.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rjakse Raphaƫl Jakse
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: