Affects Version/s: 188.8.131.52
Fix Version/s: 2.5.x
Windows Vista, Java 7, Tomcat 7
Under a certain condition, calling a getter of an action causes method call stack overflow.
If a jsp file contains a <s:debug /> tag, it doesn't work and throws java.util.ConcurrentModificationException.
The condition is described below.
- The action class extends com.opensymphony.xwork2.ActionSupport.
- The action class has a getter and the getter calls the action class's method getText().
The argument of getText() is like "getterName.something".
If the getter is getFoo(), the argument is like 'foo.bar'.
- An empty properties file exists with the same name as the action class in the same package.
If the action class is TestAction, the name of the properties file is TestAction.properties
- The JSP file has tag <s:debug />.
It seems that <s:debug /> tries to call getFoo() and causes call stack overflow.
It has something to do with the problem?
1. <s:debug /> calls the action class's method getFoo().
2. getFoo() calls getText("foo.bar").
3. getText() calls LocalizedTextUtil.findText(Class aClass, String aTextName, Locale locale, String defaultMessage, Object args, ValueStack valueStack).
4. There is no property named foo.bar, so LocalizedTextUtil.findText() tries to get "foo.bar" from the value stack.
5. The action class instance is on the top of the value stack, so the action class's getFoo() is called.
6. Go back to 2. This loop continues infinitely....