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

XWikiRightServiceImpl.listAllLevels uses an expensive method for producing the rights list.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0 RC1
    • Fix Version/s: 1.0 RC4
    • Component/s: {Unused} Core
    • Labels:
      None
    • keywords:
      performance, XWikiRightServiceImpl, listAllLevels, patch
    • Similar issues:

      Description

      XWikiRightServiceImpl.listAllLevels uses a costly method for producing a constant result.
      Indeed it splits a string and build the list of rights each time it is called.

      This could be improved by generating a static list once for all.

      See attached patch.

      btw,
      In the attached patch I have used a 1.4 compatible syntax but
      jdk 1.5 allows us the slightly more elegant construct:
      Arrays.asList("admin","view","edit","comment","delete","register","programming");

        Attachments

          Activity

            People

            Assignee:
            sdumitriu Sergiu Dumitriu
            Reporter:
            oliveira Pablo Oliveira
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response: