You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Otis Gospodnetic (JIRA)" <ji...@apache.org> on 2008/05/22 08:37:55 UTC
[jira] Resolved: (LUCENE-1046) Dead code in SpellChecker.java
(branch never executes)
[ https://issues.apache.org/jira/browse/LUCENE-1046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Otis Gospodnetic resolved LUCENE-1046.
--------------------------------------
Resolution: Fixed
Lucene Fields: [New, Patch Available] (was: [Patch Available, New])
Danke schön.
Committed revision 659019.
> 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/spellchecker
> Affects Versions: 2.2
> Reporter: Joe
> Assignee: Otis Gospodnetic
> 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