Please check readExternal() in FunctionMapperImpl
and VariableMapperImpl. The type of the persisted
Map has changed. Does this pose a consistency
problem with other components or older, already
persisted Maps?
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@696714
13f79535-47bb-0310-9956-
ffa450edef68
*/
public final class ExpressionBuilder implements NodeVisitor {
- private static final ConcurrentCache cache = new ConcurrentCache(5000);
+ private static final ConcurrentCache<String, Node> cache = new ConcurrentCache<String, Node>(5000);
private FunctionMapper fnMapper;
throw new ELException(MessageFactory.get("error.null"));
}
- Node n = (Node) cache.get(expr);
+ Node n = cache.get(expr);
if (n == null) {
try {
n = (new ELParser(new StringReader(expr)))
private static final long serialVersionUID = 1L;
- protected Map functions = null;
+ protected Map<String, Function> functions = null;
/*
* (non-Javadoc)
*/
public Method resolveFunction(String prefix, String localName) {
if (this.functions != null) {
- Function f = (Function) this.functions.get(prefix + ":" + localName);
+ Function f = this.functions.get(prefix + ":" + localName);
return f.getMethod();
}
return null;
public void addFunction(String prefix, String localName, Method m) {
if (this.functions == null) {
- this.functions = new HashMap();
+ this.functions = new HashMap<String, Function>();
}
Function f = new Function(prefix, localName, m);
synchronized (this) {
*/
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
- this.functions = (Map) in.readObject();
+ this.functions = (Map<String, Function>) in.readObject();
}
public static class Function implements Externalizable {
private static final long serialVersionUID = 1L;
- private Map vars = new HashMap();
+ private Map<String, ValueExpression> vars = new HashMap<String, ValueExpression>();
public VariableMapperImpl() {
super();
}
public ValueExpression resolveVariable(String variable) {
- return (ValueExpression) this.vars.get(variable);
+ return this.vars.get(variable);
}
public ValueExpression setVariable(String variable,
ValueExpression expression) {
- return (ValueExpression) this.vars.put(variable, expression);
+ return this.vars.put(variable, expression);
}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- this.vars = (Map) in.readObject();
+ this.vars = (Map<String, ValueExpression>) in.readObject();
}
public void writeExternal(ObjectOutput out) throws IOException {