Jon Ruiz - 2013-02-14

I've been seeing the following crash in the field with the CyberLink for Java code:

java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
at java.util.Vector.arrayIndexOutOfBoundsException(
at java.util.Vector.elementAt(
at java.util.Vector.get(
at org.cybergarage.xml.NodeList.getNode(GraceRemote:28)
at org.cybergarage.upnp.ControlPoint.getDeviceList(GraceRemote:313)
at org.cybergarage.upnp.ControlPoint.renewSubscriberService$1349ef(GraceRemote:860)
at org.cybergarage.upnp.ControlPoint.renewSubscriberService(GraceRemote:871)

This is occurring on the renewsubscriber thread. There's another thread for removing expired devices. The renew iterates through the devNodeList, the remove deletes entries from the devNodeList and there's no synchronization between the two. Has anyone else seen this problem? Is it as simple as synchronizing the getDevice() and removeDevice() calls? I'm only seeing this in anonymous crash reports, and it's not common, so reproducing and testing isn't an option.