playframework/play1 — pull request #807 by angryziber (2014-10-16 19:18:23+00:00)
Title: [#1881] Cache annotated method lists already in a sorted state.

This prevents concurrent resorting of cached lists in multiple request threads, which sometimes results in ConcurrentModificationException, especially under Java 8.

We run 1.3.x branch on production on a site with >10 requests per second.
Yesterday we upgraded our production servers to Java 8.

Then, we started getting these exceptions from time to time:
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:901)
at java.util.ArrayList$Itr.next(ArrayList.java:851)
at play.mvc.ActionInvoker.handleBefores(ActionInvoker.java:301)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:141)

It doesn't happen with Java 7, probably because it has a more forgiving ArrayList implementation.