You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Adrien Grand (JIRA)" <ji...@apache.org> on 2017/12/20 11:51:00 UTC

[jira] [Resolved] (LUCENE-8077) Integer remainder modulo 1 problem in /core/src/java/org/apache/lucene/index/CheckIndex.java

     [ https://issues.apache.org/jira/browse/LUCENE-8077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrien Grand resolved LUCENE-8077.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 7.3
                   master (8.0)

Thank you Xiaoshan Sun!

>    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
>             Fix For: master (8.0), 7.3
>
>   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