Only consider "is" methods with boolean returns

Fix regression introduced in b25e91a5 where ReflectivePropertyAccessor
does not consider the return type for "is" getters.

Issue: SPR-11142
(cherry picked from commit 85b0bfff)
This commit is contained in:
Phillip Webb
2013-12-03 12:01:24 -08:00
parent 236981aaa9
commit dfed8afb26
2 changed files with 49 additions and 12 deletions

View File

@@ -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 "";
}
}
}