From 6c1764f1e65a55a914b8d894101b5b555958f093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E9=92=9F=E4=B8=80=E5=85=AD?= <1477007136@qq.com> Date: Tue, 4 Jun 2024 22:15:20 +0800 Subject: [PATCH] fix: fix and close #I9V10O --- .../com/mybatisflex/core/util/ClassUtil.java | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/util/ClassUtil.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/util/ClassUtil.java index a964a367..515a7930 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/util/ClassUtil.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/util/ClassUtil.java @@ -285,23 +285,11 @@ public class ClassUtil { } Method[] declaredMethods = clazz.getDeclaredMethods(); - if (clazz.isInterface()) { - for (Method method : declaredMethods) { - // 接口类只需要获取 default 方法 - if (method.isDefault() && (predicate == null || predicate.test(method))) { - methods.add(method); - if (firstOnly) { - break; - } - } - } - } else { - for (Method method : declaredMethods) { - if (predicate == null || predicate.test(method)) { - methods.add(method); - if (firstOnly) { - break; - } + for (Method method : declaredMethods) { + if (predicate == null || predicate.test(method)) { + methods.add(method); + if (firstOnly) { + break; } } }