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

runmode.mapping file does not contain all needed values

    XMLWordPrintableJSON

Details

    Description

      In some cases the runmode.mapping file generated by the cpconverter does not contain all the required file (feature model) references.
      This can happen when certain filenames that need to be referenced are a substring of other file names.

      It centers around this code: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/blob/master/src/main/java/org/apache/sling/feature/cpconverter/features/RunmodeMapper.java#L63-L67

      Assume that properties contains an entry (default)=>my-webapp-all.json. Then next a feature file named all.json is processed. As the name of it is a substring of the pre-existing value it will not append. In fact it will replace the previous value with the new value and as such remove it.

      The logic there should be fixed to not use substrings, but rather compare entire names. Possibly a better idea would be to keep a Set<String> internally and convert that to a comma-separated list only once the Properties are persisted in the save(() call.

      Attachments

        Activity

          People

            cziegeler Carsten Ziegeler
            davidb A. J. David Bosschaert
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: