bosschaert commented on a change in pull request #8:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-extension-apiregions/pull/8#discussion_r454364120



##########
File path: 
src/main/java/org/apache/sling/feature/extension/apiregions/launcher/LauncherProperties.java
##########
@@ -101,18 +105,22 @@ public static Properties getBundleIDtoFeaturesMap(Feature 
app) {
     }
 
     public static Properties getFeatureIDtoRegionsMap(ApiRegions regions) {
-        Map<ArtifactId, Set<String>> map = new HashMap<>();
+        Map<ArtifactId, List<String>> map = new HashMap<>();
 
         for (ApiRegion region : regions.listRegions())
         {
             for (ArtifactId featureId : region.getFeatureOrigins()) {
                 map.compute(featureId, (id, regionNames) -> {
                     if (regionNames == null) {
-                        regionNames = new HashSet<>();
+                        regionNames = new LinkedList<>();
                     }
                     regionNames.add(region.getName());
+                    int insertionIndex = regionNames.size() - 1;
                     for (ApiRegion parent = region.getParent(); parent != 
null; parent = parent.getParent()) {
-                        regionNames.add(parent.getName());
+                        String parentName = parent.getName();
+                        if (!regionNames.contains(parentName)) {

Review comment:
       Hi @cziegeler this code iterates over multiple API Regions, which means 
that without the check the values on the `map` can have duplicates. It's easy 
to see that by removing the check, it will cause 2 test failures.
   Previously this was not needed because the values on the map were of type 
`Set`...




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to