I am working on a small module as part of a very large open-source project. The overall program records audio, and the user is able to select various modules which run analysis in real time. My module has a few text boxes that allows the user to keep track of operating parameters. Sometimes, when a lot of modules are loaded and operating on the data simultaneously, changing one of my text boxes causes the program to choke when it tries to alert my module that there is new data.
The line causing the error is
pamObservers.get(i);
pamObservers is an ArrayList of size 4, and my module is in index 3. i=3 when the error occurs. The error message is
IndexOutOfBoundsException: Index: 3, Size: 4
I'm using the Eclipse IDE, and I've added a breakpoint for that exception so it's stopping immediately. I look at pamObservers in the Variables view and I can see that my module is there - that index position isn't null or anything. I can type the line in the Expressions view and it returns the name of my module.
I don't know how to troubleshoot this, because it seems like it should work. The error is random - sometimes I have to change the text boxes 4 or 5 times before it occurs. Any suggestions would be appreciated, because I've been running around in circles for almost 2 hours and I just don't know what to do. Thanks so much.