Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.11.2
-
None
Description
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor will currently call the setter twice for each static property. It looks like the intention was to call it with either the naked value or parse the value as an OGNL expression but currently it is calling the setter twice regardless, i.e.
for (Iterator iterator = parameters.entrySet().iterator();
iterator.hasNext() {
Map.Entry entry = (Map.Entry) iterator.next();
(1) stack.setValue(entry.getKey().toString(), entry.getValue());
Object val = entry.getValue();
if (parse && val instanceof String)
(2) stack.setValue(entry.getKey().toString(), val);
}
I believe the intention was:
for (Iterator iterator = parameters.entrySet().iterator();
iterator.hasNext() {
Map.Entry entry = (Map.Entry) iterator.next();
Object val = entry.getValue();
if (parse && val instanceof String) { val = TextParseUtil.translateVariables((String) val, stack); }
stack.setValue(entry.getKey().toString(), val);
}