Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-4164

Order of children is not preserved for SyntheticResource.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Resource Resolver 1.1.6
    • Resource Resolver 1.1.10
    • ResourceResolver
    • None
    • AEM 6.0

    Description

      When Resource.listChildren() is called on a SyntheticResource the order of children returned by the iterator doesn't match the order of children returned by the ResourceProvider which is the origin of the SyntheticResource. At some point between Resource.listChildren() and ResourceProvider.listChildren() the children get shuffled.

      An investigation in Sling resource resolver project revealed that a possible cause of the issue is in org.apache.sling.resourceresolver.impl.helper.ResourceIterator.seek() where SyntheticResource objects are stored in a delayed Map before getting returned. For this map a HashMap is used which doesn't preserve the insertion order of its entries. Using LinkedHashMap for the delayed Map might be the solution for this.

      Attachments

        1. SLING-4164.patch
          1 kB
          Levente Santha

        Activity

          People

            cziegeler Carsten Ziegeler
            lsantha Levente Santha
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: