You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/05/07 11:25:04 UTC

[jira] [Commented] (LUCENE-7818) Suspicious condition

    [ https://issues.apache.org/jira/browse/LUCENE-7818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15999792#comment-15999792 ] 

ASF subversion and git services commented on LUCENE-7818:
---------------------------------------------------------

Commit 0ed39b2774c1c39faf5a6c4cfc9cb68540b16f11 in lucene-solr's branch refs/heads/master from [~thetaphi]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=0ed39b2 ]

LUCENE-5365, LUCENE-7818: Fix incorrect condition in queryparser's QueryNodeOperation#logicalAnd()


> Suspicious condition
> --------------------
>
>                 Key: LUCENE-7818
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7818
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/queryparser
>    Affects Versions: 6.5
>            Reporter: AppChecker
>            Assignee: Uwe Schindler
>              Labels: static-analysis
>
> Hi
> Please, look this [code fragment:|https://github.com/apache/lucene-solr/blob/e2521b2a8baabdaf43b92192588f51e042d21e97/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/QueryNodeOperation.java#L57-L60]
> {code}
>     else if (q1 instanceof AndQueryNode)
>       op = ANDOperation.Q1;
>     else if (q1 instanceof AndQueryNode)
>       op = ANDOperation.Q2;
> {code}
> (q1 instanceof AndQueryNode) is checked twice.
> Probably it should be:
> {code}
>     else if (q1 instanceof AndQueryNode)
>       op = ANDOperation.Q1;
>     else if (q2 instanceof AndQueryNode)
>       op = ANDOperation.Q2;
> {code}
> This possible defect found by [AppChecker|https://npo-echelon.ru/en/solutions/appchecker.php]



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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