Concurrent Modification Error

We’ve been seeing a concurrent modification error.

It seems to be happening on on this line…


for (String script : jsExecQueue) {
target.addAttribute(“script”, script);

Funny, I just looked at this code today as I was trying to use Window.executeJavaScript() and it wasn’t working.
It appeared that I had a silly mistake in my JS and got no feedback on it (no error in the Firefox console, not sure why).

Do you use Window.executeJavaScript() in your program?

The only way I can see that happening is if you have a background thread that does something to the jsExecQueue while the component is being painted - you are probably calling Window.executeJavaScript() from a background thread without synchronizing that call to the application instance.