You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Adriano Crestani (JIRA)" <ji...@apache.org> on 2011/01/08 07:38:45 UTC

[jira] Created: (LUCENE-2855) Contrib queryparser should not use CharSequence as Map key

Contrib queryparser should not use CharSequence as Map key
----------------------------------------------------------

                 Key: LUCENE-2855
                 URL: https://issues.apache.org/jira/browse/LUCENE-2855
             Project: Lucene - Java
          Issue Type: Bug
          Components: contrib/*
    Affects Versions: 3.0.3
            Reporter: Adriano Crestani
             Fix For: 3.0.4


Today, contrib query parser uses Map<CharSequence,...> in many different places, which may lead to problems, since CharSequence interface does not enforce the implementation of hashcode and equals methods. Today, it's causing a problem with QueryTreeBuilder.setBuilder(CharSequence,QueryBuilder) method, that does not works as expected.

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


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


[jira] Commented: (LUCENE-2855) Contrib queryparser should not use CharSequence as Map key

Posted by "Simon Willnauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12979274#action_12979274 ] 

Simon Willnauer commented on LUCENE-2855:
-----------------------------------------

+1 - just put your name after the description in the changes.txt 

> Contrib queryparser should not use CharSequence as Map key
> ----------------------------------------------------------
>
>                 Key: LUCENE-2855
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2855
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 3.0.3
>            Reporter: Adriano Crestani
>            Assignee: Adriano Crestani
>             Fix For: 3.0.4
>
>         Attachments: lucene_2855_adriano_crestani_2011_01_08.patch
>
>
> Today, contrib query parser uses Map<CharSequence,...> in many different places, which may lead to problems, since CharSequence interface does not enforce the implementation of hashcode and equals methods. Today, it's causing a problem with QueryTreeBuilder.setBuilder(CharSequence,QueryBuilder) method, that does not works as expected.

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


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


[jira] Updated: (LUCENE-2855) Contrib queryparser should not use CharSequence as Map key

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

Adriano Crestani updated LUCENE-2855:
-------------------------------------

    Attachment: lucene_2855_adriano_crestani_2011_01_09.patch

Thanks for pointing out the problems, here is the new patch

> Contrib queryparser should not use CharSequence as Map key
> ----------------------------------------------------------
>
>                 Key: LUCENE-2855
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2855
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 3.0.3
>            Reporter: Adriano Crestani
>            Assignee: Adriano Crestani
>             Fix For: 3.0.4
>
>         Attachments: lucene_2855_adriano_crestani_2011_01_08.patch, lucene_2855_adriano_crestani_2011_01_09.patch
>
>
> Today, contrib query parser uses Map<CharSequence,...> in many different places, which may lead to problems, since CharSequence interface does not enforce the implementation of hashcode and equals methods. Today, it's causing a problem with QueryTreeBuilder.setBuilder(CharSequence,QueryBuilder) method, that does not works as expected.

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


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


[jira] Commented: (LUCENE-2855) Contrib queryparser should not use CharSequence as Map key

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12979255#action_12979255 ] 

Uwe Schindler commented on LUCENE-2855:
---------------------------------------

One thing in your patch: Lucene tests should always extend LuceneTestCase (which is Junit4)

> Contrib queryparser should not use CharSequence as Map key
> ----------------------------------------------------------
>
>                 Key: LUCENE-2855
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2855
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 3.0.3
>            Reporter: Adriano Crestani
>            Assignee: Adriano Crestani
>             Fix For: 3.0.4
>
>         Attachments: lucene_2855_adriano_crestani_2011_01_08.patch
>
>
> Today, contrib query parser uses Map<CharSequence,...> in many different places, which may lead to problems, since CharSequence interface does not enforce the implementation of hashcode and equals methods. Today, it's causing a problem with QueryTreeBuilder.setBuilder(CharSequence,QueryBuilder) method, that does not works as expected.

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


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


[jira] Commented: (LUCENE-2855) Contrib queryparser should not use CharSequence as Map key

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12979253#action_12979253 ] 

Uwe Schindler commented on LUCENE-2855:
---------------------------------------

+1 to commit.

In general, one should never use interfaces as keys in maps (as long as they don't declare the equals and hashcode methods inside the interface).

> Contrib queryparser should not use CharSequence as Map key
> ----------------------------------------------------------
>
>                 Key: LUCENE-2855
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2855
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 3.0.3
>            Reporter: Adriano Crestani
>            Assignee: Adriano Crestani
>             Fix For: 3.0.4
>
>         Attachments: lucene_2855_adriano_crestani_2011_01_08.patch
>
>
> Today, contrib query parser uses Map<CharSequence,...> in many different places, which may lead to problems, since CharSequence interface does not enforce the implementation of hashcode and equals methods. Today, it's causing a problem with QueryTreeBuilder.setBuilder(CharSequence,QueryBuilder) method, that does not works as expected.

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


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


[jira] Updated: (LUCENE-2855) Contrib queryparser should not use CharSequence as Map key

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

Adriano Crestani updated LUCENE-2855:
-------------------------------------

    Attachment: lucene_2855_adriano_crestani_2011_01_08.patch

Here is the fix for the problem raised at thread [1]. The patch also includes a junit to make sure the problem doesn't show up again.

If there are no concerns in two days, I will go ahead and commit the patch.

[1] - http://lucene.markmail.org/thread/mbb5wlxttsa6sges

> Contrib queryparser should not use CharSequence as Map key
> ----------------------------------------------------------
>
>                 Key: LUCENE-2855
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2855
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 3.0.3
>            Reporter: Adriano Crestani
>            Assignee: Adriano Crestani
>             Fix For: 3.0.4
>
>         Attachments: lucene_2855_adriano_crestani_2011_01_08.patch
>
>
> Today, contrib query parser uses Map<CharSequence,...> in many different places, which may lead to problems, since CharSequence interface does not enforce the implementation of hashcode and equals methods. Today, it's causing a problem with QueryTreeBuilder.setBuilder(CharSequence,QueryBuilder) method, that does not works as expected.

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


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


[jira] Assigned: (LUCENE-2855) Contrib queryparser should not use CharSequence as Map key

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

Adriano Crestani reassigned LUCENE-2855:
----------------------------------------

    Assignee: Adriano Crestani

> Contrib queryparser should not use CharSequence as Map key
> ----------------------------------------------------------
>
>                 Key: LUCENE-2855
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2855
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 3.0.3
>            Reporter: Adriano Crestani
>            Assignee: Adriano Crestani
>             Fix For: 3.0.4
>
>
> Today, contrib query parser uses Map<CharSequence,...> in many different places, which may lead to problems, since CharSequence interface does not enforce the implementation of hashcode and equals methods. Today, it's causing a problem with QueryTreeBuilder.setBuilder(CharSequence,QueryBuilder) method, that does not works as expected.

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


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


[jira] Resolved: (LUCENE-2855) Contrib queryparser should not use CharSequence as Map key

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

Adriano Crestani resolved LUCENE-2855.
--------------------------------------

    Resolution: Fixed

patch applied on revision 1057454

> Contrib queryparser should not use CharSequence as Map key
> ----------------------------------------------------------
>
>                 Key: LUCENE-2855
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2855
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 3.0.3
>            Reporter: Adriano Crestani
>            Assignee: Adriano Crestani
>             Fix For: 3.0.4
>
>         Attachments: lucene_2855_adriano_crestani_2011_01_08.patch, lucene_2855_adriano_crestani_2011_01_09.patch
>
>
> Today, contrib query parser uses Map<CharSequence,...> in many different places, which may lead to problems, since CharSequence interface does not enforce the implementation of hashcode and equals methods. Today, it's causing a problem with QueryTreeBuilder.setBuilder(CharSequence,QueryBuilder) method, that does not works as expected.

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


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