From b082f546ecf781af7d572c22dc52f0c49760452b Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sun, 10 Sep 2023 14:59:21 +0200 Subject: [PATCH] Polishing --- .../java/org/springframework/util/ReflectionUtils.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java b/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java index f632b21a46dd..620ed51b62e7 100644 --- a/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java +++ b/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java @@ -463,7 +463,7 @@ private static Method[] getDeclaredMethods(Class clazz, boolean defensive) { if (result == null) { try { Method[] declaredMethods = clazz.getDeclaredMethods(); - List defaultMethods = findConcreteMethodsOnInterfaces(clazz); + List defaultMethods = findDefaultMethodsOnInterfaces(clazz); if (defaultMethods != null) { result = new Method[declaredMethods.length + defaultMethods.size()]; System.arraycopy(declaredMethods, 0, result, 0, declaredMethods.length); @@ -487,15 +487,15 @@ private static Method[] getDeclaredMethods(Class clazz, boolean defensive) { } @Nullable - private static List findConcreteMethodsOnInterfaces(Class clazz) { + private static List findDefaultMethodsOnInterfaces(Class clazz) { List result = null; for (Class ifc : clazz.getInterfaces()) { - for (Method ifcMethod : ifc.getMethods()) { - if (ifcMethod.isDefault()) { + for (Method method : ifc.getMethods()) { + if (method.isDefault()) { if (result == null) { result = new ArrayList<>(); } - result.add(ifcMethod); + result.add(method); } } }