Skip to content

Commit

Permalink
ReflectivePropertyAccessor uses interface methods if possible
Browse files Browse the repository at this point in the history
Closes gh-22242
  • Loading branch information
jhoeller committed Jun 11, 2019
1 parent b63c853 commit dec6d69
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,6 +41,7 @@
import org.springframework.expression.spel.CompilablePropertyAccessor;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;

Expand Down Expand Up @@ -413,7 +414,7 @@ private Method findMethodForProperty(String[] methodSuffixes, String prefix, Cla
method.getParameterCount() == numberOfParams &&
(!mustBeStatic || Modifier.isStatic(method.getModifiers())) &&
(requiredReturnTypes.isEmpty() || requiredReturnTypes.contains(method.getReturnType()))) {
return method;
return ClassUtils.getInterfaceMethodIfPossible(method);
}
}
}
Expand Down

0 comments on commit dec6d69

Please sign in to comment.