SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye
Issue Details (XML | Word | Printable)

Key: CMP-857
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Shay Banon
Reporter: Alex Burgel
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Compass

NegativeArraySizeException at CompassSpellChecker.formGrams line 332

Created: 06/Apr/09 10:10 AM   Updated: 06/Apr/09 10:27 AM
Component/s: Compass::Core
Affects Version/s: 2.1.0 GA
Fix Version/s: 2.2.0 GA


 Description  « Hide
in formGrams, if text.length() is less than ng, you will get a NegativeArraySizeException.

this can happen if you try to do a spell check on a zero length string. this happens because getMax(int) will return 2 if the word length is zero, so in formGrams, 0 - 2 + 1 = -1 and you get the NegativeArraySizeException.

i got this exception running 2.1.0, but i also took a look at the code in 2.1.3, and it looks like it will still happen, though i have not verified this.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Shay Banon added a comment - 06/Apr/09 10:24 AM
I see. For now, when you execute the suggest operation, can you check if the work length is higher than 0? I will find a nice way to fix this.

Shay Banon added a comment - 06/Apr/09 10:27 AM
Fixed in upcoming 2.2 GA. Simply check for null or zero length word to check suggestions on.