reta commented on a change in pull request #847:
URL: https://github.com/apache/cxf/pull/847#discussion_r704417685
##########
File path:
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/URITemplate.java
##########
@@ -83,7 +83,7 @@ public URITemplate(String theTemplate) {
// however do not add them if they already exist since
that will cause the Matcher
// to create extraneous values. Parens identify a group
so multiple parens would
// indicate multiple groups.
- if (pattern.startsWith("(") && pattern.endsWith(")")) {
+ if (pattern.startsWith("(") && pattern.endsWith(")") &&
!pattern.startsWith("(?:")) {
Review comment:
Thanks for the fix @jimma , I am wondering if we should cover other
special constructs [1] with more broader`!pattern.startsWith("(?")` check, for
example `(?>X)`, an independent, non-capturing group, etc
```
(?<name>X) X, as a named-capturing group
(?:X) X, as a non-capturing group
(?idmsuxU-idmsuxU) Nothing, but turns match flags i d m s u x U on - off
(?idmsux-idmsux:X) X, as a non-capturing group with the given flags i
d m s u x on - off
(?=X) X, via zero-width positive lookahead
(?!X) X, via zero-width negative lookahead
(?<=X) X, via zero-width positive lookbehind
(?<!X) X, via zero-width negative lookbehind
(?>X) X, as an independent, non-capturing
group
```
[1] https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]