diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/IncludeExcludeSet.java b/jetty-util/src/main/java/org/eclipse/jetty/util/IncludeExcludeSet.java index d47ca4bc9cb..4f83b35e57d 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/IncludeExcludeSet.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/IncludeExcludeSet.java @@ -223,11 +223,10 @@ public class IncludeExcludeSet implements Predicate

return _includes.isEmpty() && _excludes.isEmpty(); } - /** - * Combine the results of two {@link IncludeExcludeSet}s with an "and" operation. The items must be - * included by xSet AND ySet, and excluded from neither. If a sets inclusions are empty, then all items - * are considered to be included. + * Combine the results of two {@link IncludeExcludeSet}s with an "and"-like operation. + * Item x must be included and not excluded by xSet AND item y must be included and not excluded by ySet. + * If a sets inclusions are empty, then all items are considered to be included. * @param xSet The set that param x is tested against * @param x An item to test against xSet * @param ySet The set that param y is tested against @@ -250,11 +249,12 @@ public class IncludeExcludeSet implements Predicate

return true; } - /** - * Combine the results of two {@link IncludeExcludeSet}s with an "or" operation. The items must be - * included by xSet OR ySet, and excluded from neither. If a sets inclusions are empty, then all items - * are considered to be included. + * Combine the results of two {@link IncludeExcludeSet}s with an "or"-like operation. + * Item x must be included by xSet OR item y must be included ySet. + * Neither x nor y may be excluded for either respective set. + * If a sets inclusions are empty, then all items are considered to be included. + * * @param xSet The set that param x is tested against * @param x An item to test against xSet * @param ySet The set that param y is tested against diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ClasspathPattern.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ClasspathPattern.java index 723a0e6552d..3907be619d1 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ClasspathPattern.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ClasspathPattern.java @@ -489,7 +489,7 @@ public class ClasspathPattern extends AbstractSet } Map _entries = new HashMap<>(); - IncludeExcludeSet _patterns = new IncludeExcludeSet<>(ByPackageOrName.class); + IncludeExcludeSet _packageOrNamePatterns = new IncludeExcludeSet<>(ByPackageOrName.class); IncludeExcludeSet _locations = new IncludeExcludeSet<>(ByLocationOrModule.class); public ClasspathPattern() @@ -591,9 +591,9 @@ public class ClasspathPattern extends AbstractSet else { if (entry.isInclusive()) - _patterns.include(entry); + _packageOrNamePatterns.include(entry); else - _patterns.exclude(entry); + _packageOrNamePatterns.exclude(entry); } return true; } @@ -620,7 +620,7 @@ public class ClasspathPattern extends AbstractSet public void clear() { _entries.clear(); - _patterns.clear(); + _packageOrNamePatterns.clear(); _locations.clear(); } @@ -673,7 +673,7 @@ public class ClasspathPattern extends AbstractSet */ public boolean match(String name) { - return _patterns.test(name); + return _packageOrNamePatterns.test(name); } /** @@ -686,7 +686,7 @@ public class ClasspathPattern extends AbstractSet { try { - return IncludeExcludeSet.or(_patterns, clazz.getName(), _locations, ()->TypeUtil.getLocationOfClass(clazz)); + return IncludeExcludeSet.or(_packageOrNamePatterns, clazz.getName(), _locations, ()->TypeUtil.getLocationOfClass(clazz)); } catch (Exception e) { @@ -704,7 +704,7 @@ public class ClasspathPattern extends AbstractSet // Treat path elements as packages for name matching name=name.replace("/","."); - return IncludeExcludeSet.or(_patterns, name, _locations, ()-> + return IncludeExcludeSet.or(_packageOrNamePatterns, name, _locations, ()-> { try {