Skip to content

Commit f295c8b

Browse files
committed
Polish "Add support for custom expression parsing"
See gh-27604
1 parent 40d84c2 commit f295c8b

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

spring-context/src/main/java/org/springframework/context/expression/CachedExpressionEvaluator.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ protected ParameterNameDiscoverer getParameterNameDiscoverer() {
7575

7676
/**
7777
* Return the {@link Expression} for the specified SpEL value
78-
* <p>Parse the expression if it hasn't been already.
78+
* <p>{@link #parseExpression(String) Parse the expression} if it hasn't been already.
7979
* @param cache the cache to use
8080
* @param elementKey the element on which the expression is defined
8181
* @param expression the expression to parse
@@ -92,18 +92,20 @@ protected Expression getExpression(Map<ExpressionKey, Expression> cache,
9292
return expr;
9393
}
9494

95-
private ExpressionKey createKey(AnnotatedElementKey elementKey, String expression) {
96-
return new ExpressionKey(elementKey, expression);
97-
}
98-
9995
/**
100-
* Parse the expression
96+
* Parse the specified {@code expression}.
10197
* @param expression the expression to parse
98+
* @since 5.3.13
10299
*/
103100
protected Expression parseExpression(String expression) {
104101
return getParser().parseExpression(expression);
105102
}
106103

104+
private ExpressionKey createKey(AnnotatedElementKey elementKey, String expression) {
105+
return new ExpressionKey(elementKey, expression);
106+
}
107+
108+
107109
/**
108110
* An expression key.
109111
*/

spring-context/src/test/java/org/springframework/context/expression/CachedExpressionEvaluatorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)