Use Method#isDefault to find default methods in interfaces

Closes gh-31197
This commit is contained in:
liaozan
2023-09-10 06:38:58 -05:00
committed by Sam Brannen
parent 6ca01e15cf
commit 9728b8cefd

View File

@@ -491,7 +491,7 @@ public abstract class ReflectionUtils {
List<Method> result = null;
for (Class<?> ifc : clazz.getInterfaces()) {
for (Method ifcMethod : ifc.getMethods()) {
if (!Modifier.isAbstract(ifcMethod.getModifiers())) {
if (ifcMethod.isDefault()) {
if (result == null) {
result = new ArrayList<>();
}