Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Content-Package to Feature Model Converter 1.1.6
-
None
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.