mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
fix: 修复ClassUtil.doGetMethods中引用错误问题
This commit is contained in:
parent
9cca7e69cc
commit
8c34b5a2fd
@ -289,8 +289,8 @@ public class ClassUtil {
|
||||
|
||||
private static void doGetMethods(Class<?> clazz, List<Method> methods, Predicate<Method> predicate, boolean firstOnly) {
|
||||
applyAllClass(clazz, currentClass -> {
|
||||
Method[] declaredMethods = clazz.getDeclaredMethods();
|
||||
if (clazz.isInterface()) {
|
||||
Method[] declaredMethods = currentClass.getDeclaredMethods();
|
||||
if (currentClass.isInterface()) {
|
||||
for (Method method : declaredMethods) {
|
||||
// 接口类只需要获取 default 方法
|
||||
if (method.isDefault() && (predicate == null || predicate.test(method))) {
|
||||
@ -314,7 +314,7 @@ public class ClassUtil {
|
||||
if (firstOnly && !methods.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
Class<?>[] interfaces = clazz.getInterfaces();
|
||||
Class<?>[] interfaces = currentClass.getInterfaces();
|
||||
for (Class<?> anInterface : interfaces) {
|
||||
doGetMethods(anInterface, methods, predicate, firstOnly);
|
||||
// 只获取第一个并且集合不为空就结束遍历
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user