I am running up against an ArrayIndexOutOfBoundsException I don't understand. Here's the code:
What this is supposed to do is take elements that are duplicates of another element in the array, and put it into a separate array, and make a word count for each unique word. Right now it seems to build the wrong array, it will put the first element in the right spot and so on until the fourth element, which is (incorrectly) a duplicate. So the array should have three elements in it under the test conditions I am running, and then the program should proceed. But it's continuing to put elements in even though they are duplicates.
Here's the code for my equals method:
Which all looks right to me.
When I comment out the line in question, the rest of the program runs fine until I need that particular piece of information, but I am at a loss as to what is happening inside that loop. Any thoughts?