lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-8077) Integer remainder modulo 1 problem in /core/src/java/org/apache/lucene/index/CheckIndex.java
Date Wed, 20 Dec 2017 11:50:00 GMT

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

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

Commit 2487895b188e771594b11a7618be523d04424692 in lucene-solr's branch refs/heads/branch_7x
from [~jpountz]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2487895 ]

LUCENE-8077: Fixed wrong modulo usage in CheckIndex.


>    Integer remainder modulo 1 problem in /core/src/java/org/apache/lucene/index/CheckIndex.java
> -----------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-8077
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8077
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>    Affects Versions: 7.1
>            Reporter: Xiaoshan Sun
>              Labels: easyfix
>   Original Estimate: 1m
>  Remaining Estimate: 1m
>
> At  /core/src/java/org/apache/lucene/index/CheckIndex.java: 2198 
> The branch condition :
> {code:java}
> (i % 1 == 0)
> {code}
> is always true. 
> Did you mean (exp & 1) or (exp % 2) instead?
> The related code is show below:
> {code:java}
> 2198:        if (i % 1 == 0) {
>           int doc2 = it2.nextDoc();
>           if (doc != doc2) {
>             throw new RuntimeException("dv iterator field=" + field + ": doc=" + doc
+ " was not found through advance() (got: " + doc2 + ")");
>           }
>           if (it2.docID() != doc) {
>             throw new RuntimeException("dv iterator field=" + field + ": doc=" + doc
+ " reports wrong doc ID (got: " + it2.docID() + ")");
>           }
>         }
>       }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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


Mime
View raw message