I just checked what the changes were between 1.0.3.1 and 1.0.3.2:
Boils down to this:
diff --git a/src/java/com/opensymphony/xwork/util/OgnlUtil.java b/src/java/com/opensymphony/xwork/util/OgnlUtil.java
index 318889f..abb11ad 100644
--- a/src/java/com/opensymphony/xwork/util/OgnlUtil.java
+++ b/src/java/com/opensymphony/xwork/util/OgnlUtil.java
@@ -21,6 +21,7 @@ import java.beans.PropertyDescriptor;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
/**
@@ -33,7 +34,7 @@ public class OgnlUtil {
private static final Log log = LogFactory.getLog(OgnlUtil.class);
- private static HashMap expressions = new HashMap();
+ private static Map expressions = new ConcurrentHashMap();
compile looks like this and is the only place in the code that uses the expressions Map:
public static Object compile(String expression) throws OgnlException {
Object o = expressions.get(expression);
if (o == null) {
o = Ognl.parseExpression(expression);
expressions.put(expression, o);
}
return o;
}
While using the ConcurrentHashMap might solve the original problem reported, the compile method is still susceptible to race conditions as the put if absent operation isn't atomic.
Resolving as fixed based on Stefan's comment above that the fixed xwork jar is included in 3.5