Merge branch '6.0.x'
This commit is contained in:
@@ -349,9 +349,9 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
|
||||
|
||||
@Nullable
|
||||
private Method findGetterForProperty(String propertyName, Class<?> clazz, Object target) {
|
||||
boolean targetIsaClass = (target instanceof Class);
|
||||
Method method = findGetterForProperty(propertyName, clazz, targetIsaClass);
|
||||
if (method == null && targetIsaClass) {
|
||||
boolean targetIsAClass = (target instanceof Class);
|
||||
Method method = findGetterForProperty(propertyName, clazz, targetIsAClass);
|
||||
if (method == null && targetIsAClass) {
|
||||
// Fallback for getter instance methods in java.lang.Class.
|
||||
method = findGetterForProperty(propertyName, Class.class, false);
|
||||
}
|
||||
|
||||
@@ -544,7 +544,7 @@ class EvaluationTests extends AbstractExpressionTests {
|
||||
|
||||
pattern += "?";
|
||||
assertThat(pattern).hasSize(1001);
|
||||
evaluateAndCheckError("'abc' matches '" + pattern + "'", Boolean.class, SpelMessage.MAX_REGEX_LENGTH_EXCEEDED);
|
||||
evaluateAndCheckError("'X' matches '" + pattern + "'", Boolean.class, SpelMessage.MAX_REGEX_LENGTH_EXCEEDED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class KotlinSpelReproTests {
|
||||
val expr = parser.parseExpression("#key.startsWith('hello')")
|
||||
context.registerFunction("suspendingGet", Config::class.java.getMethod("suspendingGet", String::class.java, Continuation::class.java))
|
||||
context.setVariable("key", "hello world")
|
||||
assertThat(expr .getValue(context, Boolean::class.java)).isTrue()
|
||||
assertThat(expr.getValue(context, Boolean::class.java)).isTrue()
|
||||
context.setVariable("key", "")
|
||||
assertThat(expr.getValue(context, Boolean::class.java)).isFalse()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user