Ok, I'm kind of at a lose for what is happening and I'm hoping someone can help point me in the direction of my problem.
I'm getting the following error when I'm trying to create a chain to attach two bodies. It only happens randomly, so I can create and destroy the chain a number of times just fine but I eventually get the error. It doesn't seem like it's due to not cleaning up either because at times it will happen right away and other time it will take a while.
Exception in thread "AWT-EventQueue-0"
java.lang.ArrayIndexOutOfBoundsException: 74
at org.jbox2d.dynamics.Island.add(Island.java:423)
at org.jbox2d.dynamics.World.solve(World.java:976)
at org.jbox2d.dynamics.World.step(World.java:560)
That line in the Island.add() method is where it is trying to add a joint to the Island's array of joints.
I create the chain based on a touch event.
Initially I tried to create it "slowly" and I was using the update() method on an entity to add more links (this seemed wrong but I couldn't think of another way to handle this easily). I ran into this error so I changed it to create the entire chain on the initial touch event and still randomly got the error.
Any help would be appreciated.