Issue Details (XML | Word | Printable)

Key: LUCENE-1046
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Otis Gospodnetic
Reporter: Joe
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Lucene - Java

Dead code in SpellChecker.java (branch never executes)

Created: 03/Nov/07 11:34 PM   Updated: 24/May/08 02:46 PM
Return to search
Component/s: contrib/spellchecker
Affects Version/s: 2.2
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works LUCENE-1046.diff 2007-11-26 10:31 PM Daniel Naber 2 kB

Lucene Fields: Patch Available, New
Resolution Date: 22/May/08 06:36 AM


 Description  « Hide
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.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.