Skip to content

Commit dec6d69

Browse files
committed
ReflectivePropertyAccessor uses interface methods if possible
Closes gh-22242
1 parent b63c853 commit dec6d69

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectivePropertyAccessor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -41,6 +41,7 @@
4141
import org.springframework.expression.spel.CompilablePropertyAccessor;
4242
import org.springframework.lang.Nullable;
4343
import org.springframework.util.Assert;
44+
import org.springframework.util.ClassUtils;
4445
import org.springframework.util.ReflectionUtils;
4546
import org.springframework.util.StringUtils;
4647

@@ -413,7 +414,7 @@ private Method findMethodForProperty(String[] methodSuffixes, String prefix, Cla
413414
method.getParameterCount() == numberOfParams &&
414415
(!mustBeStatic || Modifier.isStatic(method.getModifiers())) &&
415416
(requiredReturnTypes.isEmpty() || requiredReturnTypes.contains(method.getReturnType()))) {
416-
return method;
417+
return ClassUtils.getInterfaceMethodIfPossible(method);
417418
}
418419
}
419420
}

0 commit comments

Comments
 (0)