-
Couldn't load subscription status.
- Fork 38.8k
Closed
Closed
Copy link
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply
Description
Affects: 5.3.10
Background:
I assume the AntPathMatcher matches (among othersú a path against a pattern if all below apply:
patternandpathare equal- they both contain only alphanumeric characters (no Ant-specific characters such as
*,?or{with}and no slashes/and\)
Reproducible sample:
The following code reproduces a strange behavior:
new AntPathMatcher().match("consent", "consent"); // true
new AntPathMatcher().match("consentreg", "consentreg"); // true
new AntPathMatcher("\\t").match("consent", "consent"); // true
new AntPathMatcher("\\t").match("consentreg", "consentreg"); // falseDo I assume the behavior wrongly? If so, would you describe the behavior and how to fix my use case?
Workaround:
As of now, I must check whether the pattern is not Ant pattern and check the equality first:
String string = "consentreg";
String pattern = "consentreg";
AntPathMatcher matcher = new AntPathMatcher("\\t");
boolean result = (!matcher.isPattern(pattern) && pattern.equals(string)) || getAntPathMatcher().match(pattern, string);
// trueMetadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply