diff --git a/org.springframework.expression/readme.txt b/org.springframework.expression/readme.txt new file mode 100644 index 0000000000..8456cecd61 --- /dev/null +++ b/org.springframework.expression/readme.txt @@ -0,0 +1,13 @@ +List of outstanding things to think about - turn into JIRAs once distilled to a core set of issues + +High Importance + +- In the resolver/executor model we cache executors. They are currently recorded in the AST and so if the user chooses to evaluate an expression +in a different context then the stored executor may be incorrect. It may harmless 'fail' which would cause us to retrieve a new one, but +can it do anything malicious? In which case we either need to forget them when the context changes or store them elsewhere. Should caching be +something that can be switched on/off by the context? (shouldCacheExecutors() on the interface?) + +Low Importance + +- For the ternary operator, should isWritable() return true/false depending on evaluating the condition and check isWritable() of whichever branch it +would have taken? At the moment ternary expressions are just considered NOT writable. diff --git a/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java b/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java index 95aa2bc7f5..480b8b158b 100644 --- a/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java +++ b/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java @@ -29,9 +29,9 @@ import org.springframework.expression.EvaluationContext; import org.springframework.expression.EvaluationException; import org.springframework.expression.MethodExecutor; import org.springframework.expression.MethodResolver; +import org.springframework.expression.spel.ExpressionState; import org.springframework.expression.spel.SpelException; import org.springframework.expression.spel.SpelMessages; -import org.springframework.expression.spel.ExpressionState; import org.springframework.expression.spel.internal.Utils; import org.springframework.expression.spel.processors.AverageProcessor; import org.springframework.expression.spel.processors.CountProcessor; @@ -48,7 +48,7 @@ public class MethodReference extends SpelNode { private static Map registeredProcessers = new HashMap(); private final String name; - private MethodExecutor fastInvocationAccessor; // TODO should this be nulled if executing in a different context or is it OK to keep? + private MethodExecutor fastInvocationAccessor; static { registeredProcessers.put("count", new CountProcessor()); @@ -309,7 +309,8 @@ public class MethodReference extends SpelNode { if (cause instanceof SpelException) { throw (SpelException) cause; } else { - throw new SpelException(cause, SpelMessages.PROBLEM_LOCATING_METHOD, name, contextObject.getClass()); + throw new SpelException(cause, SpelMessages.PROBLEM_LOCATING_METHOD, name, contextObject + .getClass()); } } }