You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Amila Maharachchi (Created) (JIRA)" <ji...@apache.org> on 2011/12/12 06:34:30 UTC

[jira] [Created] (SYNAPSE-827) Switch mediator matching the complete input with the provided regex (instead of a subsequence)

Switch mediator matching the complete input with the provided regex (instead of a subsequence)
----------------------------------------------------------------------------------------------

                 Key: SYNAPSE-827
                 URL: https://issues.apache.org/jira/browse/SYNAPSE-827
             Project: Synapse
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.1
            Reporter: Amila Maharachchi


When we provide an input and a regex to match by the Switch mediator, it matches the complete input with the regex instead of a subsequence. For example if the input is ABC and the regex is AB, it will not consider as a match. But ideally it is a match. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] [Commented] (SYNAPSE-827) Switch mediator matching the complete input with the provided regex (instead of a subsequence)

Posted by "Hiranya Jayathilaka (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172082#comment-13172082 ] 

Hiranya Jayathilaka commented on SYNAPSE-827:
---------------------------------------------

This is definitely going to break a few existing configurations. I still believe that existing behavior is correct. You can always write a reg-ex to match any fragment in a given string.
                
> Switch mediator matching the complete input with the provided regex (instead of a subsequence)
> ----------------------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-827
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-827
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>            Reporter: Amila Maharachchi
>            Assignee: Kasun Indrasiri
>         Attachments: SYNAPSE-827.patch
>
>
> When we provide an input and a regex to match by the Switch mediator, it matches the complete input with the regex instead of a subsequence. For example if the input is ABC and the regex is AB, it will not consider as a match. But ideally it is a match. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] [Commented] (SYNAPSE-827) Switch mediator matching the complete input with the provided regex (instead of a subsequence)

Posted by "Kasun Indrasiri (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13167652#comment-13167652 ] 

Kasun Indrasiri commented on SYNAPSE-827:
-----------------------------------------

Hi Amila,

If the input is "ABC" then if you need to get a match for "AB", then we can have to use regex  "AB*.". If we change 'matches' to 'find', then we might not be able to handle the cases where we need to do a exact matching. WDYT?
                
> Switch mediator matching the complete input with the provided regex (instead of a subsequence)
> ----------------------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-827
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-827
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>            Reporter: Amila Maharachchi
>            Assignee: Kasun Indrasiri
>         Attachments: SYNAPSE-827.patch
>
>
> When we provide an input and a regex to match by the Switch mediator, it matches the complete input with the regex instead of a subsequence. For example if the input is ABC and the regex is AB, it will not consider as a match. But ideally it is a match. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] [Commented] (SYNAPSE-827) Switch mediator matching the complete input with the provided regex (instead of a subsequence)

Posted by "Amila Maharachchi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13168182#comment-13168182 ] 

Amila Maharachchi commented on SYNAPSE-827:
-------------------------------------------

Hi Kasun,
If we are using Matcher.find() and our input is "ABC", regexes "AB" and "ABC" will both return true.

Consider the following input. "ABC Amila <am...@amila.com>"
With find(), regexes "amila@amila.com", "ABC Amila <am...@amila.com>", "^ABC Amila <am...@amila.com>$" return true. If you want an exact match you have to use regex 3 or 2. 

BTW, these two methods have pros and cons. But I feel find() method makes life easier for the user.

Just my view and thoughts.

Thanks,
Amila.
                
> Switch mediator matching the complete input with the provided regex (instead of a subsequence)
> ----------------------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-827
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-827
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>            Reporter: Amila Maharachchi
>            Assignee: Kasun Indrasiri
>         Attachments: SYNAPSE-827.patch
>
>
> When we provide an input and a regex to match by the Switch mediator, it matches the complete input with the regex instead of a subsequence. For example if the input is ABC and the regex is AB, it will not consider as a match. But ideally it is a match. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] [Assigned] (SYNAPSE-827) Switch mediator matching the complete input with the provided regex (instead of a subsequence)

Posted by "Kasun Indrasiri (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-827?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kasun Indrasiri reassigned SYNAPSE-827:
---------------------------------------

    Assignee: Kasun Indrasiri
    
> Switch mediator matching the complete input with the provided regex (instead of a subsequence)
> ----------------------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-827
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-827
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>            Reporter: Amila Maharachchi
>            Assignee: Kasun Indrasiri
>
> When we provide an input and a regex to match by the Switch mediator, it matches the complete input with the regex instead of a subsequence. For example if the input is ABC and the regex is AB, it will not consider as a match. But ideally it is a match. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] [Commented] (SYNAPSE-827) Switch mediator matching the complete input with the provided regex (instead of a subsequence)

Posted by "Amila Maharachchi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13167366#comment-13167366 ] 

Amila Maharachchi commented on SYNAPSE-827:
-------------------------------------------

Reason for this is using Matcher.matches() method instead of the Matcher.find() method. matches() compare the complete input string with the regex. But find() tries to find a subsequence of the input string which matches the regex.
                
> Switch mediator matching the complete input with the provided regex (instead of a subsequence)
> ----------------------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-827
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-827
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>            Reporter: Amila Maharachchi
>            Assignee: Kasun Indrasiri
>         Attachments: SYNAPSE-827.patch
>
>
> When we provide an input and a regex to match by the Switch mediator, it matches the complete input with the regex instead of a subsequence. For example if the input is ABC and the regex is AB, it will not consider as a match. But ideally it is a match. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] [Updated] (SYNAPSE-827) Switch mediator matching the complete input with the provided regex (instead of a subsequence)

Posted by "Amila Maharachchi (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-827?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amila Maharachchi updated SYNAPSE-827:
--------------------------------------

    Attachment: SYNAPSE-827.patch

Attaching the patch
                
> Switch mediator matching the complete input with the provided regex (instead of a subsequence)
> ----------------------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-827
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-827
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>            Reporter: Amila Maharachchi
>            Assignee: Kasun Indrasiri
>         Attachments: SYNAPSE-827.patch
>
>
> When we provide an input and a regex to match by the Switch mediator, it matches the complete input with the regex instead of a subsequence. For example if the input is ABC and the regex is AB, it will not consider as a match. But ideally it is a match. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] [Commented] (SYNAPSE-827) Switch mediator matching the complete input with the provided regex (instead of a subsequence)

Posted by "Hiranya Jayathilaka (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13167501#comment-13167501 ] 

Hiranya Jayathilaka commented on SYNAPSE-827:
---------------------------------------------

I think the existing behavior is correct. The find method is used to 'find' a matching subsequence in the input string. But here we simply want to check whether the input string 'matches' the given regex. Hence the use of the matches method is correct.
                
> Switch mediator matching the complete input with the provided regex (instead of a subsequence)
> ----------------------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-827
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-827
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>            Reporter: Amila Maharachchi
>            Assignee: Kasun Indrasiri
>         Attachments: SYNAPSE-827.patch
>
>
> When we provide an input and a regex to match by the Switch mediator, it matches the complete input with the regex instead of a subsequence. For example if the input is ABC and the regex is AB, it will not consider as a match. But ideally it is a match. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] [Resolved] (SYNAPSE-827) Switch mediator matching the complete input with the provided regex (instead of a subsequence)

Posted by "Hiranya Jayathilaka (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-827?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hiranya Jayathilaka resolved SYNAPSE-827.
-----------------------------------------

       Resolution: Won't Fix
    Fix Version/s: 2.1
    
> Switch mediator matching the complete input with the provided regex (instead of a subsequence)
> ----------------------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-827
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-827
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>            Reporter: Amila Maharachchi
>            Assignee: Kasun Indrasiri
>             Fix For: 2.1
>
>         Attachments: SYNAPSE-827.patch
>
>
> When we provide an input and a regex to match by the Switch mediator, it matches the complete input with the regex instead of a subsequence. For example if the input is ABC and the regex is AB, it will not consider as a match. But ideally it is a match. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org