Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-3321

Rotating virtual URI mapping does not return expected values

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 4.3.8
    • 4.3.7
    • core
    • None

    Description

      API doc for RotatingVirtualURIMapping says: "An extension of RegexpVirtualURIMapping that allows a rotation between different destination urls. In order to rotate toURI must contain the * that will be replaced by a random number between start (default is 1) and end (default is 3)."

      The code does not return random integers between start and end. It returns integers between one and "end minus start".

      int randomNumber = RandomUtils.nextInt(end - start) + 1;
      start end RandomUtils.nextInt(end - start) + 1
      0 3 1...3
      1 3 1...2
      1 4 1...3
      2 5 1...3
      3 7 1...4
      4 9 1...5

      Kindly revise the code to return integers between start and end. This is potentially quite useful.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              ochytil Ondrej Chytil
              ahietala Antti Hietala
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD