Only consider "is" methods with boolean returns
Fix regression introduced inb25e91a5where ReflectivePropertyAccessor does not consider the return type for "is" getters. Issue: SPR-11142 (cherry picked from commit85b0bfff)
This commit is contained in:
@@ -1831,6 +1831,17 @@ public class SpelReproTests extends ExpressionTestCase {
|
||||
equalTo((Object) "name"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR_11142() throws Exception {
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
SPR11142 rootObject = new SPR11142();
|
||||
Expression expression = parser.parseExpression("something");
|
||||
thrown.expect(SpelEvaluationException.class);
|
||||
thrown.expectMessage("property 'something' cannot be found");
|
||||
expression.getValue(context, rootObject);
|
||||
}
|
||||
|
||||
|
||||
private static enum ABC {A, B, C}
|
||||
|
||||
@@ -1914,4 +1925,12 @@ public class SpelReproTests extends ExpressionTestCase {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class SPR11142 {
|
||||
|
||||
public String isSomething() {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user