You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2020/07/13 10:55:15 UTC
[GitHub] [sling-org-apache-sling-feature-extension-apiregions] cziegeler commented on a change in pull request #8: SLING-9521 Packages exported in earlier API Regions are not available to later API Regions
cziegeler commented on a change in pull request #8:
URL: https://github.com/apache/sling-org-apache-sling-feature-extension-apiregions/pull/8#discussion_r453566560
##########
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:
This check is not needed - the ApiRegions api ensures that the name of a region is unique
----------------------------------------------------------------
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:
users@infra.apache.org