Details
Description
A user reported that they get an intermittent NullPointerException:
17:08:45,133 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.access$301(FacesCompositeELResolver.java:46)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver$4.invoke(FacesCompositeELResolver.java:108)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.invoke(FacesCompositeELResolver.java:148)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:104)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:61)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:925)
...
The only way I can explain this exception is that multiple threads are simultaneously invoking add() (and the resolvers[] array is becoming corrupted). Or multiple threads are simultaneously accessing add() and getValue() (and getValue() is accessing an uninitialized array element).
The EL spec is silent on thread-safety issues for CompositeELResolver (though it does identify thread safety issues for some other classes). I don't see anything spec-wise that prevents multi-threaded access to CompositeELResolver. If anyone has other opinions, let me know. Otherwise, looks like we need to close some timing windows in CompositeELResolver.