kwin commented on a change in pull request #3:
URL: 
https://github.com/apache/sling-org-apache-sling-resourcemerger/pull/3#discussion_r581718459



##########
File path: 
src/main/java/org/apache/sling/resourcemerger/impl/MergingResourceProvider.java
##########
@@ -110,17 +110,14 @@ public ParentHidingHandler(final Resource parent, final 
boolean traverseParent)
                     final String[] ancestorChildrenToHideArray = 
ancestorProps.get(MergedResourceConstants.PN_HIDE_CHILDREN, String[].class);
                     if (ancestorChildrenToHideArray != null) {
                         for (final String value : ancestorChildrenToHideArray) 
{
-                            final boolean onlyUnderlying;
-                            if (value.equals("*")) {
-                                onlyUnderlying = true;
-                            } else {
-                                onlyUnderlying = false;
-                            }
+                            final boolean onlyUnderlying = value.equals("*");
                             final ExcludeEntry entry = new ExcludeEntry(value, 
onlyUnderlying);
                             // check if this entry is applicable at all 
(always assuming the worst case, i.e. non local resource)
                             final Boolean hides = hides(entry, 
previousAncestorName, false);
-                            if (hides != null && hides.booleanValue() == true) 
{
-                                this.entries.add(new ExcludeEntry("*", 
entry.onlyUnderlying));
+                            if (hides != null) {

Review comment:
       I am not sure TBH, although the documentation states 
   > E.g. giving the values [!child1,*] hides all children except for the one 
with the name child1
   
   I am wondering if that really makes sense, as then having multiple negated 
entries are not correctly considered, i.e. `[!child1,!child2,*]`. 
   What we need is probably an AND logic over all values for negated values and 
an OR logic over all values for non-negated values. It gets complicated when 
mixing both though...




----------------------------------------------------------------
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