Summary: | javax.el.CompositeELResolver synchronization issue | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | Robert Goff <robert_goff828> |
Component: | Servlet & JSP API | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | qiuyunzhong |
Priority: | P2 | ||
Version: | trunk | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Attachments: | Synchronize change in CompositeELResolver.add |
The EL spec states the ELContexts are not thread-safe. By extension, neither are ELResolvers. The point regarding increasing the default size is a valid one. I have increased it to 8 for 7.0.5 onwards as per your suggestion. |
Created attachment 26310 [details] Synchronize change in CompositeELResolver.add The javax.el.CompositeELResolver.add method needs to synchronize around the update to the resolvers. If two threads call add, then it is possible for both threads get past the size check, then one thread updates the size, and when the next thread tries to update the size, it fails with an ArrayIndexOutOfBoundsException. Also, it makes sense to increase the default size of the ELResolver array since even the jasper EL adds 5 ELResolvers. I propose a default of 8.