lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Naber (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-1046) Dead code in SpellChecker.java (branch never executes)
Date Mon, 26 Nov 2007 22:31:43 GMT

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

Daniel Naber updated LUCENE-1046:
---------------------------------

    Attachment: LUCENE-1046.diff

Thanks for your report, could you try out this patch?

> Dead code in SpellChecker.java (branch never executes)
> ------------------------------------------------------
>
>                 Key: LUCENE-1046
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1046
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.2
>            Reporter: Joe
>            Priority: Minor
>         Attachments: LUCENE-1046.diff
>
>
> SpellChecker contains the following lines of code:
>     final int goalFreq = (morePopular && ir != null) ? ir.docFreq(new Term(field,
word)) : 0;
>     // if the word exists in the real index and we don't care for word frequency, return
the word itself
>     if (!morePopular && goalFreq > 0) {
>       return new String[] { word };
>     }
> The branch will never execute: the only way for goalFreq to be greater than zero is if
morePopular is true, but if morePopular is true, the expression in the if statement evaluates
to false.

-- 
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


Mime
View raw message