You are viewing a plain text version of this content. The canonical link for it is here.
Posted to droids-dev@incubator.apache.org by "Eugen Paraschiv (JIRA)" <ji...@apache.org> on 2010/12/25 22:04:45 UTC

[jira] Created: (DROIDS-113) RegexURLFilter uses find() instead of matches() to match the regex

RegexURLFilter uses find() instead of matches() to match the regex
------------------------------------------------------------------

                 Key: DROIDS-113
                 URL: https://issues.apache.org/jira/browse/DROIDS-113
             Project: Droids
          Issue Type: Bug
          Components: core
    Affects Versions: 0.0.1
            Reporter: Eugen Paraschiv
             Fix For: 0.0.1


By matching the regex via find() and not matches(), the client doesn't have full control over the url matching process, because the regex is not used to match the entire url but any part of it, which may not be correct. 
If the client wants to allow flexibility in the URL structure, he can do so with the regex expression itself, but the actual matching process should try to match the entire url, not just parts of it. 


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


[jira] Updated: (DROIDS-113) RegexURLFilter uses find() instead of matches() to match the regex

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DROIDS-113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eugen Paraschiv updated DROIDS-113:
-----------------------------------

    Attachment: DROIDS-113_v1.patch

> RegexURLFilter uses find() instead of matches() to match the regex
> ------------------------------------------------------------------
>
>                 Key: DROIDS-113
>                 URL: https://issues.apache.org/jira/browse/DROIDS-113
>             Project: Droids
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-113_v1.patch
>
>
> By matching the regex via find() and not matches(), the client doesn't have full control over the url matching process, because the regex is not used to match the entire url but any part of it, which may not be correct. 
> If the client wants to allow flexibility in the URL structure, he can do so with the regex expression itself, but the actual matching process should try to match the entire url, not just parts of it. 

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


[jira] Updated: (DROIDS-113) RegexURLFilter uses find() instead of matches() to match the regex

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DROIDS-113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eugen Paraschiv updated DROIDS-113:
-----------------------------------

    Attachment: DROIDS-113_v2.patch

This patch addresses the reported issue. The reason it failed is because, as the description reads, the entire string is not matched on, so the default, accepting regex (which was just '.') should now be .* to accept everything. 

> RegexURLFilter uses find() instead of matches() to match the regex
> ------------------------------------------------------------------
>
>                 Key: DROIDS-113
>                 URL: https://issues.apache.org/jira/browse/DROIDS-113
>             Project: Droids
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-113_v1.patch, DROIDS-113_v2.patch
>
>
> By matching the regex via find() and not matches(), the client doesn't have full control over the url matching process, because the regex is not used to match the entire url but any part of it, which may not be correct. 
> If the client wants to allow flexibility in the URL structure, he can do so with the regex expression itself, but the actual matching process should try to match the entire url, not just parts of it. 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DROIDS-113) RegexURLFilter uses find() instead of matches() to match the regex

Posted by "Thorsten Scherler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12975164#action_12975164 ] 

Thorsten Scherler commented on DROIDS-113:
------------------------------------------

Agreed, can you provide a patch?

> RegexURLFilter uses find() instead of matches() to match the regex
> ------------------------------------------------------------------
>
>                 Key: DROIDS-113
>                 URL: https://issues.apache.org/jira/browse/DROIDS-113
>             Project: Droids
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>
> By matching the regex via find() and not matches(), the client doesn't have full control over the url matching process, because the regex is not used to match the entire url but any part of it, which may not be correct. 
> If the client wants to allow flexibility in the URL structure, he can do so with the regex expression itself, but the actual matching process should try to match the entire url, not just parts of it. 

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


[jira] Commented: (DROIDS-113) RegexURLFilter uses find() instead of matches() to match the regex

Posted by "Bertil Chapuis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995273#comment-12995273 ] 

Bertil Chapuis commented on DROIDS-113:
---------------------------------------

The tests are not failing anymore. I applied the patch so you can close the issue. Thanks a lot for your work.

> RegexURLFilter uses find() instead of matches() to match the regex
> ------------------------------------------------------------------
>
>                 Key: DROIDS-113
>                 URL: https://issues.apache.org/jira/browse/DROIDS-113
>             Project: Droids
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-113_v1.patch, DROIDS-113_v2.patch
>
>
> By matching the regex via find() and not matches(), the client doesn't have full control over the url matching process, because the regex is not used to match the entire url but any part of it, which may not be correct. 
> If the client wants to allow flexibility in the URL structure, he can do so with the regex expression itself, but the actual matching process should try to match the entire url, not just parts of it. 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (DROIDS-113) RegexURLFilter uses find() instead of matches() to match the regex

Posted by "Eugen Paraschiv (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DROIDS-113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eugen Paraschiv resolved DROIDS-113.
------------------------------------

    Resolution: Fixed

> RegexURLFilter uses find() instead of matches() to match the regex
> ------------------------------------------------------------------
>
>                 Key: DROIDS-113
>                 URL: https://issues.apache.org/jira/browse/DROIDS-113
>             Project: Droids
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-113_v1.patch, DROIDS-113_v2.patch
>
>
> By matching the regex via find() and not matches(), the client doesn't have full control over the url matching process, because the regex is not used to match the entire url but any part of it, which may not be correct. 
> If the client wants to allow flexibility in the URL structure, he can do so with the regex expression itself, but the actual matching process should try to match the entire url, not just parts of it. 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DROIDS-113) RegexURLFilter uses find() instead of matches() to match the regex

Posted by "Otis Gospodnetic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DROIDS-113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12976475#action_12976475 ] 

Otis Gospodnetic commented on DROIDS-113:
-----------------------------------------

mvn clean test passes before patch, and after the patch:

testReportCrawlingDroid(org.apache.droids.dynamic.TestSimpleDroid)  Time elapsed: 1.74 sec  <<< FAILURE!
junit.framework.AssertionFailedError: expected:<5> but was:<1>
        at junit.framework.Assert.fail(Assert.java:47)
        at junit.framework.Assert.failNotEquals(Assert.java:277)
        at junit.framework.Assert.assertEquals(Assert.java:64)
        at junit.framework.Assert.assertEquals(Assert.java:195)
        at junit.framework.Assert.assertEquals(Assert.java:201)
        at org.apache.droids.dynamic.TestSimpleDroid.testReportCrawlingDroid(TestSimpleDroid.java:72)

> RegexURLFilter uses find() instead of matches() to match the regex
> ------------------------------------------------------------------
>
>                 Key: DROIDS-113
>                 URL: https://issues.apache.org/jira/browse/DROIDS-113
>             Project: Droids
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.0.1
>            Reporter: Eugen Paraschiv
>             Fix For: 0.0.1
>
>         Attachments: DROIDS-113_v1.patch
>
>
> By matching the regex via find() and not matches(), the client doesn't have full control over the url matching process, because the regex is not used to match the entire url but any part of it, which may not be correct. 
> If the client wants to allow flexibility in the URL structure, he can do so with the regex expression itself, but the actual matching process should try to match the entire url, not just parts of it. 

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