You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Simon Willnauer (JIRA)" <ji...@apache.org> on 2009/06/16 13:35:07 UTC

[jira] Created: (LUCENE-1694) Query#mergeBooleanQueries argument should be of type BooleanQuery[] instead of Query[]

Query#mergeBooleanQueries argument should be of type BooleanQuery[] instead of Query[]
--------------------------------------------------------------------------------------

                 Key: LUCENE-1694
                 URL: https://issues.apache.org/jira/browse/LUCENE-1694
             Project: Lucene - Java
          Issue Type: Improvement
          Components: Search
            Reporter: Simon Willnauer
             Fix For: 2.9


The method #mergeBooleanQueries accepts Query[] and casts elements to BooleanQuery without checking. This will guarantee a ClassCastException if it is not a boolean query. We should enforce this by changing the signature. This won't really break back compat. as it only works with instances of BooleanQuery.



-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1694) Query#mergeBooleanQueries argument should be of type BooleanQuery[] instead of Query[]

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

Simon Willnauer updated LUCENE-1694:
------------------------------------

    Priority: Minor  (was: Major)

> Query#mergeBooleanQueries argument should be of type BooleanQuery[] instead of Query[]
> --------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1694
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1694
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>            Reporter: Simon Willnauer
>            Priority: Minor
>             Fix For: 2.9
>
>
> The method #mergeBooleanQueries accepts Query[] and casts elements to BooleanQuery without checking. This will guarantee a ClassCastException if it is not a boolean query. We should enforce this by changing the signature. This won't really break back compat. as it only works with instances of BooleanQuery.

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Assigned: (LUCENE-1694) Query#mergeBooleanQueries argument should be of type BooleanQuery[] instead of Query[]

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

Michael McCandless reassigned LUCENE-1694:
------------------------------------------

    Assignee: Michael McCandless

> Query#mergeBooleanQueries argument should be of type BooleanQuery[] instead of Query[]
> --------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1694
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1694
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>            Reporter: Simon Willnauer
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: Query_mergeBooleanQueries.patch
>
>
> The method #mergeBooleanQueries accepts Query[] and casts elements to BooleanQuery without checking. This will guarantee a ClassCastException if it is not a boolean query. We should enforce this by changing the signature. This won't really break back compat. as it only works with instances of BooleanQuery.

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1694) Query#mergeBooleanQueries argument should be of type BooleanQuery[] instead of Query[]

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

Simon Willnauer updated LUCENE-1694:
------------------------------------

    Attachment: Query_mergeBooleanQueries.patch

Attached patch + testcase.
The patch passes all tests including test-tag.

> Query#mergeBooleanQueries argument should be of type BooleanQuery[] instead of Query[]
> --------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1694
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1694
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>            Reporter: Simon Willnauer
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: Query_mergeBooleanQueries.patch
>
>
> The method #mergeBooleanQueries accepts Query[] and casts elements to BooleanQuery without checking. This will guarantee a ClassCastException if it is not a boolean query. We should enforce this by changing the signature. This won't really break back compat. as it only works with instances of BooleanQuery.

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1694) Query#mergeBooleanQueries argument should be of type BooleanQuery[] instead of Query[]

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12720139#action_12720139 ] 

Michael McCandless commented on LUCENE-1694:
--------------------------------------------

Patch looks good, thanks Simon.

Technically it's a break in jar drop-in ability back compat, since the method signature has changed.  However, I think it's unlikely apps are using this rather expert API, and we already don't have jar drop-in ability for 2.9 anyway, and as you said if you attempt to pass a non-BooleanQuery, you'll hit a cast exception anwyay.

I plan to commit shortly.

> Query#mergeBooleanQueries argument should be of type BooleanQuery[] instead of Query[]
> --------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1694
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1694
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>            Reporter: Simon Willnauer
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: Query_mergeBooleanQueries.patch
>
>
> The method #mergeBooleanQueries accepts Query[] and casts elements to BooleanQuery without checking. This will guarantee a ClassCastException if it is not a boolean query. We should enforce this by changing the signature. This won't really break back compat. as it only works with instances of BooleanQuery.

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Resolved: (LUCENE-1694) Query#mergeBooleanQueries argument should be of type BooleanQuery[] instead of Query[]

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

Michael McCandless resolved LUCENE-1694.
----------------------------------------

    Resolution: Fixed

Thank Simon!

> Query#mergeBooleanQueries argument should be of type BooleanQuery[] instead of Query[]
> --------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1694
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1694
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>            Reporter: Simon Willnauer
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: Query_mergeBooleanQueries.patch
>
>
> The method #mergeBooleanQueries accepts Query[] and casts elements to BooleanQuery without checking. This will guarantee a ClassCastException if it is not a boolean query. We should enforce this by changing the signature. This won't really break back compat. as it only works with instances of BooleanQuery.

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org