cziegeler commented on a change in pull request #8:
URL:
https://github.com/apache/sling-org-apache-sling-feature-extension-apiregions/pull/8#discussion_r454458107
##########
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:
I didn't realize the outer loop, so yes, makes sense
----------------------------------------------------------------
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]