Description
Hello!
We found a regression in NamedVariablePatternMatcher that we believe was introduced by the fix to WW-3529.
If the pattern begins with a variable, for example {urlLocale}/eula_cz, it throws an exception Missing openning '{' in [\{urlLocale}/eula_cz]! due to this condition: https://github.com/apache/struts/blob/master/core/src/main/java/com/opensymphony/xwork2/util/NamedVariablePatternMatcher.java#L90-L92
In the first iteration, the loop reads the variable {urlLocale}. In the next iteration, it finds no more opening braces, but then it throws an exception when data.indexOf('}') > -1 - which is always true when the pattern contains any variables, so it always throws an exception.
Replacing the faulty condition with data.indexOf('}', s) > -1 should fix the issue.
It's also relatively easy to work around by extending NamedVariablePatternMatcher, copying the compilePattern method, and applying the fix there, so it's not blocking us from updating Struts.