lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Otis Gospodnetic (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-1046) Dead code in SpellChecker.java (branch never executes)
Date Sat, 17 May 2008 04:49:56 GMT

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

Otis Gospodnetic updated LUCENE-1046:
-------------------------------------

      Component/s:     (was: contrib/*)
                   contrib/spellchecker
    Lucene Fields: [New, Patch Available]  (was: [New])
         Assignee: Otis Gospodnetic

Good catch.  I'll commit next week.


> 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


Mime
View raw message