You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Fintan Bolton (JIRA)" <ji...@apache.org> on 2010/06/25 16:11:52 UTC

[jira] Created: (CAMEL-2861) Implementation of EndpointHelper.matchPattern() method is inconsistent

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.


[jira] Updated: (CAMEL-2861) Implementation of EndpointHelper.matchPattern() method is inconsistent

Posted by "Fintan Bolton (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Commented: (CAMEL-2861) Implementation of EndpointHelper.matchPattern() method is inconsistent

Posted by "Fintan Bolton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60280#action_60280 ] 

Fintan Bolton commented on CAMEL-2861:
--------------------------------------

Ok! It just seemed a bit complicated to explain in the docs. But if users find the alternative syntax more confusing, I guess we should leave it as it is.

> 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.


[jira] Resolved: (CAMEL-2861) Implementation of EndpointHelper.matchPattern() method is inconsistent

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2861?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-2861.
--------------------------------

      Assignee: Claus Ibsen
    Resolution: Working as Designed

trunk: 958191.

I polished the code a bit

> 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
>            Assignee: Claus Ibsen
>             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.


[jira] Commented: (CAMEL-2861) Implementation of EndpointHelper.matchPattern() method is inconsistent

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60277#action_60277 ] 

Claus Ibsen commented on CAMEL-2861:
------------------------------------

This is *not* inconsistent. This is how the endpoint wildcard matching works in Camel for its interceptors and whatnot.
Its documented in the javadoc of the method how it matches.

Its much easier for end users to just type {{jdbc*}} to match anything related to JDBC endpoints. With regular exp which some end users is not good at you have to do it like {{jdbc.*}} and whatnot.

This is by design it works as it does.

> 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.