This is an automated email from the ASF dual-hosted git repository.

pauls pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-extension-apiregions.git


The following commit(s) were added to refs/heads/master by this push:
     new f534285  SLING-8970 - adding test & fixing logic to consider inherited 
exports in region checks
f534285 is described below

commit f534285f369d7e46492af2e05a5aa39d0efd43f7
Author: Karl Pauls <[email protected]>
AuthorDate: Mon Jan 20 23:41:20 2020 +0100

    SLING-8970 - adding test & fixing logic to consider inherited exports in 
region checks
---
 .../analyser/CheckApiRegionsBundleExportsImports.java      | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/feature/extension/apiregions/analyser/CheckApiRegionsBundleExportsImports.java
 
b/src/main/java/org/apache/sling/feature/extension/apiregions/analyser/CheckApiRegionsBundleExportsImports.java
index c25c5a6..e3ca7cb 100644
--- 
a/src/main/java/org/apache/sling/feature/extension/apiregions/analyser/CheckApiRegionsBundleExportsImports.java
+++ 
b/src/main/java/org/apache/sling/feature/extension/apiregions/analyser/CheckApiRegionsBundleExportsImports.java
@@ -209,12 +209,20 @@ public class CheckApiRegionsBundleExportsImports 
implements AnalyserTask {
 
                                     // Record the exporting and importing 
regions for diagnostics
                                     exportingRegions.addAll(exRegions);
-                                    importingRegions.addAll(imRegions);
+
+                                    Set<String> regions = new HashSet<>();
+                                    for (String region : imRegions) {
+                                        for (ApiRegion r = 
apiRegions.getRegionByName(region); r != null; r = r.getParent()) {
+                                            regions.add(r.getName());
+                                        }
+                                    }
+
+                                    importingRegions.addAll(regions);
 
                                     // Only keep the regions that also export 
the package
-                                    imRegions.retainAll(exRegions);
+                                    regions.retainAll(exRegions);
 
-                                    if (!imRegions.isEmpty()) {
+                                    if (!regions.isEmpty()) {
                                         // there is an overlapping region
                                         matchingCandidates.add(bd);
                                     }

Reply via email to