This is an automated email from the ASF dual-hosted git repository. kusal pushed a commit to branch WW-5337-exclusion-performance in repository https://gitbox.apache.org/repos/asf/struts.git
commit 841705cadfd38b5460915375b5e977131f3988eb Author: Kusal Kithul-Godage <g...@kusal.io> AuthorDate: Mon Aug 21 23:33:30 2023 +1000 WW-5337 Strip trailing periods from package names provided as not needed --- core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java index 21ebd5fea..005d17eba 100644 --- a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java +++ b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java @@ -53,6 +53,8 @@ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import static com.opensymphony.xwork2.util.TextParseUtil.commaDelimitedStringToSet; +import static java.util.stream.Collectors.toSet; +import static org.apache.commons.lang3.StringUtils.strip; /** @@ -260,7 +262,8 @@ public class OgnlUtil { } private Set<String> parseExcludedPackageNames(String commaDelimitedPackageNames) { - Set<String> parsedSet = TextParseUtil.commaDelimitedStringToSet(commaDelimitedPackageNames); + Set<String> parsedSet = commaDelimitedStringToSet(commaDelimitedPackageNames) + .stream().map(s -> strip(s, ".")).collect(toSet()); if (parsedSet.stream().anyMatch(s -> s.matches("(.*?)\\s(.*?)"))) { throw new ConfigurationException("Excluded package names could not be parsed due to erroneous whitespace characters: " + commaDelimitedPackageNames); }