[ 
https://issues.apache.org/activemq/browse/CAMEL-2861?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fintan Bolton updated CAMEL-2861:
---------------------------------

    Description: 
The current implementation of {{EndpointHelper.matchPattern()}} is 
inconsistent, because it tries to combine glob-style wildcards and regex 
matching in a single function. Currently, if you pass a pattern such as 
{{name*}}, this will match any string with the prefix, {{name}}. Any other 
pattern will be interpreted as a regex. This is pretty confusing and 
non-intuitive. It would be better to split this into two separate functions 
like {{wildcardMatch()}} and {{regexMatch()}} and to call whichever of these 
functions makes sense, depending on the context.

I came across this issue while documenting the {{removeHeaders()}} method, 
which takes a pattern as its argument.,

  was:
The current implementation of {{EndpointHelper.matchPattern()}} is 
inconsistent, because it tries to combine glob-style wildcards and regex 
matching in a single function. Currently, if you pass a pattern such as 
{{name*}}, this will match any string with the prefix, {{name}}. Any other 
pattern will be interpreted as a regex. This is pretty confusing and 
non-intuitive. It would be better to split this into two separate functions 
like {{wildcardMatch()}} and {{regexMatch()} and to call whichever of these 
functions makes sense, depending on the context.

I came across this issue while documenting the {{removeHeaders()}} method, 
which takes a pattern as its argument.,


> Implementation of EndpointHelper.matchPattern() method is inconsistent
> ----------------------------------------------------------------------
>
>                 Key: CAMEL-2861
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2861
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.3.0
>            Reporter: Fintan Bolton
>             Fix For: 2.4.0
>
>
> The current implementation of {{EndpointHelper.matchPattern()}} is 
> inconsistent, because it tries to combine glob-style wildcards and regex 
> matching in a single function. Currently, if you pass a pattern such as 
> {{name*}}, this will match any string with the prefix, {{name}}. Any other 
> pattern will be interpreted as a regex. This is pretty confusing and 
> non-intuitive. It would be better to split this into two separate functions 
> like {{wildcardMatch()}} and {{regexMatch()}} and to call whichever of these 
> functions makes sense, depending on the context.
> I came across this issue while documenting the {{removeHeaders()}} method, 
> which takes a pattern as its argument.,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to